resources_js_pages_Customers_Index_vue.js 696KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Customers_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***************************************************************************************************************************************************************************************************************!*\
  326. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***************************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _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/Customers/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. customers: 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 Pelanggan',
  355. acceptLabel: 'Iya',
  356. rejectLabel: 'Tidak',
  357. accept: function accept() {
  358. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia["delete"](route('customers.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/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  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/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  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, "Pelanggan", -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 Pelanggan"
  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.customers.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: "/customers",
  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 Pelanggan",
  963. icon: "pi pi-pencil",
  964. "class": "p-button-outlined",
  965. href: _ctx.route('customers.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('customers.edit', data.id)
  988. }, null, 8
  989. /* PROPS */
  990. , ["href"]), [[_directive_tooltip, 'Ubah Pelanggan', 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 Pelanggan', 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.customers.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/Customers/config.js":
  1034. /*!************************************************!*\
  1035. !*** ./resources/js/pages/Customers/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: 'phone',
  1051. header: 'No HP'
  1052. }, {
  1053. field: 'npwp',
  1054. header: 'NPWP'
  1055. }];
  1056. /***/ }),
  1057. /***/ "./resources/js/utils/menu.js":
  1058. /*!************************************!*\
  1059. !*** ./resources/js/utils/menu.js ***!
  1060. \************************************/
  1061. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1062. "use strict";
  1063. __webpack_require__.r(__webpack_exports__);
  1064. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1065. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1066. /* harmony export */ });
  1067. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1068. // Admin
  1069. 1: [{
  1070. label: 'Home',
  1071. items: [{
  1072. label: 'Dashboard',
  1073. icon: 'pi pi-chart-bar',
  1074. to: '/dashboards',
  1075. component: 'Dashboards/Index'
  1076. }]
  1077. }, {
  1078. label: 'Laporan',
  1079. items: []
  1080. }, {
  1081. label: 'Master',
  1082. items: [{
  1083. label: 'User',
  1084. icon: 'pi pi-user',
  1085. to: '/users',
  1086. component: 'Users/Index'
  1087. }]
  1088. }],
  1089. // Supervisor
  1090. 2: [{
  1091. label: 'Home',
  1092. items: [{
  1093. label: 'Dashboard',
  1094. icon: 'pi pi-chart-bar',
  1095. to: '/dashboards',
  1096. component: 'Dashboards/Index'
  1097. }]
  1098. }, {
  1099. label: 'Master',
  1100. items: [{
  1101. label: 'Pelanggan',
  1102. icon: 'pi pi-users',
  1103. to: '/customers',
  1104. component: 'Customers/Index'
  1105. }, {
  1106. label: 'Pembelian',
  1107. icon: 'pi pi-shopping-cart',
  1108. to: '/purchases',
  1109. component: 'Purchases/Index'
  1110. }, {
  1111. label: 'Penjualan',
  1112. icon: 'pi pi-tag',
  1113. to: '/sales',
  1114. component: 'Sales/Index'
  1115. }, {
  1116. label: 'Produk',
  1117. icon: 'pi pi-th-large',
  1118. to: '/products',
  1119. component: 'Products/Index'
  1120. }]
  1121. }],
  1122. // Operator
  1123. 3: [{
  1124. label: 'Home',
  1125. items: [{
  1126. label: 'Dashboard',
  1127. icon: 'pi pi-chart-bar',
  1128. to: '/dashboards',
  1129. component: 'Dashboards/Index'
  1130. }]
  1131. }, {
  1132. label: 'Master',
  1133. items: [{
  1134. label: 'Supplier',
  1135. icon: 'pi pi-shopping-cart',
  1136. to: '/suppliers',
  1137. component: 'Suppliers/Index'
  1138. }, {
  1139. label: 'Stok Barang',
  1140. icon: 'pi pi-box',
  1141. to: '/stock-products',
  1142. component: 'StockProducts/Index'
  1143. }]
  1144. }]
  1145. });
  1146. /***/ }),
  1147. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1148. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1149. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1150. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1151. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1152. "use strict";
  1153. __webpack_require__.r(__webpack_exports__);
  1154. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1155. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1156. /* harmony export */ });
  1157. /* 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");
  1158. /* 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__);
  1159. // Imports
  1160. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1161. // Module
  1162. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1163. // Exports
  1164. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1165. /***/ }),
  1166. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1167. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1168. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1169. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1170. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1171. "use strict";
  1172. __webpack_require__.r(__webpack_exports__);
  1173. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1174. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1175. /* harmony export */ });
  1176. /* 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");
  1177. /* 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__);
  1178. // Imports
  1179. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1180. // Module
  1181. ___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}", ""]);
  1182. // Exports
  1183. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1184. /***/ }),
  1185. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1186. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1187. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1188. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1189. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1190. "use strict";
  1191. __webpack_require__.r(__webpack_exports__);
  1192. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1193. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1194. /* harmony export */ });
  1195. /* 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");
  1196. /* 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__);
  1197. // Imports
  1198. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1199. // Module
  1200. ___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}", ""]);
  1201. // Exports
  1202. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1203. /***/ }),
  1204. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1205. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1206. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1207. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1208. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1209. "use strict";
  1210. __webpack_require__.r(__webpack_exports__);
  1211. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1212. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1213. /* harmony export */ });
  1214. /* 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");
  1215. /* 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__);
  1216. // Imports
  1217. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1218. // Module
  1219. ___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}", ""]);
  1220. // Exports
  1221. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1222. /***/ }),
  1223. /***/ "./node_modules/lodash/lodash.js":
  1224. /*!***************************************!*\
  1225. !*** ./node_modules/lodash/lodash.js ***!
  1226. \***************************************/
  1227. /***/ (function(module, exports, __webpack_require__) {
  1228. /* module decorator */ module = __webpack_require__.nmd(module);
  1229. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1230. * @license
  1231. * Lodash <https://lodash.com/>
  1232. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1233. * Released under MIT license <https://lodash.com/license>
  1234. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1235. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1236. */
  1237. ;(function() {
  1238. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1239. var undefined;
  1240. /** Used as the semantic version number. */
  1241. var VERSION = '4.17.21';
  1242. /** Used as the size to enable large array optimizations. */
  1243. var LARGE_ARRAY_SIZE = 200;
  1244. /** Error message constants. */
  1245. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1246. FUNC_ERROR_TEXT = 'Expected a function',
  1247. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1248. /** Used to stand-in for `undefined` hash values. */
  1249. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1250. /** Used as the maximum memoize cache size. */
  1251. var MAX_MEMOIZE_SIZE = 500;
  1252. /** Used as the internal argument placeholder. */
  1253. var PLACEHOLDER = '__lodash_placeholder__';
  1254. /** Used to compose bitmasks for cloning. */
  1255. var CLONE_DEEP_FLAG = 1,
  1256. CLONE_FLAT_FLAG = 2,
  1257. CLONE_SYMBOLS_FLAG = 4;
  1258. /** Used to compose bitmasks for value comparisons. */
  1259. var COMPARE_PARTIAL_FLAG = 1,
  1260. COMPARE_UNORDERED_FLAG = 2;
  1261. /** Used to compose bitmasks for function metadata. */
  1262. var WRAP_BIND_FLAG = 1,
  1263. WRAP_BIND_KEY_FLAG = 2,
  1264. WRAP_CURRY_BOUND_FLAG = 4,
  1265. WRAP_CURRY_FLAG = 8,
  1266. WRAP_CURRY_RIGHT_FLAG = 16,
  1267. WRAP_PARTIAL_FLAG = 32,
  1268. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1269. WRAP_ARY_FLAG = 128,
  1270. WRAP_REARG_FLAG = 256,
  1271. WRAP_FLIP_FLAG = 512;
  1272. /** Used as default options for `_.truncate`. */
  1273. var DEFAULT_TRUNC_LENGTH = 30,
  1274. DEFAULT_TRUNC_OMISSION = '...';
  1275. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1276. var HOT_COUNT = 800,
  1277. HOT_SPAN = 16;
  1278. /** Used to indicate the type of lazy iteratees. */
  1279. var LAZY_FILTER_FLAG = 1,
  1280. LAZY_MAP_FLAG = 2,
  1281. LAZY_WHILE_FLAG = 3;
  1282. /** Used as references for various `Number` constants. */
  1283. var INFINITY = 1 / 0,
  1284. MAX_SAFE_INTEGER = 9007199254740991,
  1285. MAX_INTEGER = 1.7976931348623157e+308,
  1286. NAN = 0 / 0;
  1287. /** Used as references for the maximum length and index of an array. */
  1288. var MAX_ARRAY_LENGTH = 4294967295,
  1289. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1290. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1291. /** Used to associate wrap methods with their bit flags. */
  1292. var wrapFlags = [
  1293. ['ary', WRAP_ARY_FLAG],
  1294. ['bind', WRAP_BIND_FLAG],
  1295. ['bindKey', WRAP_BIND_KEY_FLAG],
  1296. ['curry', WRAP_CURRY_FLAG],
  1297. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1298. ['flip', WRAP_FLIP_FLAG],
  1299. ['partial', WRAP_PARTIAL_FLAG],
  1300. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1301. ['rearg', WRAP_REARG_FLAG]
  1302. ];
  1303. /** `Object#toString` result references. */
  1304. var argsTag = '[object Arguments]',
  1305. arrayTag = '[object Array]',
  1306. asyncTag = '[object AsyncFunction]',
  1307. boolTag = '[object Boolean]',
  1308. dateTag = '[object Date]',
  1309. domExcTag = '[object DOMException]',
  1310. errorTag = '[object Error]',
  1311. funcTag = '[object Function]',
  1312. genTag = '[object GeneratorFunction]',
  1313. mapTag = '[object Map]',
  1314. numberTag = '[object Number]',
  1315. nullTag = '[object Null]',
  1316. objectTag = '[object Object]',
  1317. promiseTag = '[object Promise]',
  1318. proxyTag = '[object Proxy]',
  1319. regexpTag = '[object RegExp]',
  1320. setTag = '[object Set]',
  1321. stringTag = '[object String]',
  1322. symbolTag = '[object Symbol]',
  1323. undefinedTag = '[object Undefined]',
  1324. weakMapTag = '[object WeakMap]',
  1325. weakSetTag = '[object WeakSet]';
  1326. var arrayBufferTag = '[object ArrayBuffer]',
  1327. dataViewTag = '[object DataView]',
  1328. float32Tag = '[object Float32Array]',
  1329. float64Tag = '[object Float64Array]',
  1330. int8Tag = '[object Int8Array]',
  1331. int16Tag = '[object Int16Array]',
  1332. int32Tag = '[object Int32Array]',
  1333. uint8Tag = '[object Uint8Array]',
  1334. uint8ClampedTag = '[object Uint8ClampedArray]',
  1335. uint16Tag = '[object Uint16Array]',
  1336. uint32Tag = '[object Uint32Array]';
  1337. /** Used to match empty string literals in compiled template source. */
  1338. var reEmptyStringLeading = /\b__p \+= '';/g,
  1339. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1340. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1341. /** Used to match HTML entities and HTML characters. */
  1342. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1343. reUnescapedHtml = /[&<>"']/g,
  1344. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1345. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1346. /** Used to match template delimiters. */
  1347. var reEscape = /<%-([\s\S]+?)%>/g,
  1348. reEvaluate = /<%([\s\S]+?)%>/g,
  1349. reInterpolate = /<%=([\s\S]+?)%>/g;
  1350. /** Used to match property names within property paths. */
  1351. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1352. reIsPlainProp = /^\w*$/,
  1353. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1354. /**
  1355. * Used to match `RegExp`
  1356. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1357. */
  1358. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1359. reHasRegExpChar = RegExp(reRegExpChar.source);
  1360. /** Used to match leading whitespace. */
  1361. var reTrimStart = /^\s+/;
  1362. /** Used to match a single whitespace character. */
  1363. var reWhitespace = /\s/;
  1364. /** Used to match wrap detail comments. */
  1365. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1366. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1367. reSplitDetails = /,? & /;
  1368. /** Used to match words composed of alphanumeric characters. */
  1369. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1370. /**
  1371. * Used to validate the `validate` option in `_.template` variable.
  1372. *
  1373. * Forbids characters which could potentially change the meaning of the function argument definition:
  1374. * - "()," (modification of function parameters)
  1375. * - "=" (default value)
  1376. * - "[]{}" (destructuring of function parameters)
  1377. * - "/" (beginning of a comment)
  1378. * - whitespace
  1379. */
  1380. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1381. /** Used to match backslashes in property paths. */
  1382. var reEscapeChar = /\\(\\)?/g;
  1383. /**
  1384. * Used to match
  1385. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1386. */
  1387. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1388. /** Used to match `RegExp` flags from their coerced string values. */
  1389. var reFlags = /\w*$/;
  1390. /** Used to detect bad signed hexadecimal string values. */
  1391. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1392. /** Used to detect binary string values. */
  1393. var reIsBinary = /^0b[01]+$/i;
  1394. /** Used to detect host constructors (Safari). */
  1395. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1396. /** Used to detect octal string values. */
  1397. var reIsOctal = /^0o[0-7]+$/i;
  1398. /** Used to detect unsigned integer values. */
  1399. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1400. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1401. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1402. /** Used to ensure capturing order of template delimiters. */
  1403. var reNoMatch = /($^)/;
  1404. /** Used to match unescaped characters in compiled string literals. */
  1405. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1406. /** Used to compose unicode character classes. */
  1407. var rsAstralRange = '\\ud800-\\udfff',
  1408. rsComboMarksRange = '\\u0300-\\u036f',
  1409. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1410. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1411. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1412. rsDingbatRange = '\\u2700-\\u27bf',
  1413. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1414. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1415. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1416. rsPunctuationRange = '\\u2000-\\u206f',
  1417. 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',
  1418. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1419. rsVarRange = '\\ufe0e\\ufe0f',
  1420. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1421. /** Used to compose unicode capture groups. */
  1422. var rsApos = "['\u2019]",
  1423. rsAstral = '[' + rsAstralRange + ']',
  1424. rsBreak = '[' + rsBreakRange + ']',
  1425. rsCombo = '[' + rsComboRange + ']',
  1426. rsDigits = '\\d+',
  1427. rsDingbat = '[' + rsDingbatRange + ']',
  1428. rsLower = '[' + rsLowerRange + ']',
  1429. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1430. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1431. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1432. rsNonAstral = '[^' + rsAstralRange + ']',
  1433. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1434. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1435. rsUpper = '[' + rsUpperRange + ']',
  1436. rsZWJ = '\\u200d';
  1437. /** Used to compose unicode regexes. */
  1438. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1439. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1440. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1441. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1442. reOptMod = rsModifier + '?',
  1443. rsOptVar = '[' + rsVarRange + ']?',
  1444. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1445. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1446. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1447. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1448. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1449. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1450. /** Used to match apostrophes. */
  1451. var reApos = RegExp(rsApos, 'g');
  1452. /**
  1453. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1454. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1455. */
  1456. var reComboMark = RegExp(rsCombo, 'g');
  1457. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1458. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1459. /** Used to match complex or compound words. */
  1460. var reUnicodeWord = RegExp([
  1461. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1462. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1463. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1464. rsUpper + '+' + rsOptContrUpper,
  1465. rsOrdUpper,
  1466. rsOrdLower,
  1467. rsDigits,
  1468. rsEmoji
  1469. ].join('|'), 'g');
  1470. /** 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/). */
  1471. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1472. /** Used to detect strings that need a more robust regexp to match words. */
  1473. 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 ]/;
  1474. /** Used to assign default `context` object properties. */
  1475. var contextProps = [
  1476. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1477. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1478. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1479. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1480. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1481. ];
  1482. /** Used to make template sourceURLs easier to identify. */
  1483. var templateCounter = -1;
  1484. /** Used to identify `toStringTag` values of typed arrays. */
  1485. var typedArrayTags = {};
  1486. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1487. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1488. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1489. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1490. typedArrayTags[uint32Tag] = true;
  1491. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1492. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1493. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1494. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1495. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1496. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1497. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1498. typedArrayTags[weakMapTag] = false;
  1499. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1500. var cloneableTags = {};
  1501. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1502. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1503. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1504. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1505. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1506. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1507. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1508. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1509. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1510. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1511. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1512. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1513. cloneableTags[weakMapTag] = false;
  1514. /** Used to map Latin Unicode letters to basic Latin letters. */
  1515. var deburredLetters = {
  1516. // Latin-1 Supplement block.
  1517. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1518. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1519. '\xc7': 'C', '\xe7': 'c',
  1520. '\xd0': 'D', '\xf0': 'd',
  1521. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1522. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1523. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1524. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1525. '\xd1': 'N', '\xf1': 'n',
  1526. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1527. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1528. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1529. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1530. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1531. '\xc6': 'Ae', '\xe6': 'ae',
  1532. '\xde': 'Th', '\xfe': 'th',
  1533. '\xdf': 'ss',
  1534. // Latin Extended-A block.
  1535. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1536. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1537. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1538. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1539. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1540. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1541. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1542. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1543. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1544. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1545. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1546. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1547. '\u0134': 'J', '\u0135': 'j',
  1548. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1549. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1550. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1551. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1552. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1553. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1554. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1555. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1556. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1557. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1558. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1559. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1560. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1561. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1562. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1563. '\u0174': 'W', '\u0175': 'w',
  1564. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1565. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1566. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1567. '\u0132': 'IJ', '\u0133': 'ij',
  1568. '\u0152': 'Oe', '\u0153': 'oe',
  1569. '\u0149': "'n", '\u017f': 's'
  1570. };
  1571. /** Used to map characters to HTML entities. */
  1572. var htmlEscapes = {
  1573. '&': '&amp;',
  1574. '<': '&lt;',
  1575. '>': '&gt;',
  1576. '"': '&quot;',
  1577. "'": '&#39;'
  1578. };
  1579. /** Used to map HTML entities to characters. */
  1580. var htmlUnescapes = {
  1581. '&amp;': '&',
  1582. '&lt;': '<',
  1583. '&gt;': '>',
  1584. '&quot;': '"',
  1585. '&#39;': "'"
  1586. };
  1587. /** Used to escape characters for inclusion in compiled string literals. */
  1588. var stringEscapes = {
  1589. '\\': '\\',
  1590. "'": "'",
  1591. '\n': 'n',
  1592. '\r': 'r',
  1593. '\u2028': 'u2028',
  1594. '\u2029': 'u2029'
  1595. };
  1596. /** Built-in method references without a dependency on `root`. */
  1597. var freeParseFloat = parseFloat,
  1598. freeParseInt = parseInt;
  1599. /** Detect free variable `global` from Node.js. */
  1600. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1601. /** Detect free variable `self`. */
  1602. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1603. /** Used as a reference to the global object. */
  1604. var root = freeGlobal || freeSelf || Function('return this')();
  1605. /** Detect free variable `exports`. */
  1606. var freeExports = true && exports && !exports.nodeType && exports;
  1607. /** Detect free variable `module`. */
  1608. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1609. /** Detect the popular CommonJS extension `module.exports`. */
  1610. var moduleExports = freeModule && freeModule.exports === freeExports;
  1611. /** Detect free variable `process` from Node.js. */
  1612. var freeProcess = moduleExports && freeGlobal.process;
  1613. /** Used to access faster Node.js helpers. */
  1614. var nodeUtil = (function() {
  1615. try {
  1616. // Use `util.types` for Node.js 10+.
  1617. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1618. if (types) {
  1619. return types;
  1620. }
  1621. // Legacy `process.binding('util')` for Node.js < 10.
  1622. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1623. } catch (e) {}
  1624. }());
  1625. /* Node.js helper references. */
  1626. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1627. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1628. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1629. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1630. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1631. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1632. /*--------------------------------------------------------------------------*/
  1633. /**
  1634. * A faster alternative to `Function#apply`, this function invokes `func`
  1635. * with the `this` binding of `thisArg` and the arguments of `args`.
  1636. *
  1637. * @private
  1638. * @param {Function} func The function to invoke.
  1639. * @param {*} thisArg The `this` binding of `func`.
  1640. * @param {Array} args The arguments to invoke `func` with.
  1641. * @returns {*} Returns the result of `func`.
  1642. */
  1643. function apply(func, thisArg, args) {
  1644. switch (args.length) {
  1645. case 0: return func.call(thisArg);
  1646. case 1: return func.call(thisArg, args[0]);
  1647. case 2: return func.call(thisArg, args[0], args[1]);
  1648. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1649. }
  1650. return func.apply(thisArg, args);
  1651. }
  1652. /**
  1653. * A specialized version of `baseAggregator` for arrays.
  1654. *
  1655. * @private
  1656. * @param {Array} [array] The array to iterate over.
  1657. * @param {Function} setter The function to set `accumulator` values.
  1658. * @param {Function} iteratee The iteratee to transform keys.
  1659. * @param {Object} accumulator The initial aggregated object.
  1660. * @returns {Function} Returns `accumulator`.
  1661. */
  1662. function arrayAggregator(array, setter, iteratee, accumulator) {
  1663. var index = -1,
  1664. length = array == null ? 0 : array.length;
  1665. while (++index < length) {
  1666. var value = array[index];
  1667. setter(accumulator, value, iteratee(value), array);
  1668. }
  1669. return accumulator;
  1670. }
  1671. /**
  1672. * A specialized version of `_.forEach` for arrays without support for
  1673. * iteratee shorthands.
  1674. *
  1675. * @private
  1676. * @param {Array} [array] The array to iterate over.
  1677. * @param {Function} iteratee The function invoked per iteration.
  1678. * @returns {Array} Returns `array`.
  1679. */
  1680. function arrayEach(array, iteratee) {
  1681. var index = -1,
  1682. length = array == null ? 0 : array.length;
  1683. while (++index < length) {
  1684. if (iteratee(array[index], index, array) === false) {
  1685. break;
  1686. }
  1687. }
  1688. return array;
  1689. }
  1690. /**
  1691. * A specialized version of `_.forEachRight` for arrays without support for
  1692. * iteratee shorthands.
  1693. *
  1694. * @private
  1695. * @param {Array} [array] The array to iterate over.
  1696. * @param {Function} iteratee The function invoked per iteration.
  1697. * @returns {Array} Returns `array`.
  1698. */
  1699. function arrayEachRight(array, iteratee) {
  1700. var length = array == null ? 0 : array.length;
  1701. while (length--) {
  1702. if (iteratee(array[length], length, array) === false) {
  1703. break;
  1704. }
  1705. }
  1706. return array;
  1707. }
  1708. /**
  1709. * A specialized version of `_.every` for arrays without support for
  1710. * iteratee shorthands.
  1711. *
  1712. * @private
  1713. * @param {Array} [array] The array to iterate over.
  1714. * @param {Function} predicate The function invoked per iteration.
  1715. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1716. * else `false`.
  1717. */
  1718. function arrayEvery(array, predicate) {
  1719. var index = -1,
  1720. length = array == null ? 0 : array.length;
  1721. while (++index < length) {
  1722. if (!predicate(array[index], index, array)) {
  1723. return false;
  1724. }
  1725. }
  1726. return true;
  1727. }
  1728. /**
  1729. * A specialized version of `_.filter` for arrays without support for
  1730. * iteratee shorthands.
  1731. *
  1732. * @private
  1733. * @param {Array} [array] The array to iterate over.
  1734. * @param {Function} predicate The function invoked per iteration.
  1735. * @returns {Array} Returns the new filtered array.
  1736. */
  1737. function arrayFilter(array, predicate) {
  1738. var index = -1,
  1739. length = array == null ? 0 : array.length,
  1740. resIndex = 0,
  1741. result = [];
  1742. while (++index < length) {
  1743. var value = array[index];
  1744. if (predicate(value, index, array)) {
  1745. result[resIndex++] = value;
  1746. }
  1747. }
  1748. return result;
  1749. }
  1750. /**
  1751. * A specialized version of `_.includes` for arrays without support for
  1752. * specifying an index to search from.
  1753. *
  1754. * @private
  1755. * @param {Array} [array] The array to inspect.
  1756. * @param {*} target The value to search for.
  1757. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1758. */
  1759. function arrayIncludes(array, value) {
  1760. var length = array == null ? 0 : array.length;
  1761. return !!length && baseIndexOf(array, value, 0) > -1;
  1762. }
  1763. /**
  1764. * This function is like `arrayIncludes` except that it accepts a comparator.
  1765. *
  1766. * @private
  1767. * @param {Array} [array] The array to inspect.
  1768. * @param {*} target The value to search for.
  1769. * @param {Function} comparator The comparator invoked per element.
  1770. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1771. */
  1772. function arrayIncludesWith(array, value, comparator) {
  1773. var index = -1,
  1774. length = array == null ? 0 : array.length;
  1775. while (++index < length) {
  1776. if (comparator(value, array[index])) {
  1777. return true;
  1778. }
  1779. }
  1780. return false;
  1781. }
  1782. /**
  1783. * A specialized version of `_.map` for arrays without support for iteratee
  1784. * shorthands.
  1785. *
  1786. * @private
  1787. * @param {Array} [array] The array to iterate over.
  1788. * @param {Function} iteratee The function invoked per iteration.
  1789. * @returns {Array} Returns the new mapped array.
  1790. */
  1791. function arrayMap(array, iteratee) {
  1792. var index = -1,
  1793. length = array == null ? 0 : array.length,
  1794. result = Array(length);
  1795. while (++index < length) {
  1796. result[index] = iteratee(array[index], index, array);
  1797. }
  1798. return result;
  1799. }
  1800. /**
  1801. * Appends the elements of `values` to `array`.
  1802. *
  1803. * @private
  1804. * @param {Array} array The array to modify.
  1805. * @param {Array} values The values to append.
  1806. * @returns {Array} Returns `array`.
  1807. */
  1808. function arrayPush(array, values) {
  1809. var index = -1,
  1810. length = values.length,
  1811. offset = array.length;
  1812. while (++index < length) {
  1813. array[offset + index] = values[index];
  1814. }
  1815. return array;
  1816. }
  1817. /**
  1818. * A specialized version of `_.reduce` for arrays without support for
  1819. * iteratee shorthands.
  1820. *
  1821. * @private
  1822. * @param {Array} [array] The array to iterate over.
  1823. * @param {Function} iteratee The function invoked per iteration.
  1824. * @param {*} [accumulator] The initial value.
  1825. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1826. * the initial value.
  1827. * @returns {*} Returns the accumulated value.
  1828. */
  1829. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1830. var index = -1,
  1831. length = array == null ? 0 : array.length;
  1832. if (initAccum && length) {
  1833. accumulator = array[++index];
  1834. }
  1835. while (++index < length) {
  1836. accumulator = iteratee(accumulator, array[index], index, array);
  1837. }
  1838. return accumulator;
  1839. }
  1840. /**
  1841. * A specialized version of `_.reduceRight` for arrays without support for
  1842. * iteratee shorthands.
  1843. *
  1844. * @private
  1845. * @param {Array} [array] The array to iterate over.
  1846. * @param {Function} iteratee The function invoked per iteration.
  1847. * @param {*} [accumulator] The initial value.
  1848. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1849. * the initial value.
  1850. * @returns {*} Returns the accumulated value.
  1851. */
  1852. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1853. var length = array == null ? 0 : array.length;
  1854. if (initAccum && length) {
  1855. accumulator = array[--length];
  1856. }
  1857. while (length--) {
  1858. accumulator = iteratee(accumulator, array[length], length, array);
  1859. }
  1860. return accumulator;
  1861. }
  1862. /**
  1863. * A specialized version of `_.some` for arrays without support for iteratee
  1864. * shorthands.
  1865. *
  1866. * @private
  1867. * @param {Array} [array] The array to iterate over.
  1868. * @param {Function} predicate The function invoked per iteration.
  1869. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1870. * else `false`.
  1871. */
  1872. function arraySome(array, predicate) {
  1873. var index = -1,
  1874. length = array == null ? 0 : array.length;
  1875. while (++index < length) {
  1876. if (predicate(array[index], index, array)) {
  1877. return true;
  1878. }
  1879. }
  1880. return false;
  1881. }
  1882. /**
  1883. * Gets the size of an ASCII `string`.
  1884. *
  1885. * @private
  1886. * @param {string} string The string inspect.
  1887. * @returns {number} Returns the string size.
  1888. */
  1889. var asciiSize = baseProperty('length');
  1890. /**
  1891. * Converts an ASCII `string` to an array.
  1892. *
  1893. * @private
  1894. * @param {string} string The string to convert.
  1895. * @returns {Array} Returns the converted array.
  1896. */
  1897. function asciiToArray(string) {
  1898. return string.split('');
  1899. }
  1900. /**
  1901. * Splits an ASCII `string` into an array of its words.
  1902. *
  1903. * @private
  1904. * @param {string} The string to inspect.
  1905. * @returns {Array} Returns the words of `string`.
  1906. */
  1907. function asciiWords(string) {
  1908. return string.match(reAsciiWord) || [];
  1909. }
  1910. /**
  1911. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1912. * without support for iteratee shorthands, which iterates over `collection`
  1913. * using `eachFunc`.
  1914. *
  1915. * @private
  1916. * @param {Array|Object} collection The collection to inspect.
  1917. * @param {Function} predicate The function invoked per iteration.
  1918. * @param {Function} eachFunc The function to iterate over `collection`.
  1919. * @returns {*} Returns the found element or its key, else `undefined`.
  1920. */
  1921. function baseFindKey(collection, predicate, eachFunc) {
  1922. var result;
  1923. eachFunc(collection, function(value, key, collection) {
  1924. if (predicate(value, key, collection)) {
  1925. result = key;
  1926. return false;
  1927. }
  1928. });
  1929. return result;
  1930. }
  1931. /**
  1932. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1933. * support for iteratee shorthands.
  1934. *
  1935. * @private
  1936. * @param {Array} array The array to inspect.
  1937. * @param {Function} predicate The function invoked per iteration.
  1938. * @param {number} fromIndex The index to search from.
  1939. * @param {boolean} [fromRight] Specify iterating from right to left.
  1940. * @returns {number} Returns the index of the matched value, else `-1`.
  1941. */
  1942. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1943. var length = array.length,
  1944. index = fromIndex + (fromRight ? 1 : -1);
  1945. while ((fromRight ? index-- : ++index < length)) {
  1946. if (predicate(array[index], index, array)) {
  1947. return index;
  1948. }
  1949. }
  1950. return -1;
  1951. }
  1952. /**
  1953. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1954. *
  1955. * @private
  1956. * @param {Array} array The array to inspect.
  1957. * @param {*} value The value to search for.
  1958. * @param {number} fromIndex The index to search from.
  1959. * @returns {number} Returns the index of the matched value, else `-1`.
  1960. */
  1961. function baseIndexOf(array, value, fromIndex) {
  1962. return value === value
  1963. ? strictIndexOf(array, value, fromIndex)
  1964. : baseFindIndex(array, baseIsNaN, fromIndex);
  1965. }
  1966. /**
  1967. * This function is like `baseIndexOf` except that it accepts a comparator.
  1968. *
  1969. * @private
  1970. * @param {Array} array The array to inspect.
  1971. * @param {*} value The value to search for.
  1972. * @param {number} fromIndex The index to search from.
  1973. * @param {Function} comparator The comparator invoked per element.
  1974. * @returns {number} Returns the index of the matched value, else `-1`.
  1975. */
  1976. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1977. var index = fromIndex - 1,
  1978. length = array.length;
  1979. while (++index < length) {
  1980. if (comparator(array[index], value)) {
  1981. return index;
  1982. }
  1983. }
  1984. return -1;
  1985. }
  1986. /**
  1987. * The base implementation of `_.isNaN` without support for number objects.
  1988. *
  1989. * @private
  1990. * @param {*} value The value to check.
  1991. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1992. */
  1993. function baseIsNaN(value) {
  1994. return value !== value;
  1995. }
  1996. /**
  1997. * The base implementation of `_.mean` and `_.meanBy` without support for
  1998. * iteratee shorthands.
  1999. *
  2000. * @private
  2001. * @param {Array} array The array to iterate over.
  2002. * @param {Function} iteratee The function invoked per iteration.
  2003. * @returns {number} Returns the mean.
  2004. */
  2005. function baseMean(array, iteratee) {
  2006. var length = array == null ? 0 : array.length;
  2007. return length ? (baseSum(array, iteratee) / length) : NAN;
  2008. }
  2009. /**
  2010. * The base implementation of `_.property` without support for deep paths.
  2011. *
  2012. * @private
  2013. * @param {string} key The key of the property to get.
  2014. * @returns {Function} Returns the new accessor function.
  2015. */
  2016. function baseProperty(key) {
  2017. return function(object) {
  2018. return object == null ? undefined : object[key];
  2019. };
  2020. }
  2021. /**
  2022. * The base implementation of `_.propertyOf` without support for deep paths.
  2023. *
  2024. * @private
  2025. * @param {Object} object The object to query.
  2026. * @returns {Function} Returns the new accessor function.
  2027. */
  2028. function basePropertyOf(object) {
  2029. return function(key) {
  2030. return object == null ? undefined : object[key];
  2031. };
  2032. }
  2033. /**
  2034. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2035. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2036. *
  2037. * @private
  2038. * @param {Array|Object} collection The collection to iterate over.
  2039. * @param {Function} iteratee The function invoked per iteration.
  2040. * @param {*} accumulator The initial value.
  2041. * @param {boolean} initAccum Specify using the first or last element of
  2042. * `collection` as the initial value.
  2043. * @param {Function} eachFunc The function to iterate over `collection`.
  2044. * @returns {*} Returns the accumulated value.
  2045. */
  2046. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2047. eachFunc(collection, function(value, index, collection) {
  2048. accumulator = initAccum
  2049. ? (initAccum = false, value)
  2050. : iteratee(accumulator, value, index, collection);
  2051. });
  2052. return accumulator;
  2053. }
  2054. /**
  2055. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2056. * sort order of `array` and replaces criteria objects with their corresponding
  2057. * values.
  2058. *
  2059. * @private
  2060. * @param {Array} array The array to sort.
  2061. * @param {Function} comparer The function to define sort order.
  2062. * @returns {Array} Returns `array`.
  2063. */
  2064. function baseSortBy(array, comparer) {
  2065. var length = array.length;
  2066. array.sort(comparer);
  2067. while (length--) {
  2068. array[length] = array[length].value;
  2069. }
  2070. return array;
  2071. }
  2072. /**
  2073. * The base implementation of `_.sum` and `_.sumBy` without support for
  2074. * iteratee shorthands.
  2075. *
  2076. * @private
  2077. * @param {Array} array The array to iterate over.
  2078. * @param {Function} iteratee The function invoked per iteration.
  2079. * @returns {number} Returns the sum.
  2080. */
  2081. function baseSum(array, iteratee) {
  2082. var result,
  2083. index = -1,
  2084. length = array.length;
  2085. while (++index < length) {
  2086. var current = iteratee(array[index]);
  2087. if (current !== undefined) {
  2088. result = result === undefined ? current : (result + current);
  2089. }
  2090. }
  2091. return result;
  2092. }
  2093. /**
  2094. * The base implementation of `_.times` without support for iteratee shorthands
  2095. * or max array length checks.
  2096. *
  2097. * @private
  2098. * @param {number} n The number of times to invoke `iteratee`.
  2099. * @param {Function} iteratee The function invoked per iteration.
  2100. * @returns {Array} Returns the array of results.
  2101. */
  2102. function baseTimes(n, iteratee) {
  2103. var index = -1,
  2104. result = Array(n);
  2105. while (++index < n) {
  2106. result[index] = iteratee(index);
  2107. }
  2108. return result;
  2109. }
  2110. /**
  2111. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2112. * of key-value pairs for `object` corresponding to the property names of `props`.
  2113. *
  2114. * @private
  2115. * @param {Object} object The object to query.
  2116. * @param {Array} props The property names to get values for.
  2117. * @returns {Object} Returns the key-value pairs.
  2118. */
  2119. function baseToPairs(object, props) {
  2120. return arrayMap(props, function(key) {
  2121. return [key, object[key]];
  2122. });
  2123. }
  2124. /**
  2125. * The base implementation of `_.trim`.
  2126. *
  2127. * @private
  2128. * @param {string} string The string to trim.
  2129. * @returns {string} Returns the trimmed string.
  2130. */
  2131. function baseTrim(string) {
  2132. return string
  2133. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2134. : string;
  2135. }
  2136. /**
  2137. * The base implementation of `_.unary` without support for storing metadata.
  2138. *
  2139. * @private
  2140. * @param {Function} func The function to cap arguments for.
  2141. * @returns {Function} Returns the new capped function.
  2142. */
  2143. function baseUnary(func) {
  2144. return function(value) {
  2145. return func(value);
  2146. };
  2147. }
  2148. /**
  2149. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2150. * array of `object` property values corresponding to the property names
  2151. * of `props`.
  2152. *
  2153. * @private
  2154. * @param {Object} object The object to query.
  2155. * @param {Array} props The property names to get values for.
  2156. * @returns {Object} Returns the array of property values.
  2157. */
  2158. function baseValues(object, props) {
  2159. return arrayMap(props, function(key) {
  2160. return object[key];
  2161. });
  2162. }
  2163. /**
  2164. * Checks if a `cache` value for `key` exists.
  2165. *
  2166. * @private
  2167. * @param {Object} cache The cache to query.
  2168. * @param {string} key The key of the entry to check.
  2169. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2170. */
  2171. function cacheHas(cache, key) {
  2172. return cache.has(key);
  2173. }
  2174. /**
  2175. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2176. * that is not found in the character symbols.
  2177. *
  2178. * @private
  2179. * @param {Array} strSymbols The string symbols to inspect.
  2180. * @param {Array} chrSymbols The character symbols to find.
  2181. * @returns {number} Returns the index of the first unmatched string symbol.
  2182. */
  2183. function charsStartIndex(strSymbols, chrSymbols) {
  2184. var index = -1,
  2185. length = strSymbols.length;
  2186. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2187. return index;
  2188. }
  2189. /**
  2190. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2191. * that is not found in the character symbols.
  2192. *
  2193. * @private
  2194. * @param {Array} strSymbols The string symbols to inspect.
  2195. * @param {Array} chrSymbols The character symbols to find.
  2196. * @returns {number} Returns the index of the last unmatched string symbol.
  2197. */
  2198. function charsEndIndex(strSymbols, chrSymbols) {
  2199. var index = strSymbols.length;
  2200. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2201. return index;
  2202. }
  2203. /**
  2204. * Gets the number of `placeholder` occurrences in `array`.
  2205. *
  2206. * @private
  2207. * @param {Array} array The array to inspect.
  2208. * @param {*} placeholder The placeholder to search for.
  2209. * @returns {number} Returns the placeholder count.
  2210. */
  2211. function countHolders(array, placeholder) {
  2212. var length = array.length,
  2213. result = 0;
  2214. while (length--) {
  2215. if (array[length] === placeholder) {
  2216. ++result;
  2217. }
  2218. }
  2219. return result;
  2220. }
  2221. /**
  2222. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2223. * letters to basic Latin letters.
  2224. *
  2225. * @private
  2226. * @param {string} letter The matched letter to deburr.
  2227. * @returns {string} Returns the deburred letter.
  2228. */
  2229. var deburrLetter = basePropertyOf(deburredLetters);
  2230. /**
  2231. * Used by `_.escape` to convert characters to HTML entities.
  2232. *
  2233. * @private
  2234. * @param {string} chr The matched character to escape.
  2235. * @returns {string} Returns the escaped character.
  2236. */
  2237. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2238. /**
  2239. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2240. *
  2241. * @private
  2242. * @param {string} chr The matched character to escape.
  2243. * @returns {string} Returns the escaped character.
  2244. */
  2245. function escapeStringChar(chr) {
  2246. return '\\' + stringEscapes[chr];
  2247. }
  2248. /**
  2249. * Gets the value at `key` of `object`.
  2250. *
  2251. * @private
  2252. * @param {Object} [object] The object to query.
  2253. * @param {string} key The key of the property to get.
  2254. * @returns {*} Returns the property value.
  2255. */
  2256. function getValue(object, key) {
  2257. return object == null ? undefined : object[key];
  2258. }
  2259. /**
  2260. * Checks if `string` contains Unicode symbols.
  2261. *
  2262. * @private
  2263. * @param {string} string The string to inspect.
  2264. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2265. */
  2266. function hasUnicode(string) {
  2267. return reHasUnicode.test(string);
  2268. }
  2269. /**
  2270. * Checks if `string` contains a word composed of Unicode symbols.
  2271. *
  2272. * @private
  2273. * @param {string} string The string to inspect.
  2274. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2275. */
  2276. function hasUnicodeWord(string) {
  2277. return reHasUnicodeWord.test(string);
  2278. }
  2279. /**
  2280. * Converts `iterator` to an array.
  2281. *
  2282. * @private
  2283. * @param {Object} iterator The iterator to convert.
  2284. * @returns {Array} Returns the converted array.
  2285. */
  2286. function iteratorToArray(iterator) {
  2287. var data,
  2288. result = [];
  2289. while (!(data = iterator.next()).done) {
  2290. result.push(data.value);
  2291. }
  2292. return result;
  2293. }
  2294. /**
  2295. * Converts `map` to its key-value pairs.
  2296. *
  2297. * @private
  2298. * @param {Object} map The map to convert.
  2299. * @returns {Array} Returns the key-value pairs.
  2300. */
  2301. function mapToArray(map) {
  2302. var index = -1,
  2303. result = Array(map.size);
  2304. map.forEach(function(value, key) {
  2305. result[++index] = [key, value];
  2306. });
  2307. return result;
  2308. }
  2309. /**
  2310. * Creates a unary function that invokes `func` with its argument transformed.
  2311. *
  2312. * @private
  2313. * @param {Function} func The function to wrap.
  2314. * @param {Function} transform The argument transform.
  2315. * @returns {Function} Returns the new function.
  2316. */
  2317. function overArg(func, transform) {
  2318. return function(arg) {
  2319. return func(transform(arg));
  2320. };
  2321. }
  2322. /**
  2323. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2324. * and returns an array of their indexes.
  2325. *
  2326. * @private
  2327. * @param {Array} array The array to modify.
  2328. * @param {*} placeholder The placeholder to replace.
  2329. * @returns {Array} Returns the new array of placeholder indexes.
  2330. */
  2331. function replaceHolders(array, placeholder) {
  2332. var index = -1,
  2333. length = array.length,
  2334. resIndex = 0,
  2335. result = [];
  2336. while (++index < length) {
  2337. var value = array[index];
  2338. if (value === placeholder || value === PLACEHOLDER) {
  2339. array[index] = PLACEHOLDER;
  2340. result[resIndex++] = index;
  2341. }
  2342. }
  2343. return result;
  2344. }
  2345. /**
  2346. * Converts `set` to an array of its values.
  2347. *
  2348. * @private
  2349. * @param {Object} set The set to convert.
  2350. * @returns {Array} Returns the values.
  2351. */
  2352. function setToArray(set) {
  2353. var index = -1,
  2354. result = Array(set.size);
  2355. set.forEach(function(value) {
  2356. result[++index] = value;
  2357. });
  2358. return result;
  2359. }
  2360. /**
  2361. * Converts `set` to its value-value pairs.
  2362. *
  2363. * @private
  2364. * @param {Object} set The set to convert.
  2365. * @returns {Array} Returns the value-value pairs.
  2366. */
  2367. function setToPairs(set) {
  2368. var index = -1,
  2369. result = Array(set.size);
  2370. set.forEach(function(value) {
  2371. result[++index] = [value, value];
  2372. });
  2373. return result;
  2374. }
  2375. /**
  2376. * A specialized version of `_.indexOf` which performs strict equality
  2377. * comparisons of values, i.e. `===`.
  2378. *
  2379. * @private
  2380. * @param {Array} array The array to inspect.
  2381. * @param {*} value The value to search for.
  2382. * @param {number} fromIndex The index to search from.
  2383. * @returns {number} Returns the index of the matched value, else `-1`.
  2384. */
  2385. function strictIndexOf(array, value, fromIndex) {
  2386. var index = fromIndex - 1,
  2387. length = array.length;
  2388. while (++index < length) {
  2389. if (array[index] === value) {
  2390. return index;
  2391. }
  2392. }
  2393. return -1;
  2394. }
  2395. /**
  2396. * A specialized version of `_.lastIndexOf` which performs strict equality
  2397. * comparisons of values, i.e. `===`.
  2398. *
  2399. * @private
  2400. * @param {Array} array The array to inspect.
  2401. * @param {*} value The value to search for.
  2402. * @param {number} fromIndex The index to search from.
  2403. * @returns {number} Returns the index of the matched value, else `-1`.
  2404. */
  2405. function strictLastIndexOf(array, value, fromIndex) {
  2406. var index = fromIndex + 1;
  2407. while (index--) {
  2408. if (array[index] === value) {
  2409. return index;
  2410. }
  2411. }
  2412. return index;
  2413. }
  2414. /**
  2415. * Gets the number of symbols in `string`.
  2416. *
  2417. * @private
  2418. * @param {string} string The string to inspect.
  2419. * @returns {number} Returns the string size.
  2420. */
  2421. function stringSize(string) {
  2422. return hasUnicode(string)
  2423. ? unicodeSize(string)
  2424. : asciiSize(string);
  2425. }
  2426. /**
  2427. * Converts `string` to an array.
  2428. *
  2429. * @private
  2430. * @param {string} string The string to convert.
  2431. * @returns {Array} Returns the converted array.
  2432. */
  2433. function stringToArray(string) {
  2434. return hasUnicode(string)
  2435. ? unicodeToArray(string)
  2436. : asciiToArray(string);
  2437. }
  2438. /**
  2439. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2440. * character of `string`.
  2441. *
  2442. * @private
  2443. * @param {string} string The string to inspect.
  2444. * @returns {number} Returns the index of the last non-whitespace character.
  2445. */
  2446. function trimmedEndIndex(string) {
  2447. var index = string.length;
  2448. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2449. return index;
  2450. }
  2451. /**
  2452. * Used by `_.unescape` to convert HTML entities to characters.
  2453. *
  2454. * @private
  2455. * @param {string} chr The matched character to unescape.
  2456. * @returns {string} Returns the unescaped character.
  2457. */
  2458. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2459. /**
  2460. * Gets the size of a Unicode `string`.
  2461. *
  2462. * @private
  2463. * @param {string} string The string inspect.
  2464. * @returns {number} Returns the string size.
  2465. */
  2466. function unicodeSize(string) {
  2467. var result = reUnicode.lastIndex = 0;
  2468. while (reUnicode.test(string)) {
  2469. ++result;
  2470. }
  2471. return result;
  2472. }
  2473. /**
  2474. * Converts a Unicode `string` to an array.
  2475. *
  2476. * @private
  2477. * @param {string} string The string to convert.
  2478. * @returns {Array} Returns the converted array.
  2479. */
  2480. function unicodeToArray(string) {
  2481. return string.match(reUnicode) || [];
  2482. }
  2483. /**
  2484. * Splits a Unicode `string` into an array of its words.
  2485. *
  2486. * @private
  2487. * @param {string} The string to inspect.
  2488. * @returns {Array} Returns the words of `string`.
  2489. */
  2490. function unicodeWords(string) {
  2491. return string.match(reUnicodeWord) || [];
  2492. }
  2493. /*--------------------------------------------------------------------------*/
  2494. /**
  2495. * Create a new pristine `lodash` function using the `context` object.
  2496. *
  2497. * @static
  2498. * @memberOf _
  2499. * @since 1.1.0
  2500. * @category Util
  2501. * @param {Object} [context=root] The context object.
  2502. * @returns {Function} Returns a new `lodash` function.
  2503. * @example
  2504. *
  2505. * _.mixin({ 'foo': _.constant('foo') });
  2506. *
  2507. * var lodash = _.runInContext();
  2508. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2509. *
  2510. * _.isFunction(_.foo);
  2511. * // => true
  2512. * _.isFunction(_.bar);
  2513. * // => false
  2514. *
  2515. * lodash.isFunction(lodash.foo);
  2516. * // => false
  2517. * lodash.isFunction(lodash.bar);
  2518. * // => true
  2519. *
  2520. * // Create a suped-up `defer` in Node.js.
  2521. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2522. */
  2523. var runInContext = (function runInContext(context) {
  2524. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2525. /** Built-in constructor references. */
  2526. var Array = context.Array,
  2527. Date = context.Date,
  2528. Error = context.Error,
  2529. Function = context.Function,
  2530. Math = context.Math,
  2531. Object = context.Object,
  2532. RegExp = context.RegExp,
  2533. String = context.String,
  2534. TypeError = context.TypeError;
  2535. /** Used for built-in method references. */
  2536. var arrayProto = Array.prototype,
  2537. funcProto = Function.prototype,
  2538. objectProto = Object.prototype;
  2539. /** Used to detect overreaching core-js shims. */
  2540. var coreJsData = context['__core-js_shared__'];
  2541. /** Used to resolve the decompiled source of functions. */
  2542. var funcToString = funcProto.toString;
  2543. /** Used to check objects for own properties. */
  2544. var hasOwnProperty = objectProto.hasOwnProperty;
  2545. /** Used to generate unique IDs. */
  2546. var idCounter = 0;
  2547. /** Used to detect methods masquerading as native. */
  2548. var maskSrcKey = (function() {
  2549. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2550. return uid ? ('Symbol(src)_1.' + uid) : '';
  2551. }());
  2552. /**
  2553. * Used to resolve the
  2554. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2555. * of values.
  2556. */
  2557. var nativeObjectToString = objectProto.toString;
  2558. /** Used to infer the `Object` constructor. */
  2559. var objectCtorString = funcToString.call(Object);
  2560. /** Used to restore the original `_` reference in `_.noConflict`. */
  2561. var oldDash = root._;
  2562. /** Used to detect if a method is native. */
  2563. var reIsNative = RegExp('^' +
  2564. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2565. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2566. );
  2567. /** Built-in value references. */
  2568. var Buffer = moduleExports ? context.Buffer : undefined,
  2569. Symbol = context.Symbol,
  2570. Uint8Array = context.Uint8Array,
  2571. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2572. getPrototype = overArg(Object.getPrototypeOf, Object),
  2573. objectCreate = Object.create,
  2574. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2575. splice = arrayProto.splice,
  2576. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2577. symIterator = Symbol ? Symbol.iterator : undefined,
  2578. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2579. var defineProperty = (function() {
  2580. try {
  2581. var func = getNative(Object, 'defineProperty');
  2582. func({}, '', {});
  2583. return func;
  2584. } catch (e) {}
  2585. }());
  2586. /** Mocked built-ins. */
  2587. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2588. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2589. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2590. /* Built-in method references for those with the same name as other `lodash` methods. */
  2591. var nativeCeil = Math.ceil,
  2592. nativeFloor = Math.floor,
  2593. nativeGetSymbols = Object.getOwnPropertySymbols,
  2594. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2595. nativeIsFinite = context.isFinite,
  2596. nativeJoin = arrayProto.join,
  2597. nativeKeys = overArg(Object.keys, Object),
  2598. nativeMax = Math.max,
  2599. nativeMin = Math.min,
  2600. nativeNow = Date.now,
  2601. nativeParseInt = context.parseInt,
  2602. nativeRandom = Math.random,
  2603. nativeReverse = arrayProto.reverse;
  2604. /* Built-in method references that are verified to be native. */
  2605. var DataView = getNative(context, 'DataView'),
  2606. Map = getNative(context, 'Map'),
  2607. Promise = getNative(context, 'Promise'),
  2608. Set = getNative(context, 'Set'),
  2609. WeakMap = getNative(context, 'WeakMap'),
  2610. nativeCreate = getNative(Object, 'create');
  2611. /** Used to store function metadata. */
  2612. var metaMap = WeakMap && new WeakMap;
  2613. /** Used to lookup unminified function names. */
  2614. var realNames = {};
  2615. /** Used to detect maps, sets, and weakmaps. */
  2616. var dataViewCtorString = toSource(DataView),
  2617. mapCtorString = toSource(Map),
  2618. promiseCtorString = toSource(Promise),
  2619. setCtorString = toSource(Set),
  2620. weakMapCtorString = toSource(WeakMap);
  2621. /** Used to convert symbols to primitives and strings. */
  2622. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2623. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2624. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2625. /*------------------------------------------------------------------------*/
  2626. /**
  2627. * Creates a `lodash` object which wraps `value` to enable implicit method
  2628. * chain sequences. Methods that operate on and return arrays, collections,
  2629. * and functions can be chained together. Methods that retrieve a single value
  2630. * or may return a primitive value will automatically end the chain sequence
  2631. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2632. * with `_#value`.
  2633. *
  2634. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2635. * enabled using `_.chain`.
  2636. *
  2637. * The execution of chained methods is lazy, that is, it's deferred until
  2638. * `_#value` is implicitly or explicitly called.
  2639. *
  2640. * Lazy evaluation allows several methods to support shortcut fusion.
  2641. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2642. * the creation of intermediate arrays and can greatly reduce the number of
  2643. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2644. * fusion if the section is applied to an array and iteratees accept only
  2645. * one argument. The heuristic for whether a section qualifies for shortcut
  2646. * fusion is subject to change.
  2647. *
  2648. * Chaining is supported in custom builds as long as the `_#value` method is
  2649. * directly or indirectly included in the build.
  2650. *
  2651. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2652. *
  2653. * The wrapper `Array` methods are:
  2654. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2655. *
  2656. * The wrapper `String` methods are:
  2657. * `replace` and `split`
  2658. *
  2659. * The wrapper methods that support shortcut fusion are:
  2660. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2661. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2662. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2663. *
  2664. * The chainable wrapper methods are:
  2665. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2666. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2667. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2668. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2669. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2670. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2671. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2672. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2673. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2674. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2675. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2676. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2677. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2678. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2679. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2680. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2681. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2682. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2683. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2684. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2685. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2686. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2687. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2688. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2689. *
  2690. * The wrapper methods that are **not** chainable by default are:
  2691. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2692. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2693. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2694. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2695. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2696. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2697. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2698. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2699. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2700. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2701. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2702. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2703. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2704. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2705. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2706. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2707. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2708. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2709. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2710. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2711. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2712. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2713. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2714. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2715. * `upperFirst`, `value`, and `words`
  2716. *
  2717. * @name _
  2718. * @constructor
  2719. * @category Seq
  2720. * @param {*} value The value to wrap in a `lodash` instance.
  2721. * @returns {Object} Returns the new `lodash` wrapper instance.
  2722. * @example
  2723. *
  2724. * function square(n) {
  2725. * return n * n;
  2726. * }
  2727. *
  2728. * var wrapped = _([1, 2, 3]);
  2729. *
  2730. * // Returns an unwrapped value.
  2731. * wrapped.reduce(_.add);
  2732. * // => 6
  2733. *
  2734. * // Returns a wrapped value.
  2735. * var squares = wrapped.map(square);
  2736. *
  2737. * _.isArray(squares);
  2738. * // => false
  2739. *
  2740. * _.isArray(squares.value());
  2741. * // => true
  2742. */
  2743. function lodash(value) {
  2744. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2745. if (value instanceof LodashWrapper) {
  2746. return value;
  2747. }
  2748. if (hasOwnProperty.call(value, '__wrapped__')) {
  2749. return wrapperClone(value);
  2750. }
  2751. }
  2752. return new LodashWrapper(value);
  2753. }
  2754. /**
  2755. * The base implementation of `_.create` without support for assigning
  2756. * properties to the created object.
  2757. *
  2758. * @private
  2759. * @param {Object} proto The object to inherit from.
  2760. * @returns {Object} Returns the new object.
  2761. */
  2762. var baseCreate = (function() {
  2763. function object() {}
  2764. return function(proto) {
  2765. if (!isObject(proto)) {
  2766. return {};
  2767. }
  2768. if (objectCreate) {
  2769. return objectCreate(proto);
  2770. }
  2771. object.prototype = proto;
  2772. var result = new object;
  2773. object.prototype = undefined;
  2774. return result;
  2775. };
  2776. }());
  2777. /**
  2778. * The function whose prototype chain sequence wrappers inherit from.
  2779. *
  2780. * @private
  2781. */
  2782. function baseLodash() {
  2783. // No operation performed.
  2784. }
  2785. /**
  2786. * The base constructor for creating `lodash` wrapper objects.
  2787. *
  2788. * @private
  2789. * @param {*} value The value to wrap.
  2790. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2791. */
  2792. function LodashWrapper(value, chainAll) {
  2793. this.__wrapped__ = value;
  2794. this.__actions__ = [];
  2795. this.__chain__ = !!chainAll;
  2796. this.__index__ = 0;
  2797. this.__values__ = undefined;
  2798. }
  2799. /**
  2800. * By default, the template delimiters used by lodash are like those in
  2801. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2802. * following template settings to use alternative delimiters.
  2803. *
  2804. * @static
  2805. * @memberOf _
  2806. * @type {Object}
  2807. */
  2808. lodash.templateSettings = {
  2809. /**
  2810. * Used to detect `data` property values to be HTML-escaped.
  2811. *
  2812. * @memberOf _.templateSettings
  2813. * @type {RegExp}
  2814. */
  2815. 'escape': reEscape,
  2816. /**
  2817. * Used to detect code to be evaluated.
  2818. *
  2819. * @memberOf _.templateSettings
  2820. * @type {RegExp}
  2821. */
  2822. 'evaluate': reEvaluate,
  2823. /**
  2824. * Used to detect `data` property values to inject.
  2825. *
  2826. * @memberOf _.templateSettings
  2827. * @type {RegExp}
  2828. */
  2829. 'interpolate': reInterpolate,
  2830. /**
  2831. * Used to reference the data object in the template text.
  2832. *
  2833. * @memberOf _.templateSettings
  2834. * @type {string}
  2835. */
  2836. 'variable': '',
  2837. /**
  2838. * Used to import variables into the compiled template.
  2839. *
  2840. * @memberOf _.templateSettings
  2841. * @type {Object}
  2842. */
  2843. 'imports': {
  2844. /**
  2845. * A reference to the `lodash` function.
  2846. *
  2847. * @memberOf _.templateSettings.imports
  2848. * @type {Function}
  2849. */
  2850. '_': lodash
  2851. }
  2852. };
  2853. // Ensure wrappers are instances of `baseLodash`.
  2854. lodash.prototype = baseLodash.prototype;
  2855. lodash.prototype.constructor = lodash;
  2856. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2857. LodashWrapper.prototype.constructor = LodashWrapper;
  2858. /*------------------------------------------------------------------------*/
  2859. /**
  2860. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2861. *
  2862. * @private
  2863. * @constructor
  2864. * @param {*} value The value to wrap.
  2865. */
  2866. function LazyWrapper(value) {
  2867. this.__wrapped__ = value;
  2868. this.__actions__ = [];
  2869. this.__dir__ = 1;
  2870. this.__filtered__ = false;
  2871. this.__iteratees__ = [];
  2872. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2873. this.__views__ = [];
  2874. }
  2875. /**
  2876. * Creates a clone of the lazy wrapper object.
  2877. *
  2878. * @private
  2879. * @name clone
  2880. * @memberOf LazyWrapper
  2881. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2882. */
  2883. function lazyClone() {
  2884. var result = new LazyWrapper(this.__wrapped__);
  2885. result.__actions__ = copyArray(this.__actions__);
  2886. result.__dir__ = this.__dir__;
  2887. result.__filtered__ = this.__filtered__;
  2888. result.__iteratees__ = copyArray(this.__iteratees__);
  2889. result.__takeCount__ = this.__takeCount__;
  2890. result.__views__ = copyArray(this.__views__);
  2891. return result;
  2892. }
  2893. /**
  2894. * Reverses the direction of lazy iteration.
  2895. *
  2896. * @private
  2897. * @name reverse
  2898. * @memberOf LazyWrapper
  2899. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2900. */
  2901. function lazyReverse() {
  2902. if (this.__filtered__) {
  2903. var result = new LazyWrapper(this);
  2904. result.__dir__ = -1;
  2905. result.__filtered__ = true;
  2906. } else {
  2907. result = this.clone();
  2908. result.__dir__ *= -1;
  2909. }
  2910. return result;
  2911. }
  2912. /**
  2913. * Extracts the unwrapped value from its lazy wrapper.
  2914. *
  2915. * @private
  2916. * @name value
  2917. * @memberOf LazyWrapper
  2918. * @returns {*} Returns the unwrapped value.
  2919. */
  2920. function lazyValue() {
  2921. var array = this.__wrapped__.value(),
  2922. dir = this.__dir__,
  2923. isArr = isArray(array),
  2924. isRight = dir < 0,
  2925. arrLength = isArr ? array.length : 0,
  2926. view = getView(0, arrLength, this.__views__),
  2927. start = view.start,
  2928. end = view.end,
  2929. length = end - start,
  2930. index = isRight ? end : (start - 1),
  2931. iteratees = this.__iteratees__,
  2932. iterLength = iteratees.length,
  2933. resIndex = 0,
  2934. takeCount = nativeMin(length, this.__takeCount__);
  2935. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2936. return baseWrapperValue(array, this.__actions__);
  2937. }
  2938. var result = [];
  2939. outer:
  2940. while (length-- && resIndex < takeCount) {
  2941. index += dir;
  2942. var iterIndex = -1,
  2943. value = array[index];
  2944. while (++iterIndex < iterLength) {
  2945. var data = iteratees[iterIndex],
  2946. iteratee = data.iteratee,
  2947. type = data.type,
  2948. computed = iteratee(value);
  2949. if (type == LAZY_MAP_FLAG) {
  2950. value = computed;
  2951. } else if (!computed) {
  2952. if (type == LAZY_FILTER_FLAG) {
  2953. continue outer;
  2954. } else {
  2955. break outer;
  2956. }
  2957. }
  2958. }
  2959. result[resIndex++] = value;
  2960. }
  2961. return result;
  2962. }
  2963. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2964. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2965. LazyWrapper.prototype.constructor = LazyWrapper;
  2966. /*------------------------------------------------------------------------*/
  2967. /**
  2968. * Creates a hash object.
  2969. *
  2970. * @private
  2971. * @constructor
  2972. * @param {Array} [entries] The key-value pairs to cache.
  2973. */
  2974. function Hash(entries) {
  2975. var index = -1,
  2976. length = entries == null ? 0 : entries.length;
  2977. this.clear();
  2978. while (++index < length) {
  2979. var entry = entries[index];
  2980. this.set(entry[0], entry[1]);
  2981. }
  2982. }
  2983. /**
  2984. * Removes all key-value entries from the hash.
  2985. *
  2986. * @private
  2987. * @name clear
  2988. * @memberOf Hash
  2989. */
  2990. function hashClear() {
  2991. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2992. this.size = 0;
  2993. }
  2994. /**
  2995. * Removes `key` and its value from the hash.
  2996. *
  2997. * @private
  2998. * @name delete
  2999. * @memberOf Hash
  3000. * @param {Object} hash The hash to modify.
  3001. * @param {string} key The key of the value to remove.
  3002. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3003. */
  3004. function hashDelete(key) {
  3005. var result = this.has(key) && delete this.__data__[key];
  3006. this.size -= result ? 1 : 0;
  3007. return result;
  3008. }
  3009. /**
  3010. * Gets the hash value for `key`.
  3011. *
  3012. * @private
  3013. * @name get
  3014. * @memberOf Hash
  3015. * @param {string} key The key of the value to get.
  3016. * @returns {*} Returns the entry value.
  3017. */
  3018. function hashGet(key) {
  3019. var data = this.__data__;
  3020. if (nativeCreate) {
  3021. var result = data[key];
  3022. return result === HASH_UNDEFINED ? undefined : result;
  3023. }
  3024. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3025. }
  3026. /**
  3027. * Checks if a hash value for `key` exists.
  3028. *
  3029. * @private
  3030. * @name has
  3031. * @memberOf Hash
  3032. * @param {string} key The key of the entry to check.
  3033. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3034. */
  3035. function hashHas(key) {
  3036. var data = this.__data__;
  3037. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3038. }
  3039. /**
  3040. * Sets the hash `key` to `value`.
  3041. *
  3042. * @private
  3043. * @name set
  3044. * @memberOf Hash
  3045. * @param {string} key The key of the value to set.
  3046. * @param {*} value The value to set.
  3047. * @returns {Object} Returns the hash instance.
  3048. */
  3049. function hashSet(key, value) {
  3050. var data = this.__data__;
  3051. this.size += this.has(key) ? 0 : 1;
  3052. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3053. return this;
  3054. }
  3055. // Add methods to `Hash`.
  3056. Hash.prototype.clear = hashClear;
  3057. Hash.prototype['delete'] = hashDelete;
  3058. Hash.prototype.get = hashGet;
  3059. Hash.prototype.has = hashHas;
  3060. Hash.prototype.set = hashSet;
  3061. /*------------------------------------------------------------------------*/
  3062. /**
  3063. * Creates an list cache object.
  3064. *
  3065. * @private
  3066. * @constructor
  3067. * @param {Array} [entries] The key-value pairs to cache.
  3068. */
  3069. function ListCache(entries) {
  3070. var index = -1,
  3071. length = entries == null ? 0 : entries.length;
  3072. this.clear();
  3073. while (++index < length) {
  3074. var entry = entries[index];
  3075. this.set(entry[0], entry[1]);
  3076. }
  3077. }
  3078. /**
  3079. * Removes all key-value entries from the list cache.
  3080. *
  3081. * @private
  3082. * @name clear
  3083. * @memberOf ListCache
  3084. */
  3085. function listCacheClear() {
  3086. this.__data__ = [];
  3087. this.size = 0;
  3088. }
  3089. /**
  3090. * Removes `key` and its value from the list cache.
  3091. *
  3092. * @private
  3093. * @name delete
  3094. * @memberOf ListCache
  3095. * @param {string} key The key of the value to remove.
  3096. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3097. */
  3098. function listCacheDelete(key) {
  3099. var data = this.__data__,
  3100. index = assocIndexOf(data, key);
  3101. if (index < 0) {
  3102. return false;
  3103. }
  3104. var lastIndex = data.length - 1;
  3105. if (index == lastIndex) {
  3106. data.pop();
  3107. } else {
  3108. splice.call(data, index, 1);
  3109. }
  3110. --this.size;
  3111. return true;
  3112. }
  3113. /**
  3114. * Gets the list cache value for `key`.
  3115. *
  3116. * @private
  3117. * @name get
  3118. * @memberOf ListCache
  3119. * @param {string} key The key of the value to get.
  3120. * @returns {*} Returns the entry value.
  3121. */
  3122. function listCacheGet(key) {
  3123. var data = this.__data__,
  3124. index = assocIndexOf(data, key);
  3125. return index < 0 ? undefined : data[index][1];
  3126. }
  3127. /**
  3128. * Checks if a list cache value for `key` exists.
  3129. *
  3130. * @private
  3131. * @name has
  3132. * @memberOf ListCache
  3133. * @param {string} key The key of the entry to check.
  3134. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3135. */
  3136. function listCacheHas(key) {
  3137. return assocIndexOf(this.__data__, key) > -1;
  3138. }
  3139. /**
  3140. * Sets the list cache `key` to `value`.
  3141. *
  3142. * @private
  3143. * @name set
  3144. * @memberOf ListCache
  3145. * @param {string} key The key of the value to set.
  3146. * @param {*} value The value to set.
  3147. * @returns {Object} Returns the list cache instance.
  3148. */
  3149. function listCacheSet(key, value) {
  3150. var data = this.__data__,
  3151. index = assocIndexOf(data, key);
  3152. if (index < 0) {
  3153. ++this.size;
  3154. data.push([key, value]);
  3155. } else {
  3156. data[index][1] = value;
  3157. }
  3158. return this;
  3159. }
  3160. // Add methods to `ListCache`.
  3161. ListCache.prototype.clear = listCacheClear;
  3162. ListCache.prototype['delete'] = listCacheDelete;
  3163. ListCache.prototype.get = listCacheGet;
  3164. ListCache.prototype.has = listCacheHas;
  3165. ListCache.prototype.set = listCacheSet;
  3166. /*------------------------------------------------------------------------*/
  3167. /**
  3168. * Creates a map cache object to store key-value pairs.
  3169. *
  3170. * @private
  3171. * @constructor
  3172. * @param {Array} [entries] The key-value pairs to cache.
  3173. */
  3174. function MapCache(entries) {
  3175. var index = -1,
  3176. length = entries == null ? 0 : entries.length;
  3177. this.clear();
  3178. while (++index < length) {
  3179. var entry = entries[index];
  3180. this.set(entry[0], entry[1]);
  3181. }
  3182. }
  3183. /**
  3184. * Removes all key-value entries from the map.
  3185. *
  3186. * @private
  3187. * @name clear
  3188. * @memberOf MapCache
  3189. */
  3190. function mapCacheClear() {
  3191. this.size = 0;
  3192. this.__data__ = {
  3193. 'hash': new Hash,
  3194. 'map': new (Map || ListCache),
  3195. 'string': new Hash
  3196. };
  3197. }
  3198. /**
  3199. * Removes `key` and its value from the map.
  3200. *
  3201. * @private
  3202. * @name delete
  3203. * @memberOf MapCache
  3204. * @param {string} key The key of the value to remove.
  3205. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3206. */
  3207. function mapCacheDelete(key) {
  3208. var result = getMapData(this, key)['delete'](key);
  3209. this.size -= result ? 1 : 0;
  3210. return result;
  3211. }
  3212. /**
  3213. * Gets the map value for `key`.
  3214. *
  3215. * @private
  3216. * @name get
  3217. * @memberOf MapCache
  3218. * @param {string} key The key of the value to get.
  3219. * @returns {*} Returns the entry value.
  3220. */
  3221. function mapCacheGet(key) {
  3222. return getMapData(this, key).get(key);
  3223. }
  3224. /**
  3225. * Checks if a map value for `key` exists.
  3226. *
  3227. * @private
  3228. * @name has
  3229. * @memberOf MapCache
  3230. * @param {string} key The key of the entry to check.
  3231. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3232. */
  3233. function mapCacheHas(key) {
  3234. return getMapData(this, key).has(key);
  3235. }
  3236. /**
  3237. * Sets the map `key` to `value`.
  3238. *
  3239. * @private
  3240. * @name set
  3241. * @memberOf MapCache
  3242. * @param {string} key The key of the value to set.
  3243. * @param {*} value The value to set.
  3244. * @returns {Object} Returns the map cache instance.
  3245. */
  3246. function mapCacheSet(key, value) {
  3247. var data = getMapData(this, key),
  3248. size = data.size;
  3249. data.set(key, value);
  3250. this.size += data.size == size ? 0 : 1;
  3251. return this;
  3252. }
  3253. // Add methods to `MapCache`.
  3254. MapCache.prototype.clear = mapCacheClear;
  3255. MapCache.prototype['delete'] = mapCacheDelete;
  3256. MapCache.prototype.get = mapCacheGet;
  3257. MapCache.prototype.has = mapCacheHas;
  3258. MapCache.prototype.set = mapCacheSet;
  3259. /*------------------------------------------------------------------------*/
  3260. /**
  3261. *
  3262. * Creates an array cache object to store unique values.
  3263. *
  3264. * @private
  3265. * @constructor
  3266. * @param {Array} [values] The values to cache.
  3267. */
  3268. function SetCache(values) {
  3269. var index = -1,
  3270. length = values == null ? 0 : values.length;
  3271. this.__data__ = new MapCache;
  3272. while (++index < length) {
  3273. this.add(values[index]);
  3274. }
  3275. }
  3276. /**
  3277. * Adds `value` to the array cache.
  3278. *
  3279. * @private
  3280. * @name add
  3281. * @memberOf SetCache
  3282. * @alias push
  3283. * @param {*} value The value to cache.
  3284. * @returns {Object} Returns the cache instance.
  3285. */
  3286. function setCacheAdd(value) {
  3287. this.__data__.set(value, HASH_UNDEFINED);
  3288. return this;
  3289. }
  3290. /**
  3291. * Checks if `value` is in the array cache.
  3292. *
  3293. * @private
  3294. * @name has
  3295. * @memberOf SetCache
  3296. * @param {*} value The value to search for.
  3297. * @returns {number} Returns `true` if `value` is found, else `false`.
  3298. */
  3299. function setCacheHas(value) {
  3300. return this.__data__.has(value);
  3301. }
  3302. // Add methods to `SetCache`.
  3303. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3304. SetCache.prototype.has = setCacheHas;
  3305. /*------------------------------------------------------------------------*/
  3306. /**
  3307. * Creates a stack cache object to store key-value pairs.
  3308. *
  3309. * @private
  3310. * @constructor
  3311. * @param {Array} [entries] The key-value pairs to cache.
  3312. */
  3313. function Stack(entries) {
  3314. var data = this.__data__ = new ListCache(entries);
  3315. this.size = data.size;
  3316. }
  3317. /**
  3318. * Removes all key-value entries from the stack.
  3319. *
  3320. * @private
  3321. * @name clear
  3322. * @memberOf Stack
  3323. */
  3324. function stackClear() {
  3325. this.__data__ = new ListCache;
  3326. this.size = 0;
  3327. }
  3328. /**
  3329. * Removes `key` and its value from the stack.
  3330. *
  3331. * @private
  3332. * @name delete
  3333. * @memberOf Stack
  3334. * @param {string} key The key of the value to remove.
  3335. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3336. */
  3337. function stackDelete(key) {
  3338. var data = this.__data__,
  3339. result = data['delete'](key);
  3340. this.size = data.size;
  3341. return result;
  3342. }
  3343. /**
  3344. * Gets the stack value for `key`.
  3345. *
  3346. * @private
  3347. * @name get
  3348. * @memberOf Stack
  3349. * @param {string} key The key of the value to get.
  3350. * @returns {*} Returns the entry value.
  3351. */
  3352. function stackGet(key) {
  3353. return this.__data__.get(key);
  3354. }
  3355. /**
  3356. * Checks if a stack value for `key` exists.
  3357. *
  3358. * @private
  3359. * @name has
  3360. * @memberOf Stack
  3361. * @param {string} key The key of the entry to check.
  3362. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3363. */
  3364. function stackHas(key) {
  3365. return this.__data__.has(key);
  3366. }
  3367. /**
  3368. * Sets the stack `key` to `value`.
  3369. *
  3370. * @private
  3371. * @name set
  3372. * @memberOf Stack
  3373. * @param {string} key The key of the value to set.
  3374. * @param {*} value The value to set.
  3375. * @returns {Object} Returns the stack cache instance.
  3376. */
  3377. function stackSet(key, value) {
  3378. var data = this.__data__;
  3379. if (data instanceof ListCache) {
  3380. var pairs = data.__data__;
  3381. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3382. pairs.push([key, value]);
  3383. this.size = ++data.size;
  3384. return this;
  3385. }
  3386. data = this.__data__ = new MapCache(pairs);
  3387. }
  3388. data.set(key, value);
  3389. this.size = data.size;
  3390. return this;
  3391. }
  3392. // Add methods to `Stack`.
  3393. Stack.prototype.clear = stackClear;
  3394. Stack.prototype['delete'] = stackDelete;
  3395. Stack.prototype.get = stackGet;
  3396. Stack.prototype.has = stackHas;
  3397. Stack.prototype.set = stackSet;
  3398. /*------------------------------------------------------------------------*/
  3399. /**
  3400. * Creates an array of the enumerable property names of the array-like `value`.
  3401. *
  3402. * @private
  3403. * @param {*} value The value to query.
  3404. * @param {boolean} inherited Specify returning inherited property names.
  3405. * @returns {Array} Returns the array of property names.
  3406. */
  3407. function arrayLikeKeys(value, inherited) {
  3408. var isArr = isArray(value),
  3409. isArg = !isArr && isArguments(value),
  3410. isBuff = !isArr && !isArg && isBuffer(value),
  3411. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3412. skipIndexes = isArr || isArg || isBuff || isType,
  3413. result = skipIndexes ? baseTimes(value.length, String) : [],
  3414. length = result.length;
  3415. for (var key in value) {
  3416. if ((inherited || hasOwnProperty.call(value, key)) &&
  3417. !(skipIndexes && (
  3418. // Safari 9 has enumerable `arguments.length` in strict mode.
  3419. key == 'length' ||
  3420. // Node.js 0.10 has enumerable non-index properties on buffers.
  3421. (isBuff && (key == 'offset' || key == 'parent')) ||
  3422. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3423. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3424. // Skip index properties.
  3425. isIndex(key, length)
  3426. ))) {
  3427. result.push(key);
  3428. }
  3429. }
  3430. return result;
  3431. }
  3432. /**
  3433. * A specialized version of `_.sample` for arrays.
  3434. *
  3435. * @private
  3436. * @param {Array} array The array to sample.
  3437. * @returns {*} Returns the random element.
  3438. */
  3439. function arraySample(array) {
  3440. var length = array.length;
  3441. return length ? array[baseRandom(0, length - 1)] : undefined;
  3442. }
  3443. /**
  3444. * A specialized version of `_.sampleSize` for arrays.
  3445. *
  3446. * @private
  3447. * @param {Array} array The array to sample.
  3448. * @param {number} n The number of elements to sample.
  3449. * @returns {Array} Returns the random elements.
  3450. */
  3451. function arraySampleSize(array, n) {
  3452. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3453. }
  3454. /**
  3455. * A specialized version of `_.shuffle` for arrays.
  3456. *
  3457. * @private
  3458. * @param {Array} array The array to shuffle.
  3459. * @returns {Array} Returns the new shuffled array.
  3460. */
  3461. function arrayShuffle(array) {
  3462. return shuffleSelf(copyArray(array));
  3463. }
  3464. /**
  3465. * This function is like `assignValue` except that it doesn't assign
  3466. * `undefined` values.
  3467. *
  3468. * @private
  3469. * @param {Object} object The object to modify.
  3470. * @param {string} key The key of the property to assign.
  3471. * @param {*} value The value to assign.
  3472. */
  3473. function assignMergeValue(object, key, value) {
  3474. if ((value !== undefined && !eq(object[key], value)) ||
  3475. (value === undefined && !(key in object))) {
  3476. baseAssignValue(object, key, value);
  3477. }
  3478. }
  3479. /**
  3480. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3481. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3482. * for equality comparisons.
  3483. *
  3484. * @private
  3485. * @param {Object} object The object to modify.
  3486. * @param {string} key The key of the property to assign.
  3487. * @param {*} value The value to assign.
  3488. */
  3489. function assignValue(object, key, value) {
  3490. var objValue = object[key];
  3491. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3492. (value === undefined && !(key in object))) {
  3493. baseAssignValue(object, key, value);
  3494. }
  3495. }
  3496. /**
  3497. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3498. *
  3499. * @private
  3500. * @param {Array} array The array to inspect.
  3501. * @param {*} key The key to search for.
  3502. * @returns {number} Returns the index of the matched value, else `-1`.
  3503. */
  3504. function assocIndexOf(array, key) {
  3505. var length = array.length;
  3506. while (length--) {
  3507. if (eq(array[length][0], key)) {
  3508. return length;
  3509. }
  3510. }
  3511. return -1;
  3512. }
  3513. /**
  3514. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3515. * by `iteratee` and values set by `setter`.
  3516. *
  3517. * @private
  3518. * @param {Array|Object} collection The collection to iterate over.
  3519. * @param {Function} setter The function to set `accumulator` values.
  3520. * @param {Function} iteratee The iteratee to transform keys.
  3521. * @param {Object} accumulator The initial aggregated object.
  3522. * @returns {Function} Returns `accumulator`.
  3523. */
  3524. function baseAggregator(collection, setter, iteratee, accumulator) {
  3525. baseEach(collection, function(value, key, collection) {
  3526. setter(accumulator, value, iteratee(value), collection);
  3527. });
  3528. return accumulator;
  3529. }
  3530. /**
  3531. * The base implementation of `_.assign` without support for multiple sources
  3532. * or `customizer` functions.
  3533. *
  3534. * @private
  3535. * @param {Object} object The destination object.
  3536. * @param {Object} source The source object.
  3537. * @returns {Object} Returns `object`.
  3538. */
  3539. function baseAssign(object, source) {
  3540. return object && copyObject(source, keys(source), object);
  3541. }
  3542. /**
  3543. * The base implementation of `_.assignIn` without support for multiple sources
  3544. * or `customizer` functions.
  3545. *
  3546. * @private
  3547. * @param {Object} object The destination object.
  3548. * @param {Object} source The source object.
  3549. * @returns {Object} Returns `object`.
  3550. */
  3551. function baseAssignIn(object, source) {
  3552. return object && copyObject(source, keysIn(source), object);
  3553. }
  3554. /**
  3555. * The base implementation of `assignValue` and `assignMergeValue` without
  3556. * value checks.
  3557. *
  3558. * @private
  3559. * @param {Object} object The object to modify.
  3560. * @param {string} key The key of the property to assign.
  3561. * @param {*} value The value to assign.
  3562. */
  3563. function baseAssignValue(object, key, value) {
  3564. if (key == '__proto__' && defineProperty) {
  3565. defineProperty(object, key, {
  3566. 'configurable': true,
  3567. 'enumerable': true,
  3568. 'value': value,
  3569. 'writable': true
  3570. });
  3571. } else {
  3572. object[key] = value;
  3573. }
  3574. }
  3575. /**
  3576. * The base implementation of `_.at` without support for individual paths.
  3577. *
  3578. * @private
  3579. * @param {Object} object The object to iterate over.
  3580. * @param {string[]} paths The property paths to pick.
  3581. * @returns {Array} Returns the picked elements.
  3582. */
  3583. function baseAt(object, paths) {
  3584. var index = -1,
  3585. length = paths.length,
  3586. result = Array(length),
  3587. skip = object == null;
  3588. while (++index < length) {
  3589. result[index] = skip ? undefined : get(object, paths[index]);
  3590. }
  3591. return result;
  3592. }
  3593. /**
  3594. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3595. *
  3596. * @private
  3597. * @param {number} number The number to clamp.
  3598. * @param {number} [lower] The lower bound.
  3599. * @param {number} upper The upper bound.
  3600. * @returns {number} Returns the clamped number.
  3601. */
  3602. function baseClamp(number, lower, upper) {
  3603. if (number === number) {
  3604. if (upper !== undefined) {
  3605. number = number <= upper ? number : upper;
  3606. }
  3607. if (lower !== undefined) {
  3608. number = number >= lower ? number : lower;
  3609. }
  3610. }
  3611. return number;
  3612. }
  3613. /**
  3614. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3615. * traversed objects.
  3616. *
  3617. * @private
  3618. * @param {*} value The value to clone.
  3619. * @param {boolean} bitmask The bitmask flags.
  3620. * 1 - Deep clone
  3621. * 2 - Flatten inherited properties
  3622. * 4 - Clone symbols
  3623. * @param {Function} [customizer] The function to customize cloning.
  3624. * @param {string} [key] The key of `value`.
  3625. * @param {Object} [object] The parent object of `value`.
  3626. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3627. * @returns {*} Returns the cloned value.
  3628. */
  3629. function baseClone(value, bitmask, customizer, key, object, stack) {
  3630. var result,
  3631. isDeep = bitmask & CLONE_DEEP_FLAG,
  3632. isFlat = bitmask & CLONE_FLAT_FLAG,
  3633. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3634. if (customizer) {
  3635. result = object ? customizer(value, key, object, stack) : customizer(value);
  3636. }
  3637. if (result !== undefined) {
  3638. return result;
  3639. }
  3640. if (!isObject(value)) {
  3641. return value;
  3642. }
  3643. var isArr = isArray(value);
  3644. if (isArr) {
  3645. result = initCloneArray(value);
  3646. if (!isDeep) {
  3647. return copyArray(value, result);
  3648. }
  3649. } else {
  3650. var tag = getTag(value),
  3651. isFunc = tag == funcTag || tag == genTag;
  3652. if (isBuffer(value)) {
  3653. return cloneBuffer(value, isDeep);
  3654. }
  3655. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3656. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3657. if (!isDeep) {
  3658. return isFlat
  3659. ? copySymbolsIn(value, baseAssignIn(result, value))
  3660. : copySymbols(value, baseAssign(result, value));
  3661. }
  3662. } else {
  3663. if (!cloneableTags[tag]) {
  3664. return object ? value : {};
  3665. }
  3666. result = initCloneByTag(value, tag, isDeep);
  3667. }
  3668. }
  3669. // Check for circular references and return its corresponding clone.
  3670. stack || (stack = new Stack);
  3671. var stacked = stack.get(value);
  3672. if (stacked) {
  3673. return stacked;
  3674. }
  3675. stack.set(value, result);
  3676. if (isSet(value)) {
  3677. value.forEach(function(subValue) {
  3678. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3679. });
  3680. } else if (isMap(value)) {
  3681. value.forEach(function(subValue, key) {
  3682. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3683. });
  3684. }
  3685. var keysFunc = isFull
  3686. ? (isFlat ? getAllKeysIn : getAllKeys)
  3687. : (isFlat ? keysIn : keys);
  3688. var props = isArr ? undefined : keysFunc(value);
  3689. arrayEach(props || value, function(subValue, key) {
  3690. if (props) {
  3691. key = subValue;
  3692. subValue = value[key];
  3693. }
  3694. // Recursively populate clone (susceptible to call stack limits).
  3695. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3696. });
  3697. return result;
  3698. }
  3699. /**
  3700. * The base implementation of `_.conforms` which doesn't clone `source`.
  3701. *
  3702. * @private
  3703. * @param {Object} source The object of property predicates to conform to.
  3704. * @returns {Function} Returns the new spec function.
  3705. */
  3706. function baseConforms(source) {
  3707. var props = keys(source);
  3708. return function(object) {
  3709. return baseConformsTo(object, source, props);
  3710. };
  3711. }
  3712. /**
  3713. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3714. *
  3715. * @private
  3716. * @param {Object} object The object to inspect.
  3717. * @param {Object} source The object of property predicates to conform to.
  3718. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3719. */
  3720. function baseConformsTo(object, source, props) {
  3721. var length = props.length;
  3722. if (object == null) {
  3723. return !length;
  3724. }
  3725. object = Object(object);
  3726. while (length--) {
  3727. var key = props[length],
  3728. predicate = source[key],
  3729. value = object[key];
  3730. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3731. return false;
  3732. }
  3733. }
  3734. return true;
  3735. }
  3736. /**
  3737. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3738. * to provide to `func`.
  3739. *
  3740. * @private
  3741. * @param {Function} func The function to delay.
  3742. * @param {number} wait The number of milliseconds to delay invocation.
  3743. * @param {Array} args The arguments to provide to `func`.
  3744. * @returns {number|Object} Returns the timer id or timeout object.
  3745. */
  3746. function baseDelay(func, wait, args) {
  3747. if (typeof func != 'function') {
  3748. throw new TypeError(FUNC_ERROR_TEXT);
  3749. }
  3750. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3751. }
  3752. /**
  3753. * The base implementation of methods like `_.difference` without support
  3754. * for excluding multiple arrays or iteratee shorthands.
  3755. *
  3756. * @private
  3757. * @param {Array} array The array to inspect.
  3758. * @param {Array} values The values to exclude.
  3759. * @param {Function} [iteratee] The iteratee invoked per element.
  3760. * @param {Function} [comparator] The comparator invoked per element.
  3761. * @returns {Array} Returns the new array of filtered values.
  3762. */
  3763. function baseDifference(array, values, iteratee, comparator) {
  3764. var index = -1,
  3765. includes = arrayIncludes,
  3766. isCommon = true,
  3767. length = array.length,
  3768. result = [],
  3769. valuesLength = values.length;
  3770. if (!length) {
  3771. return result;
  3772. }
  3773. if (iteratee) {
  3774. values = arrayMap(values, baseUnary(iteratee));
  3775. }
  3776. if (comparator) {
  3777. includes = arrayIncludesWith;
  3778. isCommon = false;
  3779. }
  3780. else if (values.length >= LARGE_ARRAY_SIZE) {
  3781. includes = cacheHas;
  3782. isCommon = false;
  3783. values = new SetCache(values);
  3784. }
  3785. outer:
  3786. while (++index < length) {
  3787. var value = array[index],
  3788. computed = iteratee == null ? value : iteratee(value);
  3789. value = (comparator || value !== 0) ? value : 0;
  3790. if (isCommon && computed === computed) {
  3791. var valuesIndex = valuesLength;
  3792. while (valuesIndex--) {
  3793. if (values[valuesIndex] === computed) {
  3794. continue outer;
  3795. }
  3796. }
  3797. result.push(value);
  3798. }
  3799. else if (!includes(values, computed, comparator)) {
  3800. result.push(value);
  3801. }
  3802. }
  3803. return result;
  3804. }
  3805. /**
  3806. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3807. *
  3808. * @private
  3809. * @param {Array|Object} collection The collection to iterate over.
  3810. * @param {Function} iteratee The function invoked per iteration.
  3811. * @returns {Array|Object} Returns `collection`.
  3812. */
  3813. var baseEach = createBaseEach(baseForOwn);
  3814. /**
  3815. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3816. *
  3817. * @private
  3818. * @param {Array|Object} collection The collection to iterate over.
  3819. * @param {Function} iteratee The function invoked per iteration.
  3820. * @returns {Array|Object} Returns `collection`.
  3821. */
  3822. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3823. /**
  3824. * The base implementation of `_.every` without support for iteratee shorthands.
  3825. *
  3826. * @private
  3827. * @param {Array|Object} collection The collection to iterate over.
  3828. * @param {Function} predicate The function invoked per iteration.
  3829. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3830. * else `false`
  3831. */
  3832. function baseEvery(collection, predicate) {
  3833. var result = true;
  3834. baseEach(collection, function(value, index, collection) {
  3835. result = !!predicate(value, index, collection);
  3836. return result;
  3837. });
  3838. return result;
  3839. }
  3840. /**
  3841. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3842. * `comparator` to determine the extremum value.
  3843. *
  3844. * @private
  3845. * @param {Array} array The array to iterate over.
  3846. * @param {Function} iteratee The iteratee invoked per iteration.
  3847. * @param {Function} comparator The comparator used to compare values.
  3848. * @returns {*} Returns the extremum value.
  3849. */
  3850. function baseExtremum(array, iteratee, comparator) {
  3851. var index = -1,
  3852. length = array.length;
  3853. while (++index < length) {
  3854. var value = array[index],
  3855. current = iteratee(value);
  3856. if (current != null && (computed === undefined
  3857. ? (current === current && !isSymbol(current))
  3858. : comparator(current, computed)
  3859. )) {
  3860. var computed = current,
  3861. result = value;
  3862. }
  3863. }
  3864. return result;
  3865. }
  3866. /**
  3867. * The base implementation of `_.fill` without an iteratee call guard.
  3868. *
  3869. * @private
  3870. * @param {Array} array The array to fill.
  3871. * @param {*} value The value to fill `array` with.
  3872. * @param {number} [start=0] The start position.
  3873. * @param {number} [end=array.length] The end position.
  3874. * @returns {Array} Returns `array`.
  3875. */
  3876. function baseFill(array, value, start, end) {
  3877. var length = array.length;
  3878. start = toInteger(start);
  3879. if (start < 0) {
  3880. start = -start > length ? 0 : (length + start);
  3881. }
  3882. end = (end === undefined || end > length) ? length : toInteger(end);
  3883. if (end < 0) {
  3884. end += length;
  3885. }
  3886. end = start > end ? 0 : toLength(end);
  3887. while (start < end) {
  3888. array[start++] = value;
  3889. }
  3890. return array;
  3891. }
  3892. /**
  3893. * The base implementation of `_.filter` without support for iteratee shorthands.
  3894. *
  3895. * @private
  3896. * @param {Array|Object} collection The collection to iterate over.
  3897. * @param {Function} predicate The function invoked per iteration.
  3898. * @returns {Array} Returns the new filtered array.
  3899. */
  3900. function baseFilter(collection, predicate) {
  3901. var result = [];
  3902. baseEach(collection, function(value, index, collection) {
  3903. if (predicate(value, index, collection)) {
  3904. result.push(value);
  3905. }
  3906. });
  3907. return result;
  3908. }
  3909. /**
  3910. * The base implementation of `_.flatten` with support for restricting flattening.
  3911. *
  3912. * @private
  3913. * @param {Array} array The array to flatten.
  3914. * @param {number} depth The maximum recursion depth.
  3915. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3916. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3917. * @param {Array} [result=[]] The initial result value.
  3918. * @returns {Array} Returns the new flattened array.
  3919. */
  3920. function baseFlatten(array, depth, predicate, isStrict, result) {
  3921. var index = -1,
  3922. length = array.length;
  3923. predicate || (predicate = isFlattenable);
  3924. result || (result = []);
  3925. while (++index < length) {
  3926. var value = array[index];
  3927. if (depth > 0 && predicate(value)) {
  3928. if (depth > 1) {
  3929. // Recursively flatten arrays (susceptible to call stack limits).
  3930. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3931. } else {
  3932. arrayPush(result, value);
  3933. }
  3934. } else if (!isStrict) {
  3935. result[result.length] = value;
  3936. }
  3937. }
  3938. return result;
  3939. }
  3940. /**
  3941. * The base implementation of `baseForOwn` which iterates over `object`
  3942. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3943. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3944. *
  3945. * @private
  3946. * @param {Object} object The object to iterate over.
  3947. * @param {Function} iteratee The function invoked per iteration.
  3948. * @param {Function} keysFunc The function to get the keys of `object`.
  3949. * @returns {Object} Returns `object`.
  3950. */
  3951. var baseFor = createBaseFor();
  3952. /**
  3953. * This function is like `baseFor` except that it iterates over properties
  3954. * in the opposite order.
  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 baseForRight = createBaseFor(true);
  3963. /**
  3964. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3965. *
  3966. * @private
  3967. * @param {Object} object The object to iterate over.
  3968. * @param {Function} iteratee The function invoked per iteration.
  3969. * @returns {Object} Returns `object`.
  3970. */
  3971. function baseForOwn(object, iteratee) {
  3972. return object && baseFor(object, iteratee, keys);
  3973. }
  3974. /**
  3975. * The base implementation of `_.forOwnRight` 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 baseForOwnRight(object, iteratee) {
  3983. return object && baseForRight(object, iteratee, keys);
  3984. }
  3985. /**
  3986. * The base implementation of `_.functions` which creates an array of
  3987. * `object` function property names filtered from `props`.
  3988. *
  3989. * @private
  3990. * @param {Object} object The object to inspect.
  3991. * @param {Array} props The property names to filter.
  3992. * @returns {Array} Returns the function names.
  3993. */
  3994. function baseFunctions(object, props) {
  3995. return arrayFilter(props, function(key) {
  3996. return isFunction(object[key]);
  3997. });
  3998. }
  3999. /**
  4000. * The base implementation of `_.get` without support for default values.
  4001. *
  4002. * @private
  4003. * @param {Object} object The object to query.
  4004. * @param {Array|string} path The path of the property to get.
  4005. * @returns {*} Returns the resolved value.
  4006. */
  4007. function baseGet(object, path) {
  4008. path = castPath(path, object);
  4009. var index = 0,
  4010. length = path.length;
  4011. while (object != null && index < length) {
  4012. object = object[toKey(path[index++])];
  4013. }
  4014. return (index && index == length) ? object : undefined;
  4015. }
  4016. /**
  4017. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4018. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4019. * symbols of `object`.
  4020. *
  4021. * @private
  4022. * @param {Object} object The object to query.
  4023. * @param {Function} keysFunc The function to get the keys of `object`.
  4024. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4025. * @returns {Array} Returns the array of property names and symbols.
  4026. */
  4027. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4028. var result = keysFunc(object);
  4029. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4030. }
  4031. /**
  4032. * The base implementation of `getTag` without fallbacks for buggy environments.
  4033. *
  4034. * @private
  4035. * @param {*} value The value to query.
  4036. * @returns {string} Returns the `toStringTag`.
  4037. */
  4038. function baseGetTag(value) {
  4039. if (value == null) {
  4040. return value === undefined ? undefinedTag : nullTag;
  4041. }
  4042. return (symToStringTag && symToStringTag in Object(value))
  4043. ? getRawTag(value)
  4044. : objectToString(value);
  4045. }
  4046. /**
  4047. * The base implementation of `_.gt` which doesn't coerce arguments.
  4048. *
  4049. * @private
  4050. * @param {*} value The value to compare.
  4051. * @param {*} other The other value to compare.
  4052. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4053. * else `false`.
  4054. */
  4055. function baseGt(value, other) {
  4056. return value > other;
  4057. }
  4058. /**
  4059. * The base implementation of `_.has` without support for deep paths.
  4060. *
  4061. * @private
  4062. * @param {Object} [object] The object to query.
  4063. * @param {Array|string} key The key to check.
  4064. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4065. */
  4066. function baseHas(object, key) {
  4067. return object != null && hasOwnProperty.call(object, key);
  4068. }
  4069. /**
  4070. * The base implementation of `_.hasIn` 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 baseHasIn(object, key) {
  4078. return object != null && key in Object(object);
  4079. }
  4080. /**
  4081. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4082. *
  4083. * @private
  4084. * @param {number} number The number to check.
  4085. * @param {number} start The start of the range.
  4086. * @param {number} end The end of the range.
  4087. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4088. */
  4089. function baseInRange(number, start, end) {
  4090. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4091. }
  4092. /**
  4093. * The base implementation of methods like `_.intersection`, without support
  4094. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4095. *
  4096. * @private
  4097. * @param {Array} arrays The arrays to inspect.
  4098. * @param {Function} [iteratee] The iteratee invoked per element.
  4099. * @param {Function} [comparator] The comparator invoked per element.
  4100. * @returns {Array} Returns the new array of shared values.
  4101. */
  4102. function baseIntersection(arrays, iteratee, comparator) {
  4103. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4104. length = arrays[0].length,
  4105. othLength = arrays.length,
  4106. othIndex = othLength,
  4107. caches = Array(othLength),
  4108. maxLength = Infinity,
  4109. result = [];
  4110. while (othIndex--) {
  4111. var array = arrays[othIndex];
  4112. if (othIndex && iteratee) {
  4113. array = arrayMap(array, baseUnary(iteratee));
  4114. }
  4115. maxLength = nativeMin(array.length, maxLength);
  4116. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4117. ? new SetCache(othIndex && array)
  4118. : undefined;
  4119. }
  4120. array = arrays[0];
  4121. var index = -1,
  4122. seen = caches[0];
  4123. outer:
  4124. while (++index < length && result.length < maxLength) {
  4125. var value = array[index],
  4126. computed = iteratee ? iteratee(value) : value;
  4127. value = (comparator || value !== 0) ? value : 0;
  4128. if (!(seen
  4129. ? cacheHas(seen, computed)
  4130. : includes(result, computed, comparator)
  4131. )) {
  4132. othIndex = othLength;
  4133. while (--othIndex) {
  4134. var cache = caches[othIndex];
  4135. if (!(cache
  4136. ? cacheHas(cache, computed)
  4137. : includes(arrays[othIndex], computed, comparator))
  4138. ) {
  4139. continue outer;
  4140. }
  4141. }
  4142. if (seen) {
  4143. seen.push(computed);
  4144. }
  4145. result.push(value);
  4146. }
  4147. }
  4148. return result;
  4149. }
  4150. /**
  4151. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4152. * `object` with values transformed by `iteratee` and set by `setter`.
  4153. *
  4154. * @private
  4155. * @param {Object} object The object to iterate over.
  4156. * @param {Function} setter The function to set `accumulator` values.
  4157. * @param {Function} iteratee The iteratee to transform values.
  4158. * @param {Object} accumulator The initial inverted object.
  4159. * @returns {Function} Returns `accumulator`.
  4160. */
  4161. function baseInverter(object, setter, iteratee, accumulator) {
  4162. baseForOwn(object, function(value, key, object) {
  4163. setter(accumulator, iteratee(value), key, object);
  4164. });
  4165. return accumulator;
  4166. }
  4167. /**
  4168. * The base implementation of `_.invoke` without support for individual
  4169. * method arguments.
  4170. *
  4171. * @private
  4172. * @param {Object} object The object to query.
  4173. * @param {Array|string} path The path of the method to invoke.
  4174. * @param {Array} args The arguments to invoke the method with.
  4175. * @returns {*} Returns the result of the invoked method.
  4176. */
  4177. function baseInvoke(object, path, args) {
  4178. path = castPath(path, object);
  4179. object = parent(object, path);
  4180. var func = object == null ? object : object[toKey(last(path))];
  4181. return func == null ? undefined : apply(func, object, args);
  4182. }
  4183. /**
  4184. * The base implementation of `_.isArguments`.
  4185. *
  4186. * @private
  4187. * @param {*} value The value to check.
  4188. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4189. */
  4190. function baseIsArguments(value) {
  4191. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4192. }
  4193. /**
  4194. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4195. *
  4196. * @private
  4197. * @param {*} value The value to check.
  4198. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4199. */
  4200. function baseIsArrayBuffer(value) {
  4201. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4202. }
  4203. /**
  4204. * The base implementation of `_.isDate` without Node.js optimizations.
  4205. *
  4206. * @private
  4207. * @param {*} value The value to check.
  4208. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4209. */
  4210. function baseIsDate(value) {
  4211. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4212. }
  4213. /**
  4214. * The base implementation of `_.isEqual` which supports partial comparisons
  4215. * and tracks traversed objects.
  4216. *
  4217. * @private
  4218. * @param {*} value The value to compare.
  4219. * @param {*} other The other value to compare.
  4220. * @param {boolean} bitmask The bitmask flags.
  4221. * 1 - Unordered comparison
  4222. * 2 - Partial comparison
  4223. * @param {Function} [customizer] The function to customize comparisons.
  4224. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4225. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4226. */
  4227. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4228. if (value === other) {
  4229. return true;
  4230. }
  4231. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4232. return value !== value && other !== other;
  4233. }
  4234. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4235. }
  4236. /**
  4237. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4238. * deep comparisons and tracks traversed objects enabling objects with circular
  4239. * references to be compared.
  4240. *
  4241. * @private
  4242. * @param {Object} object The object to compare.
  4243. * @param {Object} other The other object to compare.
  4244. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4245. * @param {Function} customizer The function to customize comparisons.
  4246. * @param {Function} equalFunc The function to determine equivalents of values.
  4247. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4248. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4249. */
  4250. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4251. var objIsArr = isArray(object),
  4252. othIsArr = isArray(other),
  4253. objTag = objIsArr ? arrayTag : getTag(object),
  4254. othTag = othIsArr ? arrayTag : getTag(other);
  4255. objTag = objTag == argsTag ? objectTag : objTag;
  4256. othTag = othTag == argsTag ? objectTag : othTag;
  4257. var objIsObj = objTag == objectTag,
  4258. othIsObj = othTag == objectTag,
  4259. isSameTag = objTag == othTag;
  4260. if (isSameTag && isBuffer(object)) {
  4261. if (!isBuffer(other)) {
  4262. return false;
  4263. }
  4264. objIsArr = true;
  4265. objIsObj = false;
  4266. }
  4267. if (isSameTag && !objIsObj) {
  4268. stack || (stack = new Stack);
  4269. return (objIsArr || isTypedArray(object))
  4270. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4271. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4272. }
  4273. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4274. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4275. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4276. if (objIsWrapped || othIsWrapped) {
  4277. var objUnwrapped = objIsWrapped ? object.value() : object,
  4278. othUnwrapped = othIsWrapped ? other.value() : other;
  4279. stack || (stack = new Stack);
  4280. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4281. }
  4282. }
  4283. if (!isSameTag) {
  4284. return false;
  4285. }
  4286. stack || (stack = new Stack);
  4287. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4288. }
  4289. /**
  4290. * The base implementation of `_.isMap` without Node.js optimizations.
  4291. *
  4292. * @private
  4293. * @param {*} value The value to check.
  4294. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4295. */
  4296. function baseIsMap(value) {
  4297. return isObjectLike(value) && getTag(value) == mapTag;
  4298. }
  4299. /**
  4300. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4301. *
  4302. * @private
  4303. * @param {Object} object The object to inspect.
  4304. * @param {Object} source The object of property values to match.
  4305. * @param {Array} matchData The property names, values, and compare flags to match.
  4306. * @param {Function} [customizer] The function to customize comparisons.
  4307. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4308. */
  4309. function baseIsMatch(object, source, matchData, customizer) {
  4310. var index = matchData.length,
  4311. length = index,
  4312. noCustomizer = !customizer;
  4313. if (object == null) {
  4314. return !length;
  4315. }
  4316. object = Object(object);
  4317. while (index--) {
  4318. var data = matchData[index];
  4319. if ((noCustomizer && data[2])
  4320. ? data[1] !== object[data[0]]
  4321. : !(data[0] in object)
  4322. ) {
  4323. return false;
  4324. }
  4325. }
  4326. while (++index < length) {
  4327. data = matchData[index];
  4328. var key = data[0],
  4329. objValue = object[key],
  4330. srcValue = data[1];
  4331. if (noCustomizer && data[2]) {
  4332. if (objValue === undefined && !(key in object)) {
  4333. return false;
  4334. }
  4335. } else {
  4336. var stack = new Stack;
  4337. if (customizer) {
  4338. var result = customizer(objValue, srcValue, key, object, source, stack);
  4339. }
  4340. if (!(result === undefined
  4341. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4342. : result
  4343. )) {
  4344. return false;
  4345. }
  4346. }
  4347. }
  4348. return true;
  4349. }
  4350. /**
  4351. * The base implementation of `_.isNative` without bad shim checks.
  4352. *
  4353. * @private
  4354. * @param {*} value The value to check.
  4355. * @returns {boolean} Returns `true` if `value` is a native function,
  4356. * else `false`.
  4357. */
  4358. function baseIsNative(value) {
  4359. if (!isObject(value) || isMasked(value)) {
  4360. return false;
  4361. }
  4362. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4363. return pattern.test(toSource(value));
  4364. }
  4365. /**
  4366. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4367. *
  4368. * @private
  4369. * @param {*} value The value to check.
  4370. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4371. */
  4372. function baseIsRegExp(value) {
  4373. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4374. }
  4375. /**
  4376. * The base implementation of `_.isSet` without Node.js optimizations.
  4377. *
  4378. * @private
  4379. * @param {*} value The value to check.
  4380. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4381. */
  4382. function baseIsSet(value) {
  4383. return isObjectLike(value) && getTag(value) == setTag;
  4384. }
  4385. /**
  4386. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4387. *
  4388. * @private
  4389. * @param {*} value The value to check.
  4390. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4391. */
  4392. function baseIsTypedArray(value) {
  4393. return isObjectLike(value) &&
  4394. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4395. }
  4396. /**
  4397. * The base implementation of `_.iteratee`.
  4398. *
  4399. * @private
  4400. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4401. * @returns {Function} Returns the iteratee.
  4402. */
  4403. function baseIteratee(value) {
  4404. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4405. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4406. if (typeof value == 'function') {
  4407. return value;
  4408. }
  4409. if (value == null) {
  4410. return identity;
  4411. }
  4412. if (typeof value == 'object') {
  4413. return isArray(value)
  4414. ? baseMatchesProperty(value[0], value[1])
  4415. : baseMatches(value);
  4416. }
  4417. return property(value);
  4418. }
  4419. /**
  4420. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4421. *
  4422. * @private
  4423. * @param {Object} object The object to query.
  4424. * @returns {Array} Returns the array of property names.
  4425. */
  4426. function baseKeys(object) {
  4427. if (!isPrototype(object)) {
  4428. return nativeKeys(object);
  4429. }
  4430. var result = [];
  4431. for (var key in Object(object)) {
  4432. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4433. result.push(key);
  4434. }
  4435. }
  4436. return result;
  4437. }
  4438. /**
  4439. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4440. *
  4441. * @private
  4442. * @param {Object} object The object to query.
  4443. * @returns {Array} Returns the array of property names.
  4444. */
  4445. function baseKeysIn(object) {
  4446. if (!isObject(object)) {
  4447. return nativeKeysIn(object);
  4448. }
  4449. var isProto = isPrototype(object),
  4450. result = [];
  4451. for (var key in object) {
  4452. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4453. result.push(key);
  4454. }
  4455. }
  4456. return result;
  4457. }
  4458. /**
  4459. * The base implementation of `_.lt` which doesn't coerce arguments.
  4460. *
  4461. * @private
  4462. * @param {*} value The value to compare.
  4463. * @param {*} other The other value to compare.
  4464. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4465. * else `false`.
  4466. */
  4467. function baseLt(value, other) {
  4468. return value < other;
  4469. }
  4470. /**
  4471. * The base implementation of `_.map` without support for iteratee shorthands.
  4472. *
  4473. * @private
  4474. * @param {Array|Object} collection The collection to iterate over.
  4475. * @param {Function} iteratee The function invoked per iteration.
  4476. * @returns {Array} Returns the new mapped array.
  4477. */
  4478. function baseMap(collection, iteratee) {
  4479. var index = -1,
  4480. result = isArrayLike(collection) ? Array(collection.length) : [];
  4481. baseEach(collection, function(value, key, collection) {
  4482. result[++index] = iteratee(value, key, collection);
  4483. });
  4484. return result;
  4485. }
  4486. /**
  4487. * The base implementation of `_.matches` which doesn't clone `source`.
  4488. *
  4489. * @private
  4490. * @param {Object} source The object of property values to match.
  4491. * @returns {Function} Returns the new spec function.
  4492. */
  4493. function baseMatches(source) {
  4494. var matchData = getMatchData(source);
  4495. if (matchData.length == 1 && matchData[0][2]) {
  4496. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4497. }
  4498. return function(object) {
  4499. return object === source || baseIsMatch(object, source, matchData);
  4500. };
  4501. }
  4502. /**
  4503. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4504. *
  4505. * @private
  4506. * @param {string} path The path of the property to get.
  4507. * @param {*} srcValue The value to match.
  4508. * @returns {Function} Returns the new spec function.
  4509. */
  4510. function baseMatchesProperty(path, srcValue) {
  4511. if (isKey(path) && isStrictComparable(srcValue)) {
  4512. return matchesStrictComparable(toKey(path), srcValue);
  4513. }
  4514. return function(object) {
  4515. var objValue = get(object, path);
  4516. return (objValue === undefined && objValue === srcValue)
  4517. ? hasIn(object, path)
  4518. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4519. };
  4520. }
  4521. /**
  4522. * The base implementation of `_.merge` without support for multiple sources.
  4523. *
  4524. * @private
  4525. * @param {Object} object The destination object.
  4526. * @param {Object} source The source object.
  4527. * @param {number} srcIndex The index of `source`.
  4528. * @param {Function} [customizer] The function to customize merged values.
  4529. * @param {Object} [stack] Tracks traversed source values and their merged
  4530. * counterparts.
  4531. */
  4532. function baseMerge(object, source, srcIndex, customizer, stack) {
  4533. if (object === source) {
  4534. return;
  4535. }
  4536. baseFor(source, function(srcValue, key) {
  4537. stack || (stack = new Stack);
  4538. if (isObject(srcValue)) {
  4539. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4540. }
  4541. else {
  4542. var newValue = customizer
  4543. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4544. : undefined;
  4545. if (newValue === undefined) {
  4546. newValue = srcValue;
  4547. }
  4548. assignMergeValue(object, key, newValue);
  4549. }
  4550. }, keysIn);
  4551. }
  4552. /**
  4553. * A specialized version of `baseMerge` for arrays and objects which performs
  4554. * deep merges and tracks traversed objects enabling objects with circular
  4555. * references to be merged.
  4556. *
  4557. * @private
  4558. * @param {Object} object The destination object.
  4559. * @param {Object} source The source object.
  4560. * @param {string} key The key of the value to merge.
  4561. * @param {number} srcIndex The index of `source`.
  4562. * @param {Function} mergeFunc The function to merge values.
  4563. * @param {Function} [customizer] The function to customize assigned values.
  4564. * @param {Object} [stack] Tracks traversed source values and their merged
  4565. * counterparts.
  4566. */
  4567. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4568. var objValue = safeGet(object, key),
  4569. srcValue = safeGet(source, key),
  4570. stacked = stack.get(srcValue);
  4571. if (stacked) {
  4572. assignMergeValue(object, key, stacked);
  4573. return;
  4574. }
  4575. var newValue = customizer
  4576. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4577. : undefined;
  4578. var isCommon = newValue === undefined;
  4579. if (isCommon) {
  4580. var isArr = isArray(srcValue),
  4581. isBuff = !isArr && isBuffer(srcValue),
  4582. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4583. newValue = srcValue;
  4584. if (isArr || isBuff || isTyped) {
  4585. if (isArray(objValue)) {
  4586. newValue = objValue;
  4587. }
  4588. else if (isArrayLikeObject(objValue)) {
  4589. newValue = copyArray(objValue);
  4590. }
  4591. else if (isBuff) {
  4592. isCommon = false;
  4593. newValue = cloneBuffer(srcValue, true);
  4594. }
  4595. else if (isTyped) {
  4596. isCommon = false;
  4597. newValue = cloneTypedArray(srcValue, true);
  4598. }
  4599. else {
  4600. newValue = [];
  4601. }
  4602. }
  4603. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4604. newValue = objValue;
  4605. if (isArguments(objValue)) {
  4606. newValue = toPlainObject(objValue);
  4607. }
  4608. else if (!isObject(objValue) || isFunction(objValue)) {
  4609. newValue = initCloneObject(srcValue);
  4610. }
  4611. }
  4612. else {
  4613. isCommon = false;
  4614. }
  4615. }
  4616. if (isCommon) {
  4617. // Recursively merge objects and arrays (susceptible to call stack limits).
  4618. stack.set(srcValue, newValue);
  4619. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4620. stack['delete'](srcValue);
  4621. }
  4622. assignMergeValue(object, key, newValue);
  4623. }
  4624. /**
  4625. * The base implementation of `_.nth` which doesn't coerce arguments.
  4626. *
  4627. * @private
  4628. * @param {Array} array The array to query.
  4629. * @param {number} n The index of the element to return.
  4630. * @returns {*} Returns the nth element of `array`.
  4631. */
  4632. function baseNth(array, n) {
  4633. var length = array.length;
  4634. if (!length) {
  4635. return;
  4636. }
  4637. n += n < 0 ? length : 0;
  4638. return isIndex(n, length) ? array[n] : undefined;
  4639. }
  4640. /**
  4641. * The base implementation of `_.orderBy` without param guards.
  4642. *
  4643. * @private
  4644. * @param {Array|Object} collection The collection to iterate over.
  4645. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4646. * @param {string[]} orders The sort orders of `iteratees`.
  4647. * @returns {Array} Returns the new sorted array.
  4648. */
  4649. function baseOrderBy(collection, iteratees, orders) {
  4650. if (iteratees.length) {
  4651. iteratees = arrayMap(iteratees, function(iteratee) {
  4652. if (isArray(iteratee)) {
  4653. return function(value) {
  4654. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4655. }
  4656. }
  4657. return iteratee;
  4658. });
  4659. } else {
  4660. iteratees = [identity];
  4661. }
  4662. var index = -1;
  4663. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4664. var result = baseMap(collection, function(value, key, collection) {
  4665. var criteria = arrayMap(iteratees, function(iteratee) {
  4666. return iteratee(value);
  4667. });
  4668. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4669. });
  4670. return baseSortBy(result, function(object, other) {
  4671. return compareMultiple(object, other, orders);
  4672. });
  4673. }
  4674. /**
  4675. * The base implementation of `_.pick` without support for individual
  4676. * property identifiers.
  4677. *
  4678. * @private
  4679. * @param {Object} object The source object.
  4680. * @param {string[]} paths The property paths to pick.
  4681. * @returns {Object} Returns the new object.
  4682. */
  4683. function basePick(object, paths) {
  4684. return basePickBy(object, paths, function(value, path) {
  4685. return hasIn(object, path);
  4686. });
  4687. }
  4688. /**
  4689. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4690. *
  4691. * @private
  4692. * @param {Object} object The source object.
  4693. * @param {string[]} paths The property paths to pick.
  4694. * @param {Function} predicate The function invoked per property.
  4695. * @returns {Object} Returns the new object.
  4696. */
  4697. function basePickBy(object, paths, predicate) {
  4698. var index = -1,
  4699. length = paths.length,
  4700. result = {};
  4701. while (++index < length) {
  4702. var path = paths[index],
  4703. value = baseGet(object, path);
  4704. if (predicate(value, path)) {
  4705. baseSet(result, castPath(path, object), value);
  4706. }
  4707. }
  4708. return result;
  4709. }
  4710. /**
  4711. * A specialized version of `baseProperty` which supports deep paths.
  4712. *
  4713. * @private
  4714. * @param {Array|string} path The path of the property to get.
  4715. * @returns {Function} Returns the new accessor function.
  4716. */
  4717. function basePropertyDeep(path) {
  4718. return function(object) {
  4719. return baseGet(object, path);
  4720. };
  4721. }
  4722. /**
  4723. * The base implementation of `_.pullAllBy` without support for iteratee
  4724. * shorthands.
  4725. *
  4726. * @private
  4727. * @param {Array} array The array to modify.
  4728. * @param {Array} values The values to remove.
  4729. * @param {Function} [iteratee] The iteratee invoked per element.
  4730. * @param {Function} [comparator] The comparator invoked per element.
  4731. * @returns {Array} Returns `array`.
  4732. */
  4733. function basePullAll(array, values, iteratee, comparator) {
  4734. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4735. index = -1,
  4736. length = values.length,
  4737. seen = array;
  4738. if (array === values) {
  4739. values = copyArray(values);
  4740. }
  4741. if (iteratee) {
  4742. seen = arrayMap(array, baseUnary(iteratee));
  4743. }
  4744. while (++index < length) {
  4745. var fromIndex = 0,
  4746. value = values[index],
  4747. computed = iteratee ? iteratee(value) : value;
  4748. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4749. if (seen !== array) {
  4750. splice.call(seen, fromIndex, 1);
  4751. }
  4752. splice.call(array, fromIndex, 1);
  4753. }
  4754. }
  4755. return array;
  4756. }
  4757. /**
  4758. * The base implementation of `_.pullAt` without support for individual
  4759. * indexes or capturing the removed elements.
  4760. *
  4761. * @private
  4762. * @param {Array} array The array to modify.
  4763. * @param {number[]} indexes The indexes of elements to remove.
  4764. * @returns {Array} Returns `array`.
  4765. */
  4766. function basePullAt(array, indexes) {
  4767. var length = array ? indexes.length : 0,
  4768. lastIndex = length - 1;
  4769. while (length--) {
  4770. var index = indexes[length];
  4771. if (length == lastIndex || index !== previous) {
  4772. var previous = index;
  4773. if (isIndex(index)) {
  4774. splice.call(array, index, 1);
  4775. } else {
  4776. baseUnset(array, index);
  4777. }
  4778. }
  4779. }
  4780. return array;
  4781. }
  4782. /**
  4783. * The base implementation of `_.random` without support for returning
  4784. * floating-point numbers.
  4785. *
  4786. * @private
  4787. * @param {number} lower The lower bound.
  4788. * @param {number} upper The upper bound.
  4789. * @returns {number} Returns the random number.
  4790. */
  4791. function baseRandom(lower, upper) {
  4792. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4793. }
  4794. /**
  4795. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4796. * coerce arguments.
  4797. *
  4798. * @private
  4799. * @param {number} start The start of the range.
  4800. * @param {number} end The end of the range.
  4801. * @param {number} step The value to increment or decrement by.
  4802. * @param {boolean} [fromRight] Specify iterating from right to left.
  4803. * @returns {Array} Returns the range of numbers.
  4804. */
  4805. function baseRange(start, end, step, fromRight) {
  4806. var index = -1,
  4807. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4808. result = Array(length);
  4809. while (length--) {
  4810. result[fromRight ? length : ++index] = start;
  4811. start += step;
  4812. }
  4813. return result;
  4814. }
  4815. /**
  4816. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4817. *
  4818. * @private
  4819. * @param {string} string The string to repeat.
  4820. * @param {number} n The number of times to repeat the string.
  4821. * @returns {string} Returns the repeated string.
  4822. */
  4823. function baseRepeat(string, n) {
  4824. var result = '';
  4825. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4826. return result;
  4827. }
  4828. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4829. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4830. do {
  4831. if (n % 2) {
  4832. result += string;
  4833. }
  4834. n = nativeFloor(n / 2);
  4835. if (n) {
  4836. string += string;
  4837. }
  4838. } while (n);
  4839. return result;
  4840. }
  4841. /**
  4842. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4843. *
  4844. * @private
  4845. * @param {Function} func The function to apply a rest parameter to.
  4846. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4847. * @returns {Function} Returns the new function.
  4848. */
  4849. function baseRest(func, start) {
  4850. return setToString(overRest(func, start, identity), func + '');
  4851. }
  4852. /**
  4853. * The base implementation of `_.sample`.
  4854. *
  4855. * @private
  4856. * @param {Array|Object} collection The collection to sample.
  4857. * @returns {*} Returns the random element.
  4858. */
  4859. function baseSample(collection) {
  4860. return arraySample(values(collection));
  4861. }
  4862. /**
  4863. * The base implementation of `_.sampleSize` without param guards.
  4864. *
  4865. * @private
  4866. * @param {Array|Object} collection The collection to sample.
  4867. * @param {number} n The number of elements to sample.
  4868. * @returns {Array} Returns the random elements.
  4869. */
  4870. function baseSampleSize(collection, n) {
  4871. var array = values(collection);
  4872. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4873. }
  4874. /**
  4875. * The base implementation of `_.set`.
  4876. *
  4877. * @private
  4878. * @param {Object} object The object to modify.
  4879. * @param {Array|string} path The path of the property to set.
  4880. * @param {*} value The value to set.
  4881. * @param {Function} [customizer] The function to customize path creation.
  4882. * @returns {Object} Returns `object`.
  4883. */
  4884. function baseSet(object, path, value, customizer) {
  4885. if (!isObject(object)) {
  4886. return object;
  4887. }
  4888. path = castPath(path, object);
  4889. var index = -1,
  4890. length = path.length,
  4891. lastIndex = length - 1,
  4892. nested = object;
  4893. while (nested != null && ++index < length) {
  4894. var key = toKey(path[index]),
  4895. newValue = value;
  4896. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4897. return object;
  4898. }
  4899. if (index != lastIndex) {
  4900. var objValue = nested[key];
  4901. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4902. if (newValue === undefined) {
  4903. newValue = isObject(objValue)
  4904. ? objValue
  4905. : (isIndex(path[index + 1]) ? [] : {});
  4906. }
  4907. }
  4908. assignValue(nested, key, newValue);
  4909. nested = nested[key];
  4910. }
  4911. return object;
  4912. }
  4913. /**
  4914. * The base implementation of `setData` without support for hot loop shorting.
  4915. *
  4916. * @private
  4917. * @param {Function} func The function to associate metadata with.
  4918. * @param {*} data The metadata.
  4919. * @returns {Function} Returns `func`.
  4920. */
  4921. var baseSetData = !metaMap ? identity : function(func, data) {
  4922. metaMap.set(func, data);
  4923. return func;
  4924. };
  4925. /**
  4926. * The base implementation of `setToString` without support for hot loop shorting.
  4927. *
  4928. * @private
  4929. * @param {Function} func The function to modify.
  4930. * @param {Function} string The `toString` result.
  4931. * @returns {Function} Returns `func`.
  4932. */
  4933. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4934. return defineProperty(func, 'toString', {
  4935. 'configurable': true,
  4936. 'enumerable': false,
  4937. 'value': constant(string),
  4938. 'writable': true
  4939. });
  4940. };
  4941. /**
  4942. * The base implementation of `_.shuffle`.
  4943. *
  4944. * @private
  4945. * @param {Array|Object} collection The collection to shuffle.
  4946. * @returns {Array} Returns the new shuffled array.
  4947. */
  4948. function baseShuffle(collection) {
  4949. return shuffleSelf(values(collection));
  4950. }
  4951. /**
  4952. * The base implementation of `_.slice` without an iteratee call guard.
  4953. *
  4954. * @private
  4955. * @param {Array} array The array to slice.
  4956. * @param {number} [start=0] The start position.
  4957. * @param {number} [end=array.length] The end position.
  4958. * @returns {Array} Returns the slice of `array`.
  4959. */
  4960. function baseSlice(array, start, end) {
  4961. var index = -1,
  4962. length = array.length;
  4963. if (start < 0) {
  4964. start = -start > length ? 0 : (length + start);
  4965. }
  4966. end = end > length ? length : end;
  4967. if (end < 0) {
  4968. end += length;
  4969. }
  4970. length = start > end ? 0 : ((end - start) >>> 0);
  4971. start >>>= 0;
  4972. var result = Array(length);
  4973. while (++index < length) {
  4974. result[index] = array[index + start];
  4975. }
  4976. return result;
  4977. }
  4978. /**
  4979. * The base implementation of `_.some` without support for iteratee shorthands.
  4980. *
  4981. * @private
  4982. * @param {Array|Object} collection The collection to iterate over.
  4983. * @param {Function} predicate The function invoked per iteration.
  4984. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4985. * else `false`.
  4986. */
  4987. function baseSome(collection, predicate) {
  4988. var result;
  4989. baseEach(collection, function(value, index, collection) {
  4990. result = predicate(value, index, collection);
  4991. return !result;
  4992. });
  4993. return !!result;
  4994. }
  4995. /**
  4996. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4997. * performs a binary search of `array` to determine the index at which `value`
  4998. * should be inserted into `array` in order to maintain its sort order.
  4999. *
  5000. * @private
  5001. * @param {Array} array The sorted array to inspect.
  5002. * @param {*} value The value to evaluate.
  5003. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5004. * @returns {number} Returns the index at which `value` should be inserted
  5005. * into `array`.
  5006. */
  5007. function baseSortedIndex(array, value, retHighest) {
  5008. var low = 0,
  5009. high = array == null ? low : array.length;
  5010. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5011. while (low < high) {
  5012. var mid = (low + high) >>> 1,
  5013. computed = array[mid];
  5014. if (computed !== null && !isSymbol(computed) &&
  5015. (retHighest ? (computed <= value) : (computed < value))) {
  5016. low = mid + 1;
  5017. } else {
  5018. high = mid;
  5019. }
  5020. }
  5021. return high;
  5022. }
  5023. return baseSortedIndexBy(array, value, identity, retHighest);
  5024. }
  5025. /**
  5026. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5027. * which invokes `iteratee` for `value` and each element of `array` to compute
  5028. * their sort ranking. The iteratee is invoked with one argument; (value).
  5029. *
  5030. * @private
  5031. * @param {Array} array The sorted array to inspect.
  5032. * @param {*} value The value to evaluate.
  5033. * @param {Function} iteratee The iteratee invoked per element.
  5034. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5035. * @returns {number} Returns the index at which `value` should be inserted
  5036. * into `array`.
  5037. */
  5038. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5039. var low = 0,
  5040. high = array == null ? 0 : array.length;
  5041. if (high === 0) {
  5042. return 0;
  5043. }
  5044. value = iteratee(value);
  5045. var valIsNaN = value !== value,
  5046. valIsNull = value === null,
  5047. valIsSymbol = isSymbol(value),
  5048. valIsUndefined = value === undefined;
  5049. while (low < high) {
  5050. var mid = nativeFloor((low + high) / 2),
  5051. computed = iteratee(array[mid]),
  5052. othIsDefined = computed !== undefined,
  5053. othIsNull = computed === null,
  5054. othIsReflexive = computed === computed,
  5055. othIsSymbol = isSymbol(computed);
  5056. if (valIsNaN) {
  5057. var setLow = retHighest || othIsReflexive;
  5058. } else if (valIsUndefined) {
  5059. setLow = othIsReflexive && (retHighest || othIsDefined);
  5060. } else if (valIsNull) {
  5061. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5062. } else if (valIsSymbol) {
  5063. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5064. } else if (othIsNull || othIsSymbol) {
  5065. setLow = false;
  5066. } else {
  5067. setLow = retHighest ? (computed <= value) : (computed < value);
  5068. }
  5069. if (setLow) {
  5070. low = mid + 1;
  5071. } else {
  5072. high = mid;
  5073. }
  5074. }
  5075. return nativeMin(high, MAX_ARRAY_INDEX);
  5076. }
  5077. /**
  5078. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5079. * support for iteratee shorthands.
  5080. *
  5081. * @private
  5082. * @param {Array} array The array to inspect.
  5083. * @param {Function} [iteratee] The iteratee invoked per element.
  5084. * @returns {Array} Returns the new duplicate free array.
  5085. */
  5086. function baseSortedUniq(array, iteratee) {
  5087. var index = -1,
  5088. length = array.length,
  5089. resIndex = 0,
  5090. result = [];
  5091. while (++index < length) {
  5092. var value = array[index],
  5093. computed = iteratee ? iteratee(value) : value;
  5094. if (!index || !eq(computed, seen)) {
  5095. var seen = computed;
  5096. result[resIndex++] = value === 0 ? 0 : value;
  5097. }
  5098. }
  5099. return result;
  5100. }
  5101. /**
  5102. * The base implementation of `_.toNumber` which doesn't ensure correct
  5103. * conversions of binary, hexadecimal, or octal string values.
  5104. *
  5105. * @private
  5106. * @param {*} value The value to process.
  5107. * @returns {number} Returns the number.
  5108. */
  5109. function baseToNumber(value) {
  5110. if (typeof value == 'number') {
  5111. return value;
  5112. }
  5113. if (isSymbol(value)) {
  5114. return NAN;
  5115. }
  5116. return +value;
  5117. }
  5118. /**
  5119. * The base implementation of `_.toString` which doesn't convert nullish
  5120. * values to empty strings.
  5121. *
  5122. * @private
  5123. * @param {*} value The value to process.
  5124. * @returns {string} Returns the string.
  5125. */
  5126. function baseToString(value) {
  5127. // Exit early for strings to avoid a performance hit in some environments.
  5128. if (typeof value == 'string') {
  5129. return value;
  5130. }
  5131. if (isArray(value)) {
  5132. // Recursively convert values (susceptible to call stack limits).
  5133. return arrayMap(value, baseToString) + '';
  5134. }
  5135. if (isSymbol(value)) {
  5136. return symbolToString ? symbolToString.call(value) : '';
  5137. }
  5138. var result = (value + '');
  5139. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5140. }
  5141. /**
  5142. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5143. *
  5144. * @private
  5145. * @param {Array} array The array to inspect.
  5146. * @param {Function} [iteratee] The iteratee invoked per element.
  5147. * @param {Function} [comparator] The comparator invoked per element.
  5148. * @returns {Array} Returns the new duplicate free array.
  5149. */
  5150. function baseUniq(array, iteratee, comparator) {
  5151. var index = -1,
  5152. includes = arrayIncludes,
  5153. length = array.length,
  5154. isCommon = true,
  5155. result = [],
  5156. seen = result;
  5157. if (comparator) {
  5158. isCommon = false;
  5159. includes = arrayIncludesWith;
  5160. }
  5161. else if (length >= LARGE_ARRAY_SIZE) {
  5162. var set = iteratee ? null : createSet(array);
  5163. if (set) {
  5164. return setToArray(set);
  5165. }
  5166. isCommon = false;
  5167. includes = cacheHas;
  5168. seen = new SetCache;
  5169. }
  5170. else {
  5171. seen = iteratee ? [] : result;
  5172. }
  5173. outer:
  5174. while (++index < length) {
  5175. var value = array[index],
  5176. computed = iteratee ? iteratee(value) : value;
  5177. value = (comparator || value !== 0) ? value : 0;
  5178. if (isCommon && computed === computed) {
  5179. var seenIndex = seen.length;
  5180. while (seenIndex--) {
  5181. if (seen[seenIndex] === computed) {
  5182. continue outer;
  5183. }
  5184. }
  5185. if (iteratee) {
  5186. seen.push(computed);
  5187. }
  5188. result.push(value);
  5189. }
  5190. else if (!includes(seen, computed, comparator)) {
  5191. if (seen !== result) {
  5192. seen.push(computed);
  5193. }
  5194. result.push(value);
  5195. }
  5196. }
  5197. return result;
  5198. }
  5199. /**
  5200. * The base implementation of `_.unset`.
  5201. *
  5202. * @private
  5203. * @param {Object} object The object to modify.
  5204. * @param {Array|string} path The property path to unset.
  5205. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5206. */
  5207. function baseUnset(object, path) {
  5208. path = castPath(path, object);
  5209. object = parent(object, path);
  5210. return object == null || delete object[toKey(last(path))];
  5211. }
  5212. /**
  5213. * The base implementation of `_.update`.
  5214. *
  5215. * @private
  5216. * @param {Object} object The object to modify.
  5217. * @param {Array|string} path The path of the property to update.
  5218. * @param {Function} updater The function to produce the updated value.
  5219. * @param {Function} [customizer] The function to customize path creation.
  5220. * @returns {Object} Returns `object`.
  5221. */
  5222. function baseUpdate(object, path, updater, customizer) {
  5223. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5224. }
  5225. /**
  5226. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5227. * without support for iteratee shorthands.
  5228. *
  5229. * @private
  5230. * @param {Array} array The array to query.
  5231. * @param {Function} predicate The function invoked per iteration.
  5232. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5233. * @param {boolean} [fromRight] Specify iterating from right to left.
  5234. * @returns {Array} Returns the slice of `array`.
  5235. */
  5236. function baseWhile(array, predicate, isDrop, fromRight) {
  5237. var length = array.length,
  5238. index = fromRight ? length : -1;
  5239. while ((fromRight ? index-- : ++index < length) &&
  5240. predicate(array[index], index, array)) {}
  5241. return isDrop
  5242. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5243. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5244. }
  5245. /**
  5246. * The base implementation of `wrapperValue` which returns the result of
  5247. * performing a sequence of actions on the unwrapped `value`, where each
  5248. * successive action is supplied the return value of the previous.
  5249. *
  5250. * @private
  5251. * @param {*} value The unwrapped value.
  5252. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5253. * @returns {*} Returns the resolved value.
  5254. */
  5255. function baseWrapperValue(value, actions) {
  5256. var result = value;
  5257. if (result instanceof LazyWrapper) {
  5258. result = result.value();
  5259. }
  5260. return arrayReduce(actions, function(result, action) {
  5261. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5262. }, result);
  5263. }
  5264. /**
  5265. * The base implementation of methods like `_.xor`, without support for
  5266. * iteratee shorthands, that accepts an array of arrays to inspect.
  5267. *
  5268. * @private
  5269. * @param {Array} arrays The arrays to inspect.
  5270. * @param {Function} [iteratee] The iteratee invoked per element.
  5271. * @param {Function} [comparator] The comparator invoked per element.
  5272. * @returns {Array} Returns the new array of values.
  5273. */
  5274. function baseXor(arrays, iteratee, comparator) {
  5275. var length = arrays.length;
  5276. if (length < 2) {
  5277. return length ? baseUniq(arrays[0]) : [];
  5278. }
  5279. var index = -1,
  5280. result = Array(length);
  5281. while (++index < length) {
  5282. var array = arrays[index],
  5283. othIndex = -1;
  5284. while (++othIndex < length) {
  5285. if (othIndex != index) {
  5286. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5287. }
  5288. }
  5289. }
  5290. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5291. }
  5292. /**
  5293. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5294. *
  5295. * @private
  5296. * @param {Array} props The property identifiers.
  5297. * @param {Array} values The property values.
  5298. * @param {Function} assignFunc The function to assign values.
  5299. * @returns {Object} Returns the new object.
  5300. */
  5301. function baseZipObject(props, values, assignFunc) {
  5302. var index = -1,
  5303. length = props.length,
  5304. valsLength = values.length,
  5305. result = {};
  5306. while (++index < length) {
  5307. var value = index < valsLength ? values[index] : undefined;
  5308. assignFunc(result, props[index], value);
  5309. }
  5310. return result;
  5311. }
  5312. /**
  5313. * Casts `value` to an empty array if it's not an array like object.
  5314. *
  5315. * @private
  5316. * @param {*} value The value to inspect.
  5317. * @returns {Array|Object} Returns the cast array-like object.
  5318. */
  5319. function castArrayLikeObject(value) {
  5320. return isArrayLikeObject(value) ? value : [];
  5321. }
  5322. /**
  5323. * Casts `value` to `identity` if it's not a function.
  5324. *
  5325. * @private
  5326. * @param {*} value The value to inspect.
  5327. * @returns {Function} Returns cast function.
  5328. */
  5329. function castFunction(value) {
  5330. return typeof value == 'function' ? value : identity;
  5331. }
  5332. /**
  5333. * Casts `value` to a path array if it's not one.
  5334. *
  5335. * @private
  5336. * @param {*} value The value to inspect.
  5337. * @param {Object} [object] The object to query keys on.
  5338. * @returns {Array} Returns the cast property path array.
  5339. */
  5340. function castPath(value, object) {
  5341. if (isArray(value)) {
  5342. return value;
  5343. }
  5344. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5345. }
  5346. /**
  5347. * A `baseRest` alias which can be replaced with `identity` by module
  5348. * replacement plugins.
  5349. *
  5350. * @private
  5351. * @type {Function}
  5352. * @param {Function} func The function to apply a rest parameter to.
  5353. * @returns {Function} Returns the new function.
  5354. */
  5355. var castRest = baseRest;
  5356. /**
  5357. * Casts `array` to a slice if it's needed.
  5358. *
  5359. * @private
  5360. * @param {Array} array The array to inspect.
  5361. * @param {number} start The start position.
  5362. * @param {number} [end=array.length] The end position.
  5363. * @returns {Array} Returns the cast slice.
  5364. */
  5365. function castSlice(array, start, end) {
  5366. var length = array.length;
  5367. end = end === undefined ? length : end;
  5368. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5369. }
  5370. /**
  5371. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5372. *
  5373. * @private
  5374. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5375. */
  5376. var clearTimeout = ctxClearTimeout || function(id) {
  5377. return root.clearTimeout(id);
  5378. };
  5379. /**
  5380. * Creates a clone of `buffer`.
  5381. *
  5382. * @private
  5383. * @param {Buffer} buffer The buffer to clone.
  5384. * @param {boolean} [isDeep] Specify a deep clone.
  5385. * @returns {Buffer} Returns the cloned buffer.
  5386. */
  5387. function cloneBuffer(buffer, isDeep) {
  5388. if (isDeep) {
  5389. return buffer.slice();
  5390. }
  5391. var length = buffer.length,
  5392. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5393. buffer.copy(result);
  5394. return result;
  5395. }
  5396. /**
  5397. * Creates a clone of `arrayBuffer`.
  5398. *
  5399. * @private
  5400. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5401. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5402. */
  5403. function cloneArrayBuffer(arrayBuffer) {
  5404. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5405. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5406. return result;
  5407. }
  5408. /**
  5409. * Creates a clone of `dataView`.
  5410. *
  5411. * @private
  5412. * @param {Object} dataView The data view to clone.
  5413. * @param {boolean} [isDeep] Specify a deep clone.
  5414. * @returns {Object} Returns the cloned data view.
  5415. */
  5416. function cloneDataView(dataView, isDeep) {
  5417. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5418. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5419. }
  5420. /**
  5421. * Creates a clone of `regexp`.
  5422. *
  5423. * @private
  5424. * @param {Object} regexp The regexp to clone.
  5425. * @returns {Object} Returns the cloned regexp.
  5426. */
  5427. function cloneRegExp(regexp) {
  5428. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5429. result.lastIndex = regexp.lastIndex;
  5430. return result;
  5431. }
  5432. /**
  5433. * Creates a clone of the `symbol` object.
  5434. *
  5435. * @private
  5436. * @param {Object} symbol The symbol object to clone.
  5437. * @returns {Object} Returns the cloned symbol object.
  5438. */
  5439. function cloneSymbol(symbol) {
  5440. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5441. }
  5442. /**
  5443. * Creates a clone of `typedArray`.
  5444. *
  5445. * @private
  5446. * @param {Object} typedArray The typed array to clone.
  5447. * @param {boolean} [isDeep] Specify a deep clone.
  5448. * @returns {Object} Returns the cloned typed array.
  5449. */
  5450. function cloneTypedArray(typedArray, isDeep) {
  5451. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5452. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5453. }
  5454. /**
  5455. * Compares values to sort them in ascending order.
  5456. *
  5457. * @private
  5458. * @param {*} value The value to compare.
  5459. * @param {*} other The other value to compare.
  5460. * @returns {number} Returns the sort order indicator for `value`.
  5461. */
  5462. function compareAscending(value, other) {
  5463. if (value !== other) {
  5464. var valIsDefined = value !== undefined,
  5465. valIsNull = value === null,
  5466. valIsReflexive = value === value,
  5467. valIsSymbol = isSymbol(value);
  5468. var othIsDefined = other !== undefined,
  5469. othIsNull = other === null,
  5470. othIsReflexive = other === other,
  5471. othIsSymbol = isSymbol(other);
  5472. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5473. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5474. (valIsNull && othIsDefined && othIsReflexive) ||
  5475. (!valIsDefined && othIsReflexive) ||
  5476. !valIsReflexive) {
  5477. return 1;
  5478. }
  5479. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5480. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5481. (othIsNull && valIsDefined && valIsReflexive) ||
  5482. (!othIsDefined && valIsReflexive) ||
  5483. !othIsReflexive) {
  5484. return -1;
  5485. }
  5486. }
  5487. return 0;
  5488. }
  5489. /**
  5490. * Used by `_.orderBy` to compare multiple properties of a value to another
  5491. * and stable sort them.
  5492. *
  5493. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5494. * specify an order of "desc" for descending or "asc" for ascending sort order
  5495. * of corresponding values.
  5496. *
  5497. * @private
  5498. * @param {Object} object The object to compare.
  5499. * @param {Object} other The other object to compare.
  5500. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5501. * @returns {number} Returns the sort order indicator for `object`.
  5502. */
  5503. function compareMultiple(object, other, orders) {
  5504. var index = -1,
  5505. objCriteria = object.criteria,
  5506. othCriteria = other.criteria,
  5507. length = objCriteria.length,
  5508. ordersLength = orders.length;
  5509. while (++index < length) {
  5510. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5511. if (result) {
  5512. if (index >= ordersLength) {
  5513. return result;
  5514. }
  5515. var order = orders[index];
  5516. return result * (order == 'desc' ? -1 : 1);
  5517. }
  5518. }
  5519. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5520. // that causes it, under certain circumstances, to provide the same value for
  5521. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5522. // for more details.
  5523. //
  5524. // This also ensures a stable sort in V8 and other engines.
  5525. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5526. return object.index - other.index;
  5527. }
  5528. /**
  5529. * Creates an array that is the composition of partially applied arguments,
  5530. * placeholders, and provided arguments into a single array of arguments.
  5531. *
  5532. * @private
  5533. * @param {Array} args The provided arguments.
  5534. * @param {Array} partials The arguments to prepend to those provided.
  5535. * @param {Array} holders The `partials` placeholder indexes.
  5536. * @params {boolean} [isCurried] Specify composing for a curried function.
  5537. * @returns {Array} Returns the new array of composed arguments.
  5538. */
  5539. function composeArgs(args, partials, holders, isCurried) {
  5540. var argsIndex = -1,
  5541. argsLength = args.length,
  5542. holdersLength = holders.length,
  5543. leftIndex = -1,
  5544. leftLength = partials.length,
  5545. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5546. result = Array(leftLength + rangeLength),
  5547. isUncurried = !isCurried;
  5548. while (++leftIndex < leftLength) {
  5549. result[leftIndex] = partials[leftIndex];
  5550. }
  5551. while (++argsIndex < holdersLength) {
  5552. if (isUncurried || argsIndex < argsLength) {
  5553. result[holders[argsIndex]] = args[argsIndex];
  5554. }
  5555. }
  5556. while (rangeLength--) {
  5557. result[leftIndex++] = args[argsIndex++];
  5558. }
  5559. return result;
  5560. }
  5561. /**
  5562. * This function is like `composeArgs` except that the arguments composition
  5563. * is tailored for `_.partialRight`.
  5564. *
  5565. * @private
  5566. * @param {Array} args The provided arguments.
  5567. * @param {Array} partials The arguments to append to those provided.
  5568. * @param {Array} holders The `partials` placeholder indexes.
  5569. * @params {boolean} [isCurried] Specify composing for a curried function.
  5570. * @returns {Array} Returns the new array of composed arguments.
  5571. */
  5572. function composeArgsRight(args, partials, holders, isCurried) {
  5573. var argsIndex = -1,
  5574. argsLength = args.length,
  5575. holdersIndex = -1,
  5576. holdersLength = holders.length,
  5577. rightIndex = -1,
  5578. rightLength = partials.length,
  5579. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5580. result = Array(rangeLength + rightLength),
  5581. isUncurried = !isCurried;
  5582. while (++argsIndex < rangeLength) {
  5583. result[argsIndex] = args[argsIndex];
  5584. }
  5585. var offset = argsIndex;
  5586. while (++rightIndex < rightLength) {
  5587. result[offset + rightIndex] = partials[rightIndex];
  5588. }
  5589. while (++holdersIndex < holdersLength) {
  5590. if (isUncurried || argsIndex < argsLength) {
  5591. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5592. }
  5593. }
  5594. return result;
  5595. }
  5596. /**
  5597. * Copies the values of `source` to `array`.
  5598. *
  5599. * @private
  5600. * @param {Array} source The array to copy values from.
  5601. * @param {Array} [array=[]] The array to copy values to.
  5602. * @returns {Array} Returns `array`.
  5603. */
  5604. function copyArray(source, array) {
  5605. var index = -1,
  5606. length = source.length;
  5607. array || (array = Array(length));
  5608. while (++index < length) {
  5609. array[index] = source[index];
  5610. }
  5611. return array;
  5612. }
  5613. /**
  5614. * Copies properties of `source` to `object`.
  5615. *
  5616. * @private
  5617. * @param {Object} source The object to copy properties from.
  5618. * @param {Array} props The property identifiers to copy.
  5619. * @param {Object} [object={}] The object to copy properties to.
  5620. * @param {Function} [customizer] The function to customize copied values.
  5621. * @returns {Object} Returns `object`.
  5622. */
  5623. function copyObject(source, props, object, customizer) {
  5624. var isNew = !object;
  5625. object || (object = {});
  5626. var index = -1,
  5627. length = props.length;
  5628. while (++index < length) {
  5629. var key = props[index];
  5630. var newValue = customizer
  5631. ? customizer(object[key], source[key], key, object, source)
  5632. : undefined;
  5633. if (newValue === undefined) {
  5634. newValue = source[key];
  5635. }
  5636. if (isNew) {
  5637. baseAssignValue(object, key, newValue);
  5638. } else {
  5639. assignValue(object, key, newValue);
  5640. }
  5641. }
  5642. return object;
  5643. }
  5644. /**
  5645. * Copies own symbols of `source` to `object`.
  5646. *
  5647. * @private
  5648. * @param {Object} source The object to copy symbols from.
  5649. * @param {Object} [object={}] The object to copy symbols to.
  5650. * @returns {Object} Returns `object`.
  5651. */
  5652. function copySymbols(source, object) {
  5653. return copyObject(source, getSymbols(source), object);
  5654. }
  5655. /**
  5656. * Copies own and inherited 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 copySymbolsIn(source, object) {
  5664. return copyObject(source, getSymbolsIn(source), object);
  5665. }
  5666. /**
  5667. * Creates a function like `_.groupBy`.
  5668. *
  5669. * @private
  5670. * @param {Function} setter The function to set accumulator values.
  5671. * @param {Function} [initializer] The accumulator object initializer.
  5672. * @returns {Function} Returns the new aggregator function.
  5673. */
  5674. function createAggregator(setter, initializer) {
  5675. return function(collection, iteratee) {
  5676. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5677. accumulator = initializer ? initializer() : {};
  5678. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5679. };
  5680. }
  5681. /**
  5682. * Creates a function like `_.assign`.
  5683. *
  5684. * @private
  5685. * @param {Function} assigner The function to assign values.
  5686. * @returns {Function} Returns the new assigner function.
  5687. */
  5688. function createAssigner(assigner) {
  5689. return baseRest(function(object, sources) {
  5690. var index = -1,
  5691. length = sources.length,
  5692. customizer = length > 1 ? sources[length - 1] : undefined,
  5693. guard = length > 2 ? sources[2] : undefined;
  5694. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5695. ? (length--, customizer)
  5696. : undefined;
  5697. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5698. customizer = length < 3 ? undefined : customizer;
  5699. length = 1;
  5700. }
  5701. object = Object(object);
  5702. while (++index < length) {
  5703. var source = sources[index];
  5704. if (source) {
  5705. assigner(object, source, index, customizer);
  5706. }
  5707. }
  5708. return object;
  5709. });
  5710. }
  5711. /**
  5712. * Creates a `baseEach` or `baseEachRight` function.
  5713. *
  5714. * @private
  5715. * @param {Function} eachFunc The function to iterate over a collection.
  5716. * @param {boolean} [fromRight] Specify iterating from right to left.
  5717. * @returns {Function} Returns the new base function.
  5718. */
  5719. function createBaseEach(eachFunc, fromRight) {
  5720. return function(collection, iteratee) {
  5721. if (collection == null) {
  5722. return collection;
  5723. }
  5724. if (!isArrayLike(collection)) {
  5725. return eachFunc(collection, iteratee);
  5726. }
  5727. var length = collection.length,
  5728. index = fromRight ? length : -1,
  5729. iterable = Object(collection);
  5730. while ((fromRight ? index-- : ++index < length)) {
  5731. if (iteratee(iterable[index], index, iterable) === false) {
  5732. break;
  5733. }
  5734. }
  5735. return collection;
  5736. };
  5737. }
  5738. /**
  5739. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5740. *
  5741. * @private
  5742. * @param {boolean} [fromRight] Specify iterating from right to left.
  5743. * @returns {Function} Returns the new base function.
  5744. */
  5745. function createBaseFor(fromRight) {
  5746. return function(object, iteratee, keysFunc) {
  5747. var index = -1,
  5748. iterable = Object(object),
  5749. props = keysFunc(object),
  5750. length = props.length;
  5751. while (length--) {
  5752. var key = props[fromRight ? length : ++index];
  5753. if (iteratee(iterable[key], key, iterable) === false) {
  5754. break;
  5755. }
  5756. }
  5757. return object;
  5758. };
  5759. }
  5760. /**
  5761. * Creates a function that wraps `func` to invoke it with the optional `this`
  5762. * binding of `thisArg`.
  5763. *
  5764. * @private
  5765. * @param {Function} func The function to wrap.
  5766. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5767. * @param {*} [thisArg] The `this` binding of `func`.
  5768. * @returns {Function} Returns the new wrapped function.
  5769. */
  5770. function createBind(func, bitmask, thisArg) {
  5771. var isBind = bitmask & WRAP_BIND_FLAG,
  5772. Ctor = createCtor(func);
  5773. function wrapper() {
  5774. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5775. return fn.apply(isBind ? thisArg : this, arguments);
  5776. }
  5777. return wrapper;
  5778. }
  5779. /**
  5780. * Creates a function like `_.lowerFirst`.
  5781. *
  5782. * @private
  5783. * @param {string} methodName The name of the `String` case method to use.
  5784. * @returns {Function} Returns the new case function.
  5785. */
  5786. function createCaseFirst(methodName) {
  5787. return function(string) {
  5788. string = toString(string);
  5789. var strSymbols = hasUnicode(string)
  5790. ? stringToArray(string)
  5791. : undefined;
  5792. var chr = strSymbols
  5793. ? strSymbols[0]
  5794. : string.charAt(0);
  5795. var trailing = strSymbols
  5796. ? castSlice(strSymbols, 1).join('')
  5797. : string.slice(1);
  5798. return chr[methodName]() + trailing;
  5799. };
  5800. }
  5801. /**
  5802. * Creates a function like `_.camelCase`.
  5803. *
  5804. * @private
  5805. * @param {Function} callback The function to combine each word.
  5806. * @returns {Function} Returns the new compounder function.
  5807. */
  5808. function createCompounder(callback) {
  5809. return function(string) {
  5810. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5811. };
  5812. }
  5813. /**
  5814. * Creates a function that produces an instance of `Ctor` regardless of
  5815. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5816. *
  5817. * @private
  5818. * @param {Function} Ctor The constructor to wrap.
  5819. * @returns {Function} Returns the new wrapped function.
  5820. */
  5821. function createCtor(Ctor) {
  5822. return function() {
  5823. // Use a `switch` statement to work with class constructors. See
  5824. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5825. // for more details.
  5826. var args = arguments;
  5827. switch (args.length) {
  5828. case 0: return new Ctor;
  5829. case 1: return new Ctor(args[0]);
  5830. case 2: return new Ctor(args[0], args[1]);
  5831. case 3: return new Ctor(args[0], args[1], args[2]);
  5832. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5833. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5834. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5835. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5836. }
  5837. var thisBinding = baseCreate(Ctor.prototype),
  5838. result = Ctor.apply(thisBinding, args);
  5839. // Mimic the constructor's `return` behavior.
  5840. // See https://es5.github.io/#x13.2.2 for more details.
  5841. return isObject(result) ? result : thisBinding;
  5842. };
  5843. }
  5844. /**
  5845. * Creates a function that wraps `func` to enable currying.
  5846. *
  5847. * @private
  5848. * @param {Function} func The function to wrap.
  5849. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5850. * @param {number} arity The arity of `func`.
  5851. * @returns {Function} Returns the new wrapped function.
  5852. */
  5853. function createCurry(func, bitmask, arity) {
  5854. var Ctor = createCtor(func);
  5855. function wrapper() {
  5856. var length = arguments.length,
  5857. args = Array(length),
  5858. index = length,
  5859. placeholder = getHolder(wrapper);
  5860. while (index--) {
  5861. args[index] = arguments[index];
  5862. }
  5863. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5864. ? []
  5865. : replaceHolders(args, placeholder);
  5866. length -= holders.length;
  5867. if (length < arity) {
  5868. return createRecurry(
  5869. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5870. args, holders, undefined, undefined, arity - length);
  5871. }
  5872. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5873. return apply(fn, this, args);
  5874. }
  5875. return wrapper;
  5876. }
  5877. /**
  5878. * Creates a `_.find` or `_.findLast` function.
  5879. *
  5880. * @private
  5881. * @param {Function} findIndexFunc The function to find the collection index.
  5882. * @returns {Function} Returns the new find function.
  5883. */
  5884. function createFind(findIndexFunc) {
  5885. return function(collection, predicate, fromIndex) {
  5886. var iterable = Object(collection);
  5887. if (!isArrayLike(collection)) {
  5888. var iteratee = getIteratee(predicate, 3);
  5889. collection = keys(collection);
  5890. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5891. }
  5892. var index = findIndexFunc(collection, predicate, fromIndex);
  5893. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5894. };
  5895. }
  5896. /**
  5897. * Creates a `_.flow` or `_.flowRight` function.
  5898. *
  5899. * @private
  5900. * @param {boolean} [fromRight] Specify iterating from right to left.
  5901. * @returns {Function} Returns the new flow function.
  5902. */
  5903. function createFlow(fromRight) {
  5904. return flatRest(function(funcs) {
  5905. var length = funcs.length,
  5906. index = length,
  5907. prereq = LodashWrapper.prototype.thru;
  5908. if (fromRight) {
  5909. funcs.reverse();
  5910. }
  5911. while (index--) {
  5912. var func = funcs[index];
  5913. if (typeof func != 'function') {
  5914. throw new TypeError(FUNC_ERROR_TEXT);
  5915. }
  5916. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5917. var wrapper = new LodashWrapper([], true);
  5918. }
  5919. }
  5920. index = wrapper ? index : length;
  5921. while (++index < length) {
  5922. func = funcs[index];
  5923. var funcName = getFuncName(func),
  5924. data = funcName == 'wrapper' ? getData(func) : undefined;
  5925. if (data && isLaziable(data[0]) &&
  5926. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5927. !data[4].length && data[9] == 1
  5928. ) {
  5929. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5930. } else {
  5931. wrapper = (func.length == 1 && isLaziable(func))
  5932. ? wrapper[funcName]()
  5933. : wrapper.thru(func);
  5934. }
  5935. }
  5936. return function() {
  5937. var args = arguments,
  5938. value = args[0];
  5939. if (wrapper && args.length == 1 && isArray(value)) {
  5940. return wrapper.plant(value).value();
  5941. }
  5942. var index = 0,
  5943. result = length ? funcs[index].apply(this, args) : value;
  5944. while (++index < length) {
  5945. result = funcs[index].call(this, result);
  5946. }
  5947. return result;
  5948. };
  5949. });
  5950. }
  5951. /**
  5952. * Creates a function that wraps `func` to invoke it with optional `this`
  5953. * binding of `thisArg`, partial application, and currying.
  5954. *
  5955. * @private
  5956. * @param {Function|string} func The function or method name to wrap.
  5957. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5958. * @param {*} [thisArg] The `this` binding of `func`.
  5959. * @param {Array} [partials] The arguments to prepend to those provided to
  5960. * the new function.
  5961. * @param {Array} [holders] The `partials` placeholder indexes.
  5962. * @param {Array} [partialsRight] The arguments to append to those provided
  5963. * to the new function.
  5964. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5965. * @param {Array} [argPos] The argument positions of the new function.
  5966. * @param {number} [ary] The arity cap of `func`.
  5967. * @param {number} [arity] The arity of `func`.
  5968. * @returns {Function} Returns the new wrapped function.
  5969. */
  5970. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5971. var isAry = bitmask & WRAP_ARY_FLAG,
  5972. isBind = bitmask & WRAP_BIND_FLAG,
  5973. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5974. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5975. isFlip = bitmask & WRAP_FLIP_FLAG,
  5976. Ctor = isBindKey ? undefined : createCtor(func);
  5977. function wrapper() {
  5978. var length = arguments.length,
  5979. args = Array(length),
  5980. index = length;
  5981. while (index--) {
  5982. args[index] = arguments[index];
  5983. }
  5984. if (isCurried) {
  5985. var placeholder = getHolder(wrapper),
  5986. holdersCount = countHolders(args, placeholder);
  5987. }
  5988. if (partials) {
  5989. args = composeArgs(args, partials, holders, isCurried);
  5990. }
  5991. if (partialsRight) {
  5992. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5993. }
  5994. length -= holdersCount;
  5995. if (isCurried && length < arity) {
  5996. var newHolders = replaceHolders(args, placeholder);
  5997. return createRecurry(
  5998. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5999. args, newHolders, argPos, ary, arity - length
  6000. );
  6001. }
  6002. var thisBinding = isBind ? thisArg : this,
  6003. fn = isBindKey ? thisBinding[func] : func;
  6004. length = args.length;
  6005. if (argPos) {
  6006. args = reorder(args, argPos);
  6007. } else if (isFlip && length > 1) {
  6008. args.reverse();
  6009. }
  6010. if (isAry && ary < length) {
  6011. args.length = ary;
  6012. }
  6013. if (this && this !== root && this instanceof wrapper) {
  6014. fn = Ctor || createCtor(fn);
  6015. }
  6016. return fn.apply(thisBinding, args);
  6017. }
  6018. return wrapper;
  6019. }
  6020. /**
  6021. * Creates a function like `_.invertBy`.
  6022. *
  6023. * @private
  6024. * @param {Function} setter The function to set accumulator values.
  6025. * @param {Function} toIteratee The function to resolve iteratees.
  6026. * @returns {Function} Returns the new inverter function.
  6027. */
  6028. function createInverter(setter, toIteratee) {
  6029. return function(object, iteratee) {
  6030. return baseInverter(object, setter, toIteratee(iteratee), {});
  6031. };
  6032. }
  6033. /**
  6034. * Creates a function that performs a mathematical operation on two values.
  6035. *
  6036. * @private
  6037. * @param {Function} operator The function to perform the operation.
  6038. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6039. * @returns {Function} Returns the new mathematical operation function.
  6040. */
  6041. function createMathOperation(operator, defaultValue) {
  6042. return function(value, other) {
  6043. var result;
  6044. if (value === undefined && other === undefined) {
  6045. return defaultValue;
  6046. }
  6047. if (value !== undefined) {
  6048. result = value;
  6049. }
  6050. if (other !== undefined) {
  6051. if (result === undefined) {
  6052. return other;
  6053. }
  6054. if (typeof value == 'string' || typeof other == 'string') {
  6055. value = baseToString(value);
  6056. other = baseToString(other);
  6057. } else {
  6058. value = baseToNumber(value);
  6059. other = baseToNumber(other);
  6060. }
  6061. result = operator(value, other);
  6062. }
  6063. return result;
  6064. };
  6065. }
  6066. /**
  6067. * Creates a function like `_.over`.
  6068. *
  6069. * @private
  6070. * @param {Function} arrayFunc The function to iterate over iteratees.
  6071. * @returns {Function} Returns the new over function.
  6072. */
  6073. function createOver(arrayFunc) {
  6074. return flatRest(function(iteratees) {
  6075. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6076. return baseRest(function(args) {
  6077. var thisArg = this;
  6078. return arrayFunc(iteratees, function(iteratee) {
  6079. return apply(iteratee, thisArg, args);
  6080. });
  6081. });
  6082. });
  6083. }
  6084. /**
  6085. * Creates the padding for `string` based on `length`. The `chars` string
  6086. * is truncated if the number of characters exceeds `length`.
  6087. *
  6088. * @private
  6089. * @param {number} length The padding length.
  6090. * @param {string} [chars=' '] The string used as padding.
  6091. * @returns {string} Returns the padding for `string`.
  6092. */
  6093. function createPadding(length, chars) {
  6094. chars = chars === undefined ? ' ' : baseToString(chars);
  6095. var charsLength = chars.length;
  6096. if (charsLength < 2) {
  6097. return charsLength ? baseRepeat(chars, length) : chars;
  6098. }
  6099. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6100. return hasUnicode(chars)
  6101. ? castSlice(stringToArray(result), 0, length).join('')
  6102. : result.slice(0, length);
  6103. }
  6104. /**
  6105. * Creates a function that wraps `func` to invoke it with the `this` binding
  6106. * of `thisArg` and `partials` prepended to the arguments it receives.
  6107. *
  6108. * @private
  6109. * @param {Function} func The function to wrap.
  6110. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6111. * @param {*} thisArg The `this` binding of `func`.
  6112. * @param {Array} partials The arguments to prepend to those provided to
  6113. * the new function.
  6114. * @returns {Function} Returns the new wrapped function.
  6115. */
  6116. function createPartial(func, bitmask, thisArg, partials) {
  6117. var isBind = bitmask & WRAP_BIND_FLAG,
  6118. Ctor = createCtor(func);
  6119. function wrapper() {
  6120. var argsIndex = -1,
  6121. argsLength = arguments.length,
  6122. leftIndex = -1,
  6123. leftLength = partials.length,
  6124. args = Array(leftLength + argsLength),
  6125. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6126. while (++leftIndex < leftLength) {
  6127. args[leftIndex] = partials[leftIndex];
  6128. }
  6129. while (argsLength--) {
  6130. args[leftIndex++] = arguments[++argsIndex];
  6131. }
  6132. return apply(fn, isBind ? thisArg : this, args);
  6133. }
  6134. return wrapper;
  6135. }
  6136. /**
  6137. * Creates a `_.range` or `_.rangeRight` function.
  6138. *
  6139. * @private
  6140. * @param {boolean} [fromRight] Specify iterating from right to left.
  6141. * @returns {Function} Returns the new range function.
  6142. */
  6143. function createRange(fromRight) {
  6144. return function(start, end, step) {
  6145. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6146. end = step = undefined;
  6147. }
  6148. // Ensure the sign of `-0` is preserved.
  6149. start = toFinite(start);
  6150. if (end === undefined) {
  6151. end = start;
  6152. start = 0;
  6153. } else {
  6154. end = toFinite(end);
  6155. }
  6156. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6157. return baseRange(start, end, step, fromRight);
  6158. };
  6159. }
  6160. /**
  6161. * Creates a function that performs a relational operation on two values.
  6162. *
  6163. * @private
  6164. * @param {Function} operator The function to perform the operation.
  6165. * @returns {Function} Returns the new relational operation function.
  6166. */
  6167. function createRelationalOperation(operator) {
  6168. return function(value, other) {
  6169. if (!(typeof value == 'string' && typeof other == 'string')) {
  6170. value = toNumber(value);
  6171. other = toNumber(other);
  6172. }
  6173. return operator(value, other);
  6174. };
  6175. }
  6176. /**
  6177. * Creates a function that wraps `func` to continue currying.
  6178. *
  6179. * @private
  6180. * @param {Function} func The function to wrap.
  6181. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6182. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6183. * @param {*} placeholder The placeholder value.
  6184. * @param {*} [thisArg] The `this` binding of `func`.
  6185. * @param {Array} [partials] The arguments to prepend to those provided to
  6186. * the new function.
  6187. * @param {Array} [holders] The `partials` placeholder indexes.
  6188. * @param {Array} [argPos] The argument positions of the new function.
  6189. * @param {number} [ary] The arity cap of `func`.
  6190. * @param {number} [arity] The arity of `func`.
  6191. * @returns {Function} Returns the new wrapped function.
  6192. */
  6193. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6194. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6195. newHolders = isCurry ? holders : undefined,
  6196. newHoldersRight = isCurry ? undefined : holders,
  6197. newPartials = isCurry ? partials : undefined,
  6198. newPartialsRight = isCurry ? undefined : partials;
  6199. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6200. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6201. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6202. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6203. }
  6204. var newData = [
  6205. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6206. newHoldersRight, argPos, ary, arity
  6207. ];
  6208. var result = wrapFunc.apply(undefined, newData);
  6209. if (isLaziable(func)) {
  6210. setData(result, newData);
  6211. }
  6212. result.placeholder = placeholder;
  6213. return setWrapToString(result, func, bitmask);
  6214. }
  6215. /**
  6216. * Creates a function like `_.round`.
  6217. *
  6218. * @private
  6219. * @param {string} methodName The name of the `Math` method to use when rounding.
  6220. * @returns {Function} Returns the new round function.
  6221. */
  6222. function createRound(methodName) {
  6223. var func = Math[methodName];
  6224. return function(number, precision) {
  6225. number = toNumber(number);
  6226. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6227. if (precision && nativeIsFinite(number)) {
  6228. // Shift with exponential notation to avoid floating-point issues.
  6229. // See [MDN](https://mdn.io/round#Examples) for more details.
  6230. var pair = (toString(number) + 'e').split('e'),
  6231. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6232. pair = (toString(value) + 'e').split('e');
  6233. return +(pair[0] + 'e' + (+pair[1] - precision));
  6234. }
  6235. return func(number);
  6236. };
  6237. }
  6238. /**
  6239. * Creates a set object of `values`.
  6240. *
  6241. * @private
  6242. * @param {Array} values The values to add to the set.
  6243. * @returns {Object} Returns the new set.
  6244. */
  6245. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6246. return new Set(values);
  6247. };
  6248. /**
  6249. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6250. *
  6251. * @private
  6252. * @param {Function} keysFunc The function to get the keys of a given object.
  6253. * @returns {Function} Returns the new pairs function.
  6254. */
  6255. function createToPairs(keysFunc) {
  6256. return function(object) {
  6257. var tag = getTag(object);
  6258. if (tag == mapTag) {
  6259. return mapToArray(object);
  6260. }
  6261. if (tag == setTag) {
  6262. return setToPairs(object);
  6263. }
  6264. return baseToPairs(object, keysFunc(object));
  6265. };
  6266. }
  6267. /**
  6268. * Creates a function that either curries or invokes `func` with optional
  6269. * `this` binding and partially applied arguments.
  6270. *
  6271. * @private
  6272. * @param {Function|string} func The function or method name to wrap.
  6273. * @param {number} bitmask The bitmask flags.
  6274. * 1 - `_.bind`
  6275. * 2 - `_.bindKey`
  6276. * 4 - `_.curry` or `_.curryRight` of a bound function
  6277. * 8 - `_.curry`
  6278. * 16 - `_.curryRight`
  6279. * 32 - `_.partial`
  6280. * 64 - `_.partialRight`
  6281. * 128 - `_.rearg`
  6282. * 256 - `_.ary`
  6283. * 512 - `_.flip`
  6284. * @param {*} [thisArg] The `this` binding of `func`.
  6285. * @param {Array} [partials] The arguments to be partially applied.
  6286. * @param {Array} [holders] The `partials` placeholder indexes.
  6287. * @param {Array} [argPos] The argument positions of the new function.
  6288. * @param {number} [ary] The arity cap of `func`.
  6289. * @param {number} [arity] The arity of `func`.
  6290. * @returns {Function} Returns the new wrapped function.
  6291. */
  6292. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6293. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6294. if (!isBindKey && typeof func != 'function') {
  6295. throw new TypeError(FUNC_ERROR_TEXT);
  6296. }
  6297. var length = partials ? partials.length : 0;
  6298. if (!length) {
  6299. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6300. partials = holders = undefined;
  6301. }
  6302. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6303. arity = arity === undefined ? arity : toInteger(arity);
  6304. length -= holders ? holders.length : 0;
  6305. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6306. var partialsRight = partials,
  6307. holdersRight = holders;
  6308. partials = holders = undefined;
  6309. }
  6310. var data = isBindKey ? undefined : getData(func);
  6311. var newData = [
  6312. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6313. argPos, ary, arity
  6314. ];
  6315. if (data) {
  6316. mergeData(newData, data);
  6317. }
  6318. func = newData[0];
  6319. bitmask = newData[1];
  6320. thisArg = newData[2];
  6321. partials = newData[3];
  6322. holders = newData[4];
  6323. arity = newData[9] = newData[9] === undefined
  6324. ? (isBindKey ? 0 : func.length)
  6325. : nativeMax(newData[9] - length, 0);
  6326. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6327. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6328. }
  6329. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6330. var result = createBind(func, bitmask, thisArg);
  6331. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6332. result = createCurry(func, bitmask, arity);
  6333. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6334. result = createPartial(func, bitmask, thisArg, partials);
  6335. } else {
  6336. result = createHybrid.apply(undefined, newData);
  6337. }
  6338. var setter = data ? baseSetData : setData;
  6339. return setWrapToString(setter(result, newData), func, bitmask);
  6340. }
  6341. /**
  6342. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6343. * of source objects to the destination object for all destination properties
  6344. * that resolve to `undefined`.
  6345. *
  6346. * @private
  6347. * @param {*} objValue The destination value.
  6348. * @param {*} srcValue The source value.
  6349. * @param {string} key The key of the property to assign.
  6350. * @param {Object} object The parent object of `objValue`.
  6351. * @returns {*} Returns the value to assign.
  6352. */
  6353. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6354. if (objValue === undefined ||
  6355. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6356. return srcValue;
  6357. }
  6358. return objValue;
  6359. }
  6360. /**
  6361. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6362. * objects into destination objects that are passed thru.
  6363. *
  6364. * @private
  6365. * @param {*} objValue The destination value.
  6366. * @param {*} srcValue The source value.
  6367. * @param {string} key The key of the property to merge.
  6368. * @param {Object} object The parent object of `objValue`.
  6369. * @param {Object} source The parent object of `srcValue`.
  6370. * @param {Object} [stack] Tracks traversed source values and their merged
  6371. * counterparts.
  6372. * @returns {*} Returns the value to assign.
  6373. */
  6374. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6375. if (isObject(objValue) && isObject(srcValue)) {
  6376. // Recursively merge objects and arrays (susceptible to call stack limits).
  6377. stack.set(srcValue, objValue);
  6378. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6379. stack['delete'](srcValue);
  6380. }
  6381. return objValue;
  6382. }
  6383. /**
  6384. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6385. * objects.
  6386. *
  6387. * @private
  6388. * @param {*} value The value to inspect.
  6389. * @param {string} key The key of the property to inspect.
  6390. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6391. */
  6392. function customOmitClone(value) {
  6393. return isPlainObject(value) ? undefined : value;
  6394. }
  6395. /**
  6396. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6397. * partial deep comparisons.
  6398. *
  6399. * @private
  6400. * @param {Array} array The array to compare.
  6401. * @param {Array} other The other array to compare.
  6402. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6403. * @param {Function} customizer The function to customize comparisons.
  6404. * @param {Function} equalFunc The function to determine equivalents of values.
  6405. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6406. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6407. */
  6408. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6409. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6410. arrLength = array.length,
  6411. othLength = other.length;
  6412. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6413. return false;
  6414. }
  6415. // Check that cyclic values are equal.
  6416. var arrStacked = stack.get(array);
  6417. var othStacked = stack.get(other);
  6418. if (arrStacked && othStacked) {
  6419. return arrStacked == other && othStacked == array;
  6420. }
  6421. var index = -1,
  6422. result = true,
  6423. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6424. stack.set(array, other);
  6425. stack.set(other, array);
  6426. // Ignore non-index properties.
  6427. while (++index < arrLength) {
  6428. var arrValue = array[index],
  6429. othValue = other[index];
  6430. if (customizer) {
  6431. var compared = isPartial
  6432. ? customizer(othValue, arrValue, index, other, array, stack)
  6433. : customizer(arrValue, othValue, index, array, other, stack);
  6434. }
  6435. if (compared !== undefined) {
  6436. if (compared) {
  6437. continue;
  6438. }
  6439. result = false;
  6440. break;
  6441. }
  6442. // Recursively compare arrays (susceptible to call stack limits).
  6443. if (seen) {
  6444. if (!arraySome(other, function(othValue, othIndex) {
  6445. if (!cacheHas(seen, othIndex) &&
  6446. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6447. return seen.push(othIndex);
  6448. }
  6449. })) {
  6450. result = false;
  6451. break;
  6452. }
  6453. } else if (!(
  6454. arrValue === othValue ||
  6455. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6456. )) {
  6457. result = false;
  6458. break;
  6459. }
  6460. }
  6461. stack['delete'](array);
  6462. stack['delete'](other);
  6463. return result;
  6464. }
  6465. /**
  6466. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6467. * the same `toStringTag`.
  6468. *
  6469. * **Note:** This function only supports comparing values with tags of
  6470. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6471. *
  6472. * @private
  6473. * @param {Object} object The object to compare.
  6474. * @param {Object} other The other object to compare.
  6475. * @param {string} tag The `toStringTag` of the objects to compare.
  6476. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6477. * @param {Function} customizer The function to customize comparisons.
  6478. * @param {Function} equalFunc The function to determine equivalents of values.
  6479. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6480. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6481. */
  6482. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6483. switch (tag) {
  6484. case dataViewTag:
  6485. if ((object.byteLength != other.byteLength) ||
  6486. (object.byteOffset != other.byteOffset)) {
  6487. return false;
  6488. }
  6489. object = object.buffer;
  6490. other = other.buffer;
  6491. case arrayBufferTag:
  6492. if ((object.byteLength != other.byteLength) ||
  6493. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6494. return false;
  6495. }
  6496. return true;
  6497. case boolTag:
  6498. case dateTag:
  6499. case numberTag:
  6500. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6501. // Invalid dates are coerced to `NaN`.
  6502. return eq(+object, +other);
  6503. case errorTag:
  6504. return object.name == other.name && object.message == other.message;
  6505. case regexpTag:
  6506. case stringTag:
  6507. // Coerce regexes to strings and treat strings, primitives and objects,
  6508. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6509. // for more details.
  6510. return object == (other + '');
  6511. case mapTag:
  6512. var convert = mapToArray;
  6513. case setTag:
  6514. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6515. convert || (convert = setToArray);
  6516. if (object.size != other.size && !isPartial) {
  6517. return false;
  6518. }
  6519. // Assume cyclic values are equal.
  6520. var stacked = stack.get(object);
  6521. if (stacked) {
  6522. return stacked == other;
  6523. }
  6524. bitmask |= COMPARE_UNORDERED_FLAG;
  6525. // Recursively compare objects (susceptible to call stack limits).
  6526. stack.set(object, other);
  6527. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6528. stack['delete'](object);
  6529. return result;
  6530. case symbolTag:
  6531. if (symbolValueOf) {
  6532. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6533. }
  6534. }
  6535. return false;
  6536. }
  6537. /**
  6538. * A specialized version of `baseIsEqualDeep` for objects with support for
  6539. * partial deep comparisons.
  6540. *
  6541. * @private
  6542. * @param {Object} object The object to compare.
  6543. * @param {Object} other The other object to compare.
  6544. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6545. * @param {Function} customizer The function to customize comparisons.
  6546. * @param {Function} equalFunc The function to determine equivalents of values.
  6547. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6548. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6549. */
  6550. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6551. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6552. objProps = getAllKeys(object),
  6553. objLength = objProps.length,
  6554. othProps = getAllKeys(other),
  6555. othLength = othProps.length;
  6556. if (objLength != othLength && !isPartial) {
  6557. return false;
  6558. }
  6559. var index = objLength;
  6560. while (index--) {
  6561. var key = objProps[index];
  6562. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6563. return false;
  6564. }
  6565. }
  6566. // Check that cyclic values are equal.
  6567. var objStacked = stack.get(object);
  6568. var othStacked = stack.get(other);
  6569. if (objStacked && othStacked) {
  6570. return objStacked == other && othStacked == object;
  6571. }
  6572. var result = true;
  6573. stack.set(object, other);
  6574. stack.set(other, object);
  6575. var skipCtor = isPartial;
  6576. while (++index < objLength) {
  6577. key = objProps[index];
  6578. var objValue = object[key],
  6579. othValue = other[key];
  6580. if (customizer) {
  6581. var compared = isPartial
  6582. ? customizer(othValue, objValue, key, other, object, stack)
  6583. : customizer(objValue, othValue, key, object, other, stack);
  6584. }
  6585. // Recursively compare objects (susceptible to call stack limits).
  6586. if (!(compared === undefined
  6587. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6588. : compared
  6589. )) {
  6590. result = false;
  6591. break;
  6592. }
  6593. skipCtor || (skipCtor = key == 'constructor');
  6594. }
  6595. if (result && !skipCtor) {
  6596. var objCtor = object.constructor,
  6597. othCtor = other.constructor;
  6598. // Non `Object` object instances with different constructors are not equal.
  6599. if (objCtor != othCtor &&
  6600. ('constructor' in object && 'constructor' in other) &&
  6601. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6602. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6603. result = false;
  6604. }
  6605. }
  6606. stack['delete'](object);
  6607. stack['delete'](other);
  6608. return result;
  6609. }
  6610. /**
  6611. * A specialized version of `baseRest` which flattens the rest array.
  6612. *
  6613. * @private
  6614. * @param {Function} func The function to apply a rest parameter to.
  6615. * @returns {Function} Returns the new function.
  6616. */
  6617. function flatRest(func) {
  6618. return setToString(overRest(func, undefined, flatten), func + '');
  6619. }
  6620. /**
  6621. * Creates an array of own enumerable property names and symbols of `object`.
  6622. *
  6623. * @private
  6624. * @param {Object} object The object to query.
  6625. * @returns {Array} Returns the array of property names and symbols.
  6626. */
  6627. function getAllKeys(object) {
  6628. return baseGetAllKeys(object, keys, getSymbols);
  6629. }
  6630. /**
  6631. * Creates an array of own and inherited enumerable property names and
  6632. * 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 getAllKeysIn(object) {
  6639. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6640. }
  6641. /**
  6642. * Gets metadata for `func`.
  6643. *
  6644. * @private
  6645. * @param {Function} func The function to query.
  6646. * @returns {*} Returns the metadata for `func`.
  6647. */
  6648. var getData = !metaMap ? noop : function(func) {
  6649. return metaMap.get(func);
  6650. };
  6651. /**
  6652. * Gets the name of `func`.
  6653. *
  6654. * @private
  6655. * @param {Function} func The function to query.
  6656. * @returns {string} Returns the function name.
  6657. */
  6658. function getFuncName(func) {
  6659. var result = (func.name + ''),
  6660. array = realNames[result],
  6661. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6662. while (length--) {
  6663. var data = array[length],
  6664. otherFunc = data.func;
  6665. if (otherFunc == null || otherFunc == func) {
  6666. return data.name;
  6667. }
  6668. }
  6669. return result;
  6670. }
  6671. /**
  6672. * Gets the argument placeholder value for `func`.
  6673. *
  6674. * @private
  6675. * @param {Function} func The function to inspect.
  6676. * @returns {*} Returns the placeholder value.
  6677. */
  6678. function getHolder(func) {
  6679. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6680. return object.placeholder;
  6681. }
  6682. /**
  6683. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6684. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6685. * If arguments are provided, the chosen function is invoked with them and
  6686. * its result is returned.
  6687. *
  6688. * @private
  6689. * @param {*} [value] The value to convert to an iteratee.
  6690. * @param {number} [arity] The arity of the created iteratee.
  6691. * @returns {Function} Returns the chosen function or its result.
  6692. */
  6693. function getIteratee() {
  6694. var result = lodash.iteratee || iteratee;
  6695. result = result === iteratee ? baseIteratee : result;
  6696. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6697. }
  6698. /**
  6699. * Gets the data for `map`.
  6700. *
  6701. * @private
  6702. * @param {Object} map The map to query.
  6703. * @param {string} key The reference key.
  6704. * @returns {*} Returns the map data.
  6705. */
  6706. function getMapData(map, key) {
  6707. var data = map.__data__;
  6708. return isKeyable(key)
  6709. ? data[typeof key == 'string' ? 'string' : 'hash']
  6710. : data.map;
  6711. }
  6712. /**
  6713. * Gets the property names, values, and compare flags of `object`.
  6714. *
  6715. * @private
  6716. * @param {Object} object The object to query.
  6717. * @returns {Array} Returns the match data of `object`.
  6718. */
  6719. function getMatchData(object) {
  6720. var result = keys(object),
  6721. length = result.length;
  6722. while (length--) {
  6723. var key = result[length],
  6724. value = object[key];
  6725. result[length] = [key, value, isStrictComparable(value)];
  6726. }
  6727. return result;
  6728. }
  6729. /**
  6730. * Gets the native function at `key` of `object`.
  6731. *
  6732. * @private
  6733. * @param {Object} object The object to query.
  6734. * @param {string} key The key of the method to get.
  6735. * @returns {*} Returns the function if it's native, else `undefined`.
  6736. */
  6737. function getNative(object, key) {
  6738. var value = getValue(object, key);
  6739. return baseIsNative(value) ? value : undefined;
  6740. }
  6741. /**
  6742. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6743. *
  6744. * @private
  6745. * @param {*} value The value to query.
  6746. * @returns {string} Returns the raw `toStringTag`.
  6747. */
  6748. function getRawTag(value) {
  6749. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6750. tag = value[symToStringTag];
  6751. try {
  6752. value[symToStringTag] = undefined;
  6753. var unmasked = true;
  6754. } catch (e) {}
  6755. var result = nativeObjectToString.call(value);
  6756. if (unmasked) {
  6757. if (isOwn) {
  6758. value[symToStringTag] = tag;
  6759. } else {
  6760. delete value[symToStringTag];
  6761. }
  6762. }
  6763. return result;
  6764. }
  6765. /**
  6766. * Creates an array of the own enumerable symbols of `object`.
  6767. *
  6768. * @private
  6769. * @param {Object} object The object to query.
  6770. * @returns {Array} Returns the array of symbols.
  6771. */
  6772. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6773. if (object == null) {
  6774. return [];
  6775. }
  6776. object = Object(object);
  6777. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6778. return propertyIsEnumerable.call(object, symbol);
  6779. });
  6780. };
  6781. /**
  6782. * Creates an array of the own and inherited enumerable symbols of `object`.
  6783. *
  6784. * @private
  6785. * @param {Object} object The object to query.
  6786. * @returns {Array} Returns the array of symbols.
  6787. */
  6788. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6789. var result = [];
  6790. while (object) {
  6791. arrayPush(result, getSymbols(object));
  6792. object = getPrototype(object);
  6793. }
  6794. return result;
  6795. };
  6796. /**
  6797. * Gets the `toStringTag` of `value`.
  6798. *
  6799. * @private
  6800. * @param {*} value The value to query.
  6801. * @returns {string} Returns the `toStringTag`.
  6802. */
  6803. var getTag = baseGetTag;
  6804. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6805. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6806. (Map && getTag(new Map) != mapTag) ||
  6807. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6808. (Set && getTag(new Set) != setTag) ||
  6809. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6810. getTag = function(value) {
  6811. var result = baseGetTag(value),
  6812. Ctor = result == objectTag ? value.constructor : undefined,
  6813. ctorString = Ctor ? toSource(Ctor) : '';
  6814. if (ctorString) {
  6815. switch (ctorString) {
  6816. case dataViewCtorString: return dataViewTag;
  6817. case mapCtorString: return mapTag;
  6818. case promiseCtorString: return promiseTag;
  6819. case setCtorString: return setTag;
  6820. case weakMapCtorString: return weakMapTag;
  6821. }
  6822. }
  6823. return result;
  6824. };
  6825. }
  6826. /**
  6827. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6828. *
  6829. * @private
  6830. * @param {number} start The start of the view.
  6831. * @param {number} end The end of the view.
  6832. * @param {Array} transforms The transformations to apply to the view.
  6833. * @returns {Object} Returns an object containing the `start` and `end`
  6834. * positions of the view.
  6835. */
  6836. function getView(start, end, transforms) {
  6837. var index = -1,
  6838. length = transforms.length;
  6839. while (++index < length) {
  6840. var data = transforms[index],
  6841. size = data.size;
  6842. switch (data.type) {
  6843. case 'drop': start += size; break;
  6844. case 'dropRight': end -= size; break;
  6845. case 'take': end = nativeMin(end, start + size); break;
  6846. case 'takeRight': start = nativeMax(start, end - size); break;
  6847. }
  6848. }
  6849. return { 'start': start, 'end': end };
  6850. }
  6851. /**
  6852. * Extracts wrapper details from the `source` body comment.
  6853. *
  6854. * @private
  6855. * @param {string} source The source to inspect.
  6856. * @returns {Array} Returns the wrapper details.
  6857. */
  6858. function getWrapDetails(source) {
  6859. var match = source.match(reWrapDetails);
  6860. return match ? match[1].split(reSplitDetails) : [];
  6861. }
  6862. /**
  6863. * Checks if `path` exists on `object`.
  6864. *
  6865. * @private
  6866. * @param {Object} object The object to query.
  6867. * @param {Array|string} path The path to check.
  6868. * @param {Function} hasFunc The function to check properties.
  6869. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6870. */
  6871. function hasPath(object, path, hasFunc) {
  6872. path = castPath(path, object);
  6873. var index = -1,
  6874. length = path.length,
  6875. result = false;
  6876. while (++index < length) {
  6877. var key = toKey(path[index]);
  6878. if (!(result = object != null && hasFunc(object, key))) {
  6879. break;
  6880. }
  6881. object = object[key];
  6882. }
  6883. if (result || ++index != length) {
  6884. return result;
  6885. }
  6886. length = object == null ? 0 : object.length;
  6887. return !!length && isLength(length) && isIndex(key, length) &&
  6888. (isArray(object) || isArguments(object));
  6889. }
  6890. /**
  6891. * Initializes an array clone.
  6892. *
  6893. * @private
  6894. * @param {Array} array The array to clone.
  6895. * @returns {Array} Returns the initialized clone.
  6896. */
  6897. function initCloneArray(array) {
  6898. var length = array.length,
  6899. result = new array.constructor(length);
  6900. // Add properties assigned by `RegExp#exec`.
  6901. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6902. result.index = array.index;
  6903. result.input = array.input;
  6904. }
  6905. return result;
  6906. }
  6907. /**
  6908. * Initializes an object clone.
  6909. *
  6910. * @private
  6911. * @param {Object} object The object to clone.
  6912. * @returns {Object} Returns the initialized clone.
  6913. */
  6914. function initCloneObject(object) {
  6915. return (typeof object.constructor == 'function' && !isPrototype(object))
  6916. ? baseCreate(getPrototype(object))
  6917. : {};
  6918. }
  6919. /**
  6920. * Initializes an object clone based on its `toStringTag`.
  6921. *
  6922. * **Note:** This function only supports cloning values with tags of
  6923. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6924. *
  6925. * @private
  6926. * @param {Object} object The object to clone.
  6927. * @param {string} tag The `toStringTag` of the object to clone.
  6928. * @param {boolean} [isDeep] Specify a deep clone.
  6929. * @returns {Object} Returns the initialized clone.
  6930. */
  6931. function initCloneByTag(object, tag, isDeep) {
  6932. var Ctor = object.constructor;
  6933. switch (tag) {
  6934. case arrayBufferTag:
  6935. return cloneArrayBuffer(object);
  6936. case boolTag:
  6937. case dateTag:
  6938. return new Ctor(+object);
  6939. case dataViewTag:
  6940. return cloneDataView(object, isDeep);
  6941. case float32Tag: case float64Tag:
  6942. case int8Tag: case int16Tag: case int32Tag:
  6943. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6944. return cloneTypedArray(object, isDeep);
  6945. case mapTag:
  6946. return new Ctor;
  6947. case numberTag:
  6948. case stringTag:
  6949. return new Ctor(object);
  6950. case regexpTag:
  6951. return cloneRegExp(object);
  6952. case setTag:
  6953. return new Ctor;
  6954. case symbolTag:
  6955. return cloneSymbol(object);
  6956. }
  6957. }
  6958. /**
  6959. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6960. *
  6961. * @private
  6962. * @param {string} source The source to modify.
  6963. * @returns {Array} details The details to insert.
  6964. * @returns {string} Returns the modified source.
  6965. */
  6966. function insertWrapDetails(source, details) {
  6967. var length = details.length;
  6968. if (!length) {
  6969. return source;
  6970. }
  6971. var lastIndex = length - 1;
  6972. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6973. details = details.join(length > 2 ? ', ' : ' ');
  6974. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6975. }
  6976. /**
  6977. * Checks if `value` is a flattenable `arguments` object or array.
  6978. *
  6979. * @private
  6980. * @param {*} value The value to check.
  6981. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6982. */
  6983. function isFlattenable(value) {
  6984. return isArray(value) || isArguments(value) ||
  6985. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6986. }
  6987. /**
  6988. * Checks if `value` is a valid array-like index.
  6989. *
  6990. * @private
  6991. * @param {*} value The value to check.
  6992. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6993. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6994. */
  6995. function isIndex(value, length) {
  6996. var type = typeof value;
  6997. length = length == null ? MAX_SAFE_INTEGER : length;
  6998. return !!length &&
  6999. (type == 'number' ||
  7000. (type != 'symbol' && reIsUint.test(value))) &&
  7001. (value > -1 && value % 1 == 0 && value < length);
  7002. }
  7003. /**
  7004. * Checks if the given arguments are from an iteratee call.
  7005. *
  7006. * @private
  7007. * @param {*} value The potential iteratee value argument.
  7008. * @param {*} index The potential iteratee index or key argument.
  7009. * @param {*} object The potential iteratee object argument.
  7010. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7011. * else `false`.
  7012. */
  7013. function isIterateeCall(value, index, object) {
  7014. if (!isObject(object)) {
  7015. return false;
  7016. }
  7017. var type = typeof index;
  7018. if (type == 'number'
  7019. ? (isArrayLike(object) && isIndex(index, object.length))
  7020. : (type == 'string' && index in object)
  7021. ) {
  7022. return eq(object[index], value);
  7023. }
  7024. return false;
  7025. }
  7026. /**
  7027. * Checks if `value` is a property name and not a property path.
  7028. *
  7029. * @private
  7030. * @param {*} value The value to check.
  7031. * @param {Object} [object] The object to query keys on.
  7032. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7033. */
  7034. function isKey(value, object) {
  7035. if (isArray(value)) {
  7036. return false;
  7037. }
  7038. var type = typeof value;
  7039. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7040. value == null || isSymbol(value)) {
  7041. return true;
  7042. }
  7043. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7044. (object != null && value in Object(object));
  7045. }
  7046. /**
  7047. * Checks if `value` is suitable for use as unique object key.
  7048. *
  7049. * @private
  7050. * @param {*} value The value to check.
  7051. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7052. */
  7053. function isKeyable(value) {
  7054. var type = typeof value;
  7055. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7056. ? (value !== '__proto__')
  7057. : (value === null);
  7058. }
  7059. /**
  7060. * Checks if `func` has a lazy counterpart.
  7061. *
  7062. * @private
  7063. * @param {Function} func The function to check.
  7064. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7065. * else `false`.
  7066. */
  7067. function isLaziable(func) {
  7068. var funcName = getFuncName(func),
  7069. other = lodash[funcName];
  7070. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7071. return false;
  7072. }
  7073. if (func === other) {
  7074. return true;
  7075. }
  7076. var data = getData(other);
  7077. return !!data && func === data[0];
  7078. }
  7079. /**
  7080. * Checks if `func` has its source masked.
  7081. *
  7082. * @private
  7083. * @param {Function} func The function to check.
  7084. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7085. */
  7086. function isMasked(func) {
  7087. return !!maskSrcKey && (maskSrcKey in func);
  7088. }
  7089. /**
  7090. * Checks if `func` is capable of being masked.
  7091. *
  7092. * @private
  7093. * @param {*} value The value to check.
  7094. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7095. */
  7096. var isMaskable = coreJsData ? isFunction : stubFalse;
  7097. /**
  7098. * Checks if `value` is likely a prototype object.
  7099. *
  7100. * @private
  7101. * @param {*} value The value to check.
  7102. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7103. */
  7104. function isPrototype(value) {
  7105. var Ctor = value && value.constructor,
  7106. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7107. return value === proto;
  7108. }
  7109. /**
  7110. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7111. *
  7112. * @private
  7113. * @param {*} value The value to check.
  7114. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7115. * equality comparisons, else `false`.
  7116. */
  7117. function isStrictComparable(value) {
  7118. return value === value && !isObject(value);
  7119. }
  7120. /**
  7121. * A specialized version of `matchesProperty` for source values suitable
  7122. * for strict equality comparisons, i.e. `===`.
  7123. *
  7124. * @private
  7125. * @param {string} key The key of the property to get.
  7126. * @param {*} srcValue The value to match.
  7127. * @returns {Function} Returns the new spec function.
  7128. */
  7129. function matchesStrictComparable(key, srcValue) {
  7130. return function(object) {
  7131. if (object == null) {
  7132. return false;
  7133. }
  7134. return object[key] === srcValue &&
  7135. (srcValue !== undefined || (key in Object(object)));
  7136. };
  7137. }
  7138. /**
  7139. * A specialized version of `_.memoize` which clears the memoized function's
  7140. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7141. *
  7142. * @private
  7143. * @param {Function} func The function to have its output memoized.
  7144. * @returns {Function} Returns the new memoized function.
  7145. */
  7146. function memoizeCapped(func) {
  7147. var result = memoize(func, function(key) {
  7148. if (cache.size === MAX_MEMOIZE_SIZE) {
  7149. cache.clear();
  7150. }
  7151. return key;
  7152. });
  7153. var cache = result.cache;
  7154. return result;
  7155. }
  7156. /**
  7157. * Merges the function metadata of `source` into `data`.
  7158. *
  7159. * Merging metadata reduces the number of wrappers used to invoke a function.
  7160. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7161. * may be applied regardless of execution order. Methods like `_.ary` and
  7162. * `_.rearg` modify function arguments, making the order in which they are
  7163. * executed important, preventing the merging of metadata. However, we make
  7164. * an exception for a safe combined case where curried functions have `_.ary`
  7165. * and or `_.rearg` applied.
  7166. *
  7167. * @private
  7168. * @param {Array} data The destination metadata.
  7169. * @param {Array} source The source metadata.
  7170. * @returns {Array} Returns `data`.
  7171. */
  7172. function mergeData(data, source) {
  7173. var bitmask = data[1],
  7174. srcBitmask = source[1],
  7175. newBitmask = bitmask | srcBitmask,
  7176. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7177. var isCombo =
  7178. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7179. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7180. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7181. // Exit early if metadata can't be merged.
  7182. if (!(isCommon || isCombo)) {
  7183. return data;
  7184. }
  7185. // Use source `thisArg` if available.
  7186. if (srcBitmask & WRAP_BIND_FLAG) {
  7187. data[2] = source[2];
  7188. // Set when currying a bound function.
  7189. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7190. }
  7191. // Compose partial arguments.
  7192. var value = source[3];
  7193. if (value) {
  7194. var partials = data[3];
  7195. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7196. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7197. }
  7198. // Compose partial right arguments.
  7199. value = source[5];
  7200. if (value) {
  7201. partials = data[5];
  7202. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7203. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7204. }
  7205. // Use source `argPos` if available.
  7206. value = source[7];
  7207. if (value) {
  7208. data[7] = value;
  7209. }
  7210. // Use source `ary` if it's smaller.
  7211. if (srcBitmask & WRAP_ARY_FLAG) {
  7212. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7213. }
  7214. // Use source `arity` if one is not provided.
  7215. if (data[9] == null) {
  7216. data[9] = source[9];
  7217. }
  7218. // Use source `func` and merge bitmasks.
  7219. data[0] = source[0];
  7220. data[1] = newBitmask;
  7221. return data;
  7222. }
  7223. /**
  7224. * This function is like
  7225. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7226. * except that it includes inherited enumerable properties.
  7227. *
  7228. * @private
  7229. * @param {Object} object The object to query.
  7230. * @returns {Array} Returns the array of property names.
  7231. */
  7232. function nativeKeysIn(object) {
  7233. var result = [];
  7234. if (object != null) {
  7235. for (var key in Object(object)) {
  7236. result.push(key);
  7237. }
  7238. }
  7239. return result;
  7240. }
  7241. /**
  7242. * Converts `value` to a string using `Object.prototype.toString`.
  7243. *
  7244. * @private
  7245. * @param {*} value The value to convert.
  7246. * @returns {string} Returns the converted string.
  7247. */
  7248. function objectToString(value) {
  7249. return nativeObjectToString.call(value);
  7250. }
  7251. /**
  7252. * A specialized version of `baseRest` which transforms the rest array.
  7253. *
  7254. * @private
  7255. * @param {Function} func The function to apply a rest parameter to.
  7256. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7257. * @param {Function} transform The rest array transform.
  7258. * @returns {Function} Returns the new function.
  7259. */
  7260. function overRest(func, start, transform) {
  7261. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7262. return function() {
  7263. var args = arguments,
  7264. index = -1,
  7265. length = nativeMax(args.length - start, 0),
  7266. array = Array(length);
  7267. while (++index < length) {
  7268. array[index] = args[start + index];
  7269. }
  7270. index = -1;
  7271. var otherArgs = Array(start + 1);
  7272. while (++index < start) {
  7273. otherArgs[index] = args[index];
  7274. }
  7275. otherArgs[start] = transform(array);
  7276. return apply(func, this, otherArgs);
  7277. };
  7278. }
  7279. /**
  7280. * Gets the parent value at `path` of `object`.
  7281. *
  7282. * @private
  7283. * @param {Object} object The object to query.
  7284. * @param {Array} path The path to get the parent value of.
  7285. * @returns {*} Returns the parent value.
  7286. */
  7287. function parent(object, path) {
  7288. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7289. }
  7290. /**
  7291. * Reorder `array` according to the specified indexes where the element at
  7292. * the first index is assigned as the first element, the element at
  7293. * the second index is assigned as the second element, and so on.
  7294. *
  7295. * @private
  7296. * @param {Array} array The array to reorder.
  7297. * @param {Array} indexes The arranged array indexes.
  7298. * @returns {Array} Returns `array`.
  7299. */
  7300. function reorder(array, indexes) {
  7301. var arrLength = array.length,
  7302. length = nativeMin(indexes.length, arrLength),
  7303. oldArray = copyArray(array);
  7304. while (length--) {
  7305. var index = indexes[length];
  7306. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7307. }
  7308. return array;
  7309. }
  7310. /**
  7311. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7312. *
  7313. * @private
  7314. * @param {Object} object The object to query.
  7315. * @param {string} key The key of the property to get.
  7316. * @returns {*} Returns the property value.
  7317. */
  7318. function safeGet(object, key) {
  7319. if (key === 'constructor' && typeof object[key] === 'function') {
  7320. return;
  7321. }
  7322. if (key == '__proto__') {
  7323. return;
  7324. }
  7325. return object[key];
  7326. }
  7327. /**
  7328. * Sets metadata for `func`.
  7329. *
  7330. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7331. * period of time, it will trip its breaker and transition to an identity
  7332. * function to avoid garbage collection pauses in V8. See
  7333. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7334. * for more details.
  7335. *
  7336. * @private
  7337. * @param {Function} func The function to associate metadata with.
  7338. * @param {*} data The metadata.
  7339. * @returns {Function} Returns `func`.
  7340. */
  7341. var setData = shortOut(baseSetData);
  7342. /**
  7343. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7344. *
  7345. * @private
  7346. * @param {Function} func The function to delay.
  7347. * @param {number} wait The number of milliseconds to delay invocation.
  7348. * @returns {number|Object} Returns the timer id or timeout object.
  7349. */
  7350. var setTimeout = ctxSetTimeout || function(func, wait) {
  7351. return root.setTimeout(func, wait);
  7352. };
  7353. /**
  7354. * Sets the `toString` method of `func` to return `string`.
  7355. *
  7356. * @private
  7357. * @param {Function} func The function to modify.
  7358. * @param {Function} string The `toString` result.
  7359. * @returns {Function} Returns `func`.
  7360. */
  7361. var setToString = shortOut(baseSetToString);
  7362. /**
  7363. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7364. * with wrapper details in a comment at the top of the source body.
  7365. *
  7366. * @private
  7367. * @param {Function} wrapper The function to modify.
  7368. * @param {Function} reference The reference function.
  7369. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7370. * @returns {Function} Returns `wrapper`.
  7371. */
  7372. function setWrapToString(wrapper, reference, bitmask) {
  7373. var source = (reference + '');
  7374. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7375. }
  7376. /**
  7377. * Creates a function that'll short out and invoke `identity` instead
  7378. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7379. * milliseconds.
  7380. *
  7381. * @private
  7382. * @param {Function} func The function to restrict.
  7383. * @returns {Function} Returns the new shortable function.
  7384. */
  7385. function shortOut(func) {
  7386. var count = 0,
  7387. lastCalled = 0;
  7388. return function() {
  7389. var stamp = nativeNow(),
  7390. remaining = HOT_SPAN - (stamp - lastCalled);
  7391. lastCalled = stamp;
  7392. if (remaining > 0) {
  7393. if (++count >= HOT_COUNT) {
  7394. return arguments[0];
  7395. }
  7396. } else {
  7397. count = 0;
  7398. }
  7399. return func.apply(undefined, arguments);
  7400. };
  7401. }
  7402. /**
  7403. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7404. *
  7405. * @private
  7406. * @param {Array} array The array to shuffle.
  7407. * @param {number} [size=array.length] The size of `array`.
  7408. * @returns {Array} Returns `array`.
  7409. */
  7410. function shuffleSelf(array, size) {
  7411. var index = -1,
  7412. length = array.length,
  7413. lastIndex = length - 1;
  7414. size = size === undefined ? length : size;
  7415. while (++index < size) {
  7416. var rand = baseRandom(index, lastIndex),
  7417. value = array[rand];
  7418. array[rand] = array[index];
  7419. array[index] = value;
  7420. }
  7421. array.length = size;
  7422. return array;
  7423. }
  7424. /**
  7425. * Converts `string` to a property path array.
  7426. *
  7427. * @private
  7428. * @param {string} string The string to convert.
  7429. * @returns {Array} Returns the property path array.
  7430. */
  7431. var stringToPath = memoizeCapped(function(string) {
  7432. var result = [];
  7433. if (string.charCodeAt(0) === 46 /* . */) {
  7434. result.push('');
  7435. }
  7436. string.replace(rePropName, function(match, number, quote, subString) {
  7437. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7438. });
  7439. return result;
  7440. });
  7441. /**
  7442. * Converts `value` to a string key if it's not a string or symbol.
  7443. *
  7444. * @private
  7445. * @param {*} value The value to inspect.
  7446. * @returns {string|symbol} Returns the key.
  7447. */
  7448. function toKey(value) {
  7449. if (typeof value == 'string' || isSymbol(value)) {
  7450. return value;
  7451. }
  7452. var result = (value + '');
  7453. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7454. }
  7455. /**
  7456. * Converts `func` to its source code.
  7457. *
  7458. * @private
  7459. * @param {Function} func The function to convert.
  7460. * @returns {string} Returns the source code.
  7461. */
  7462. function toSource(func) {
  7463. if (func != null) {
  7464. try {
  7465. return funcToString.call(func);
  7466. } catch (e) {}
  7467. try {
  7468. return (func + '');
  7469. } catch (e) {}
  7470. }
  7471. return '';
  7472. }
  7473. /**
  7474. * Updates wrapper `details` based on `bitmask` flags.
  7475. *
  7476. * @private
  7477. * @returns {Array} details The details to modify.
  7478. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7479. * @returns {Array} Returns `details`.
  7480. */
  7481. function updateWrapDetails(details, bitmask) {
  7482. arrayEach(wrapFlags, function(pair) {
  7483. var value = '_.' + pair[0];
  7484. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7485. details.push(value);
  7486. }
  7487. });
  7488. return details.sort();
  7489. }
  7490. /**
  7491. * Creates a clone of `wrapper`.
  7492. *
  7493. * @private
  7494. * @param {Object} wrapper The wrapper to clone.
  7495. * @returns {Object} Returns the cloned wrapper.
  7496. */
  7497. function wrapperClone(wrapper) {
  7498. if (wrapper instanceof LazyWrapper) {
  7499. return wrapper.clone();
  7500. }
  7501. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7502. result.__actions__ = copyArray(wrapper.__actions__);
  7503. result.__index__ = wrapper.__index__;
  7504. result.__values__ = wrapper.__values__;
  7505. return result;
  7506. }
  7507. /*------------------------------------------------------------------------*/
  7508. /**
  7509. * Creates an array of elements split into groups the length of `size`.
  7510. * If `array` can't be split evenly, the final chunk will be the remaining
  7511. * elements.
  7512. *
  7513. * @static
  7514. * @memberOf _
  7515. * @since 3.0.0
  7516. * @category Array
  7517. * @param {Array} array The array to process.
  7518. * @param {number} [size=1] The length of each chunk
  7519. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7520. * @returns {Array} Returns the new array of chunks.
  7521. * @example
  7522. *
  7523. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7524. * // => [['a', 'b'], ['c', 'd']]
  7525. *
  7526. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7527. * // => [['a', 'b', 'c'], ['d']]
  7528. */
  7529. function chunk(array, size, guard) {
  7530. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7531. size = 1;
  7532. } else {
  7533. size = nativeMax(toInteger(size), 0);
  7534. }
  7535. var length = array == null ? 0 : array.length;
  7536. if (!length || size < 1) {
  7537. return [];
  7538. }
  7539. var index = 0,
  7540. resIndex = 0,
  7541. result = Array(nativeCeil(length / size));
  7542. while (index < length) {
  7543. result[resIndex++] = baseSlice(array, index, (index += size));
  7544. }
  7545. return result;
  7546. }
  7547. /**
  7548. * Creates an array with all falsey values removed. The values `false`, `null`,
  7549. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7550. *
  7551. * @static
  7552. * @memberOf _
  7553. * @since 0.1.0
  7554. * @category Array
  7555. * @param {Array} array The array to compact.
  7556. * @returns {Array} Returns the new array of filtered values.
  7557. * @example
  7558. *
  7559. * _.compact([0, 1, false, 2, '', 3]);
  7560. * // => [1, 2, 3]
  7561. */
  7562. function compact(array) {
  7563. var index = -1,
  7564. length = array == null ? 0 : array.length,
  7565. resIndex = 0,
  7566. result = [];
  7567. while (++index < length) {
  7568. var value = array[index];
  7569. if (value) {
  7570. result[resIndex++] = value;
  7571. }
  7572. }
  7573. return result;
  7574. }
  7575. /**
  7576. * Creates a new array concatenating `array` with any additional arrays
  7577. * and/or values.
  7578. *
  7579. * @static
  7580. * @memberOf _
  7581. * @since 4.0.0
  7582. * @category Array
  7583. * @param {Array} array The array to concatenate.
  7584. * @param {...*} [values] The values to concatenate.
  7585. * @returns {Array} Returns the new concatenated array.
  7586. * @example
  7587. *
  7588. * var array = [1];
  7589. * var other = _.concat(array, 2, [3], [[4]]);
  7590. *
  7591. * console.log(other);
  7592. * // => [1, 2, 3, [4]]
  7593. *
  7594. * console.log(array);
  7595. * // => [1]
  7596. */
  7597. function concat() {
  7598. var length = arguments.length;
  7599. if (!length) {
  7600. return [];
  7601. }
  7602. var args = Array(length - 1),
  7603. array = arguments[0],
  7604. index = length;
  7605. while (index--) {
  7606. args[index - 1] = arguments[index];
  7607. }
  7608. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7609. }
  7610. /**
  7611. * Creates an array of `array` values not included in the other given arrays
  7612. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7613. * for equality comparisons. The order and references of result values are
  7614. * determined by the first array.
  7615. *
  7616. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7617. *
  7618. * @static
  7619. * @memberOf _
  7620. * @since 0.1.0
  7621. * @category Array
  7622. * @param {Array} array The array to inspect.
  7623. * @param {...Array} [values] The values to exclude.
  7624. * @returns {Array} Returns the new array of filtered values.
  7625. * @see _.without, _.xor
  7626. * @example
  7627. *
  7628. * _.difference([2, 1], [2, 3]);
  7629. * // => [1]
  7630. */
  7631. var difference = baseRest(function(array, values) {
  7632. return isArrayLikeObject(array)
  7633. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7634. : [];
  7635. });
  7636. /**
  7637. * This method is like `_.difference` except that it accepts `iteratee` which
  7638. * is invoked for each element of `array` and `values` to generate the criterion
  7639. * by which they're compared. The order and references of result values are
  7640. * determined by the first array. The iteratee is invoked with one argument:
  7641. * (value).
  7642. *
  7643. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7644. *
  7645. * @static
  7646. * @memberOf _
  7647. * @since 4.0.0
  7648. * @category Array
  7649. * @param {Array} array The array to inspect.
  7650. * @param {...Array} [values] The values to exclude.
  7651. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7652. * @returns {Array} Returns the new array of filtered values.
  7653. * @example
  7654. *
  7655. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7656. * // => [1.2]
  7657. *
  7658. * // The `_.property` iteratee shorthand.
  7659. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7660. * // => [{ 'x': 2 }]
  7661. */
  7662. var differenceBy = baseRest(function(array, values) {
  7663. var iteratee = last(values);
  7664. if (isArrayLikeObject(iteratee)) {
  7665. iteratee = undefined;
  7666. }
  7667. return isArrayLikeObject(array)
  7668. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7669. : [];
  7670. });
  7671. /**
  7672. * This method is like `_.difference` except that it accepts `comparator`
  7673. * which is invoked to compare elements of `array` to `values`. The order and
  7674. * references of result values are determined by the first array. The comparator
  7675. * is invoked with two arguments: (arrVal, othVal).
  7676. *
  7677. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7678. *
  7679. * @static
  7680. * @memberOf _
  7681. * @since 4.0.0
  7682. * @category Array
  7683. * @param {Array} array The array to inspect.
  7684. * @param {...Array} [values] The values to exclude.
  7685. * @param {Function} [comparator] The comparator invoked per element.
  7686. * @returns {Array} Returns the new array of filtered values.
  7687. * @example
  7688. *
  7689. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7690. *
  7691. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7692. * // => [{ 'x': 2, 'y': 1 }]
  7693. */
  7694. var differenceWith = baseRest(function(array, values) {
  7695. var comparator = last(values);
  7696. if (isArrayLikeObject(comparator)) {
  7697. comparator = undefined;
  7698. }
  7699. return isArrayLikeObject(array)
  7700. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7701. : [];
  7702. });
  7703. /**
  7704. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7705. *
  7706. * @static
  7707. * @memberOf _
  7708. * @since 0.5.0
  7709. * @category Array
  7710. * @param {Array} array The array to query.
  7711. * @param {number} [n=1] The number of elements to drop.
  7712. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7713. * @returns {Array} Returns the slice of `array`.
  7714. * @example
  7715. *
  7716. * _.drop([1, 2, 3]);
  7717. * // => [2, 3]
  7718. *
  7719. * _.drop([1, 2, 3], 2);
  7720. * // => [3]
  7721. *
  7722. * _.drop([1, 2, 3], 5);
  7723. * // => []
  7724. *
  7725. * _.drop([1, 2, 3], 0);
  7726. * // => [1, 2, 3]
  7727. */
  7728. function drop(array, n, guard) {
  7729. var length = array == null ? 0 : array.length;
  7730. if (!length) {
  7731. return [];
  7732. }
  7733. n = (guard || n === undefined) ? 1 : toInteger(n);
  7734. return baseSlice(array, n < 0 ? 0 : n, length);
  7735. }
  7736. /**
  7737. * Creates a slice of `array` with `n` elements dropped from the end.
  7738. *
  7739. * @static
  7740. * @memberOf _
  7741. * @since 3.0.0
  7742. * @category Array
  7743. * @param {Array} array The array to query.
  7744. * @param {number} [n=1] The number of elements to drop.
  7745. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7746. * @returns {Array} Returns the slice of `array`.
  7747. * @example
  7748. *
  7749. * _.dropRight([1, 2, 3]);
  7750. * // => [1, 2]
  7751. *
  7752. * _.dropRight([1, 2, 3], 2);
  7753. * // => [1]
  7754. *
  7755. * _.dropRight([1, 2, 3], 5);
  7756. * // => []
  7757. *
  7758. * _.dropRight([1, 2, 3], 0);
  7759. * // => [1, 2, 3]
  7760. */
  7761. function dropRight(array, n, guard) {
  7762. var length = array == null ? 0 : array.length;
  7763. if (!length) {
  7764. return [];
  7765. }
  7766. n = (guard || n === undefined) ? 1 : toInteger(n);
  7767. n = length - n;
  7768. return baseSlice(array, 0, n < 0 ? 0 : n);
  7769. }
  7770. /**
  7771. * Creates a slice of `array` excluding elements dropped from the end.
  7772. * Elements are dropped until `predicate` returns falsey. The predicate is
  7773. * invoked with three arguments: (value, index, array).
  7774. *
  7775. * @static
  7776. * @memberOf _
  7777. * @since 3.0.0
  7778. * @category Array
  7779. * @param {Array} array The array to query.
  7780. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7781. * @returns {Array} Returns the slice of `array`.
  7782. * @example
  7783. *
  7784. * var users = [
  7785. * { 'user': 'barney', 'active': true },
  7786. * { 'user': 'fred', 'active': false },
  7787. * { 'user': 'pebbles', 'active': false }
  7788. * ];
  7789. *
  7790. * _.dropRightWhile(users, function(o) { return !o.active; });
  7791. * // => objects for ['barney']
  7792. *
  7793. * // The `_.matches` iteratee shorthand.
  7794. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7795. * // => objects for ['barney', 'fred']
  7796. *
  7797. * // The `_.matchesProperty` iteratee shorthand.
  7798. * _.dropRightWhile(users, ['active', false]);
  7799. * // => objects for ['barney']
  7800. *
  7801. * // The `_.property` iteratee shorthand.
  7802. * _.dropRightWhile(users, 'active');
  7803. * // => objects for ['barney', 'fred', 'pebbles']
  7804. */
  7805. function dropRightWhile(array, predicate) {
  7806. return (array && array.length)
  7807. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7808. : [];
  7809. }
  7810. /**
  7811. * Creates a slice of `array` excluding elements dropped from the beginning.
  7812. * Elements are dropped until `predicate` returns falsey. The predicate is
  7813. * invoked with three arguments: (value, index, array).
  7814. *
  7815. * @static
  7816. * @memberOf _
  7817. * @since 3.0.0
  7818. * @category Array
  7819. * @param {Array} array The array to query.
  7820. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7821. * @returns {Array} Returns the slice of `array`.
  7822. * @example
  7823. *
  7824. * var users = [
  7825. * { 'user': 'barney', 'active': false },
  7826. * { 'user': 'fred', 'active': false },
  7827. * { 'user': 'pebbles', 'active': true }
  7828. * ];
  7829. *
  7830. * _.dropWhile(users, function(o) { return !o.active; });
  7831. * // => objects for ['pebbles']
  7832. *
  7833. * // The `_.matches` iteratee shorthand.
  7834. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7835. * // => objects for ['fred', 'pebbles']
  7836. *
  7837. * // The `_.matchesProperty` iteratee shorthand.
  7838. * _.dropWhile(users, ['active', false]);
  7839. * // => objects for ['pebbles']
  7840. *
  7841. * // The `_.property` iteratee shorthand.
  7842. * _.dropWhile(users, 'active');
  7843. * // => objects for ['barney', 'fred', 'pebbles']
  7844. */
  7845. function dropWhile(array, predicate) {
  7846. return (array && array.length)
  7847. ? baseWhile(array, getIteratee(predicate, 3), true)
  7848. : [];
  7849. }
  7850. /**
  7851. * Fills elements of `array` with `value` from `start` up to, but not
  7852. * including, `end`.
  7853. *
  7854. * **Note:** This method mutates `array`.
  7855. *
  7856. * @static
  7857. * @memberOf _
  7858. * @since 3.2.0
  7859. * @category Array
  7860. * @param {Array} array The array to fill.
  7861. * @param {*} value The value to fill `array` with.
  7862. * @param {number} [start=0] The start position.
  7863. * @param {number} [end=array.length] The end position.
  7864. * @returns {Array} Returns `array`.
  7865. * @example
  7866. *
  7867. * var array = [1, 2, 3];
  7868. *
  7869. * _.fill(array, 'a');
  7870. * console.log(array);
  7871. * // => ['a', 'a', 'a']
  7872. *
  7873. * _.fill(Array(3), 2);
  7874. * // => [2, 2, 2]
  7875. *
  7876. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7877. * // => [4, '*', '*', 10]
  7878. */
  7879. function fill(array, value, start, end) {
  7880. var length = array == null ? 0 : array.length;
  7881. if (!length) {
  7882. return [];
  7883. }
  7884. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7885. start = 0;
  7886. end = length;
  7887. }
  7888. return baseFill(array, value, start, end);
  7889. }
  7890. /**
  7891. * This method is like `_.find` except that it returns the index of the first
  7892. * element `predicate` returns truthy for instead of the element itself.
  7893. *
  7894. * @static
  7895. * @memberOf _
  7896. * @since 1.1.0
  7897. * @category Array
  7898. * @param {Array} array The array to inspect.
  7899. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7900. * @param {number} [fromIndex=0] The index to search from.
  7901. * @returns {number} Returns the index of the found element, else `-1`.
  7902. * @example
  7903. *
  7904. * var users = [
  7905. * { 'user': 'barney', 'active': false },
  7906. * { 'user': 'fred', 'active': false },
  7907. * { 'user': 'pebbles', 'active': true }
  7908. * ];
  7909. *
  7910. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7911. * // => 0
  7912. *
  7913. * // The `_.matches` iteratee shorthand.
  7914. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7915. * // => 1
  7916. *
  7917. * // The `_.matchesProperty` iteratee shorthand.
  7918. * _.findIndex(users, ['active', false]);
  7919. * // => 0
  7920. *
  7921. * // The `_.property` iteratee shorthand.
  7922. * _.findIndex(users, 'active');
  7923. * // => 2
  7924. */
  7925. function findIndex(array, predicate, fromIndex) {
  7926. var length = array == null ? 0 : array.length;
  7927. if (!length) {
  7928. return -1;
  7929. }
  7930. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7931. if (index < 0) {
  7932. index = nativeMax(length + index, 0);
  7933. }
  7934. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7935. }
  7936. /**
  7937. * This method is like `_.findIndex` except that it iterates over elements
  7938. * of `collection` from right to left.
  7939. *
  7940. * @static
  7941. * @memberOf _
  7942. * @since 2.0.0
  7943. * @category Array
  7944. * @param {Array} array The array to inspect.
  7945. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7946. * @param {number} [fromIndex=array.length-1] The index to search from.
  7947. * @returns {number} Returns the index of the found element, else `-1`.
  7948. * @example
  7949. *
  7950. * var users = [
  7951. * { 'user': 'barney', 'active': true },
  7952. * { 'user': 'fred', 'active': false },
  7953. * { 'user': 'pebbles', 'active': false }
  7954. * ];
  7955. *
  7956. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7957. * // => 2
  7958. *
  7959. * // The `_.matches` iteratee shorthand.
  7960. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7961. * // => 0
  7962. *
  7963. * // The `_.matchesProperty` iteratee shorthand.
  7964. * _.findLastIndex(users, ['active', false]);
  7965. * // => 2
  7966. *
  7967. * // The `_.property` iteratee shorthand.
  7968. * _.findLastIndex(users, 'active');
  7969. * // => 0
  7970. */
  7971. function findLastIndex(array, predicate, fromIndex) {
  7972. var length = array == null ? 0 : array.length;
  7973. if (!length) {
  7974. return -1;
  7975. }
  7976. var index = length - 1;
  7977. if (fromIndex !== undefined) {
  7978. index = toInteger(fromIndex);
  7979. index = fromIndex < 0
  7980. ? nativeMax(length + index, 0)
  7981. : nativeMin(index, length - 1);
  7982. }
  7983. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7984. }
  7985. /**
  7986. * Flattens `array` a single level deep.
  7987. *
  7988. * @static
  7989. * @memberOf _
  7990. * @since 0.1.0
  7991. * @category Array
  7992. * @param {Array} array The array to flatten.
  7993. * @returns {Array} Returns the new flattened array.
  7994. * @example
  7995. *
  7996. * _.flatten([1, [2, [3, [4]], 5]]);
  7997. * // => [1, 2, [3, [4]], 5]
  7998. */
  7999. function flatten(array) {
  8000. var length = array == null ? 0 : array.length;
  8001. return length ? baseFlatten(array, 1) : [];
  8002. }
  8003. /**
  8004. * Recursively flattens `array`.
  8005. *
  8006. * @static
  8007. * @memberOf _
  8008. * @since 3.0.0
  8009. * @category Array
  8010. * @param {Array} array The array to flatten.
  8011. * @returns {Array} Returns the new flattened array.
  8012. * @example
  8013. *
  8014. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8015. * // => [1, 2, 3, 4, 5]
  8016. */
  8017. function flattenDeep(array) {
  8018. var length = array == null ? 0 : array.length;
  8019. return length ? baseFlatten(array, INFINITY) : [];
  8020. }
  8021. /**
  8022. * Recursively flatten `array` up to `depth` times.
  8023. *
  8024. * @static
  8025. * @memberOf _
  8026. * @since 4.4.0
  8027. * @category Array
  8028. * @param {Array} array The array to flatten.
  8029. * @param {number} [depth=1] The maximum recursion depth.
  8030. * @returns {Array} Returns the new flattened array.
  8031. * @example
  8032. *
  8033. * var array = [1, [2, [3, [4]], 5]];
  8034. *
  8035. * _.flattenDepth(array, 1);
  8036. * // => [1, 2, [3, [4]], 5]
  8037. *
  8038. * _.flattenDepth(array, 2);
  8039. * // => [1, 2, 3, [4], 5]
  8040. */
  8041. function flattenDepth(array, depth) {
  8042. var length = array == null ? 0 : array.length;
  8043. if (!length) {
  8044. return [];
  8045. }
  8046. depth = depth === undefined ? 1 : toInteger(depth);
  8047. return baseFlatten(array, depth);
  8048. }
  8049. /**
  8050. * The inverse of `_.toPairs`; this method returns an object composed
  8051. * from key-value `pairs`.
  8052. *
  8053. * @static
  8054. * @memberOf _
  8055. * @since 4.0.0
  8056. * @category Array
  8057. * @param {Array} pairs The key-value pairs.
  8058. * @returns {Object} Returns the new object.
  8059. * @example
  8060. *
  8061. * _.fromPairs([['a', 1], ['b', 2]]);
  8062. * // => { 'a': 1, 'b': 2 }
  8063. */
  8064. function fromPairs(pairs) {
  8065. var index = -1,
  8066. length = pairs == null ? 0 : pairs.length,
  8067. result = {};
  8068. while (++index < length) {
  8069. var pair = pairs[index];
  8070. result[pair[0]] = pair[1];
  8071. }
  8072. return result;
  8073. }
  8074. /**
  8075. * Gets the first element of `array`.
  8076. *
  8077. * @static
  8078. * @memberOf _
  8079. * @since 0.1.0
  8080. * @alias first
  8081. * @category Array
  8082. * @param {Array} array The array to query.
  8083. * @returns {*} Returns the first element of `array`.
  8084. * @example
  8085. *
  8086. * _.head([1, 2, 3]);
  8087. * // => 1
  8088. *
  8089. * _.head([]);
  8090. * // => undefined
  8091. */
  8092. function head(array) {
  8093. return (array && array.length) ? array[0] : undefined;
  8094. }
  8095. /**
  8096. * Gets the index at which the first occurrence of `value` is found in `array`
  8097. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8098. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8099. * offset from the end of `array`.
  8100. *
  8101. * @static
  8102. * @memberOf _
  8103. * @since 0.1.0
  8104. * @category Array
  8105. * @param {Array} array The array to inspect.
  8106. * @param {*} value The value to search for.
  8107. * @param {number} [fromIndex=0] The index to search from.
  8108. * @returns {number} Returns the index of the matched value, else `-1`.
  8109. * @example
  8110. *
  8111. * _.indexOf([1, 2, 1, 2], 2);
  8112. * // => 1
  8113. *
  8114. * // Search from the `fromIndex`.
  8115. * _.indexOf([1, 2, 1, 2], 2, 2);
  8116. * // => 3
  8117. */
  8118. function indexOf(array, value, fromIndex) {
  8119. var length = array == null ? 0 : array.length;
  8120. if (!length) {
  8121. return -1;
  8122. }
  8123. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8124. if (index < 0) {
  8125. index = nativeMax(length + index, 0);
  8126. }
  8127. return baseIndexOf(array, value, index);
  8128. }
  8129. /**
  8130. * Gets all but the last element of `array`.
  8131. *
  8132. * @static
  8133. * @memberOf _
  8134. * @since 0.1.0
  8135. * @category Array
  8136. * @param {Array} array The array to query.
  8137. * @returns {Array} Returns the slice of `array`.
  8138. * @example
  8139. *
  8140. * _.initial([1, 2, 3]);
  8141. * // => [1, 2]
  8142. */
  8143. function initial(array) {
  8144. var length = array == null ? 0 : array.length;
  8145. return length ? baseSlice(array, 0, -1) : [];
  8146. }
  8147. /**
  8148. * Creates an array of unique values that are included in all given arrays
  8149. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8150. * for equality comparisons. The order and references of result values are
  8151. * determined by the first array.
  8152. *
  8153. * @static
  8154. * @memberOf _
  8155. * @since 0.1.0
  8156. * @category Array
  8157. * @param {...Array} [arrays] The arrays to inspect.
  8158. * @returns {Array} Returns the new array of intersecting values.
  8159. * @example
  8160. *
  8161. * _.intersection([2, 1], [2, 3]);
  8162. * // => [2]
  8163. */
  8164. var intersection = baseRest(function(arrays) {
  8165. var mapped = arrayMap(arrays, castArrayLikeObject);
  8166. return (mapped.length && mapped[0] === arrays[0])
  8167. ? baseIntersection(mapped)
  8168. : [];
  8169. });
  8170. /**
  8171. * This method is like `_.intersection` except that it accepts `iteratee`
  8172. * which is invoked for each element of each `arrays` to generate the criterion
  8173. * by which they're compared. The order and references of result values are
  8174. * determined by the first array. The iteratee is invoked with one argument:
  8175. * (value).
  8176. *
  8177. * @static
  8178. * @memberOf _
  8179. * @since 4.0.0
  8180. * @category Array
  8181. * @param {...Array} [arrays] The arrays to inspect.
  8182. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8183. * @returns {Array} Returns the new array of intersecting values.
  8184. * @example
  8185. *
  8186. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8187. * // => [2.1]
  8188. *
  8189. * // The `_.property` iteratee shorthand.
  8190. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8191. * // => [{ 'x': 1 }]
  8192. */
  8193. var intersectionBy = baseRest(function(arrays) {
  8194. var iteratee = last(arrays),
  8195. mapped = arrayMap(arrays, castArrayLikeObject);
  8196. if (iteratee === last(mapped)) {
  8197. iteratee = undefined;
  8198. } else {
  8199. mapped.pop();
  8200. }
  8201. return (mapped.length && mapped[0] === arrays[0])
  8202. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8203. : [];
  8204. });
  8205. /**
  8206. * This method is like `_.intersection` except that it accepts `comparator`
  8207. * which is invoked to compare elements of `arrays`. The order and references
  8208. * of result values are determined by the first array. The comparator is
  8209. * invoked with two arguments: (arrVal, othVal).
  8210. *
  8211. * @static
  8212. * @memberOf _
  8213. * @since 4.0.0
  8214. * @category Array
  8215. * @param {...Array} [arrays] The arrays to inspect.
  8216. * @param {Function} [comparator] The comparator invoked per element.
  8217. * @returns {Array} Returns the new array of intersecting values.
  8218. * @example
  8219. *
  8220. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8221. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8222. *
  8223. * _.intersectionWith(objects, others, _.isEqual);
  8224. * // => [{ 'x': 1, 'y': 2 }]
  8225. */
  8226. var intersectionWith = baseRest(function(arrays) {
  8227. var comparator = last(arrays),
  8228. mapped = arrayMap(arrays, castArrayLikeObject);
  8229. comparator = typeof comparator == 'function' ? comparator : undefined;
  8230. if (comparator) {
  8231. mapped.pop();
  8232. }
  8233. return (mapped.length && mapped[0] === arrays[0])
  8234. ? baseIntersection(mapped, undefined, comparator)
  8235. : [];
  8236. });
  8237. /**
  8238. * Converts all elements in `array` into a string separated by `separator`.
  8239. *
  8240. * @static
  8241. * @memberOf _
  8242. * @since 4.0.0
  8243. * @category Array
  8244. * @param {Array} array The array to convert.
  8245. * @param {string} [separator=','] The element separator.
  8246. * @returns {string} Returns the joined string.
  8247. * @example
  8248. *
  8249. * _.join(['a', 'b', 'c'], '~');
  8250. * // => 'a~b~c'
  8251. */
  8252. function join(array, separator) {
  8253. return array == null ? '' : nativeJoin.call(array, separator);
  8254. }
  8255. /**
  8256. * Gets the last element of `array`.
  8257. *
  8258. * @static
  8259. * @memberOf _
  8260. * @since 0.1.0
  8261. * @category Array
  8262. * @param {Array} array The array to query.
  8263. * @returns {*} Returns the last element of `array`.
  8264. * @example
  8265. *
  8266. * _.last([1, 2, 3]);
  8267. * // => 3
  8268. */
  8269. function last(array) {
  8270. var length = array == null ? 0 : array.length;
  8271. return length ? array[length - 1] : undefined;
  8272. }
  8273. /**
  8274. * This method is like `_.indexOf` except that it iterates over elements of
  8275. * `array` from right to left.
  8276. *
  8277. * @static
  8278. * @memberOf _
  8279. * @since 0.1.0
  8280. * @category Array
  8281. * @param {Array} array The array to inspect.
  8282. * @param {*} value The value to search for.
  8283. * @param {number} [fromIndex=array.length-1] The index to search from.
  8284. * @returns {number} Returns the index of the matched value, else `-1`.
  8285. * @example
  8286. *
  8287. * _.lastIndexOf([1, 2, 1, 2], 2);
  8288. * // => 3
  8289. *
  8290. * // Search from the `fromIndex`.
  8291. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8292. * // => 1
  8293. */
  8294. function lastIndexOf(array, value, fromIndex) {
  8295. var length = array == null ? 0 : array.length;
  8296. if (!length) {
  8297. return -1;
  8298. }
  8299. var index = length;
  8300. if (fromIndex !== undefined) {
  8301. index = toInteger(fromIndex);
  8302. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8303. }
  8304. return value === value
  8305. ? strictLastIndexOf(array, value, index)
  8306. : baseFindIndex(array, baseIsNaN, index, true);
  8307. }
  8308. /**
  8309. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8310. * element from the end is returned.
  8311. *
  8312. * @static
  8313. * @memberOf _
  8314. * @since 4.11.0
  8315. * @category Array
  8316. * @param {Array} array The array to query.
  8317. * @param {number} [n=0] The index of the element to return.
  8318. * @returns {*} Returns the nth element of `array`.
  8319. * @example
  8320. *
  8321. * var array = ['a', 'b', 'c', 'd'];
  8322. *
  8323. * _.nth(array, 1);
  8324. * // => 'b'
  8325. *
  8326. * _.nth(array, -2);
  8327. * // => 'c';
  8328. */
  8329. function nth(array, n) {
  8330. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8331. }
  8332. /**
  8333. * Removes all given values from `array` using
  8334. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8335. * for equality comparisons.
  8336. *
  8337. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8338. * to remove elements from an array by predicate.
  8339. *
  8340. * @static
  8341. * @memberOf _
  8342. * @since 2.0.0
  8343. * @category Array
  8344. * @param {Array} array The array to modify.
  8345. * @param {...*} [values] The values to remove.
  8346. * @returns {Array} Returns `array`.
  8347. * @example
  8348. *
  8349. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8350. *
  8351. * _.pull(array, 'a', 'c');
  8352. * console.log(array);
  8353. * // => ['b', 'b']
  8354. */
  8355. var pull = baseRest(pullAll);
  8356. /**
  8357. * This method is like `_.pull` except that it accepts an array of values to remove.
  8358. *
  8359. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8360. *
  8361. * @static
  8362. * @memberOf _
  8363. * @since 4.0.0
  8364. * @category Array
  8365. * @param {Array} array The array to modify.
  8366. * @param {Array} values The values to remove.
  8367. * @returns {Array} Returns `array`.
  8368. * @example
  8369. *
  8370. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8371. *
  8372. * _.pullAll(array, ['a', 'c']);
  8373. * console.log(array);
  8374. * // => ['b', 'b']
  8375. */
  8376. function pullAll(array, values) {
  8377. return (array && array.length && values && values.length)
  8378. ? basePullAll(array, values)
  8379. : array;
  8380. }
  8381. /**
  8382. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8383. * invoked for each element of `array` and `values` to generate the criterion
  8384. * by which they're compared. The iteratee is invoked with one argument: (value).
  8385. *
  8386. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8387. *
  8388. * @static
  8389. * @memberOf _
  8390. * @since 4.0.0
  8391. * @category Array
  8392. * @param {Array} array The array to modify.
  8393. * @param {Array} values The values to remove.
  8394. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8395. * @returns {Array} Returns `array`.
  8396. * @example
  8397. *
  8398. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8399. *
  8400. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8401. * console.log(array);
  8402. * // => [{ 'x': 2 }]
  8403. */
  8404. function pullAllBy(array, values, iteratee) {
  8405. return (array && array.length && values && values.length)
  8406. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8407. : array;
  8408. }
  8409. /**
  8410. * This method is like `_.pullAll` except that it accepts `comparator` which
  8411. * is invoked to compare elements of `array` to `values`. The comparator is
  8412. * invoked with two arguments: (arrVal, othVal).
  8413. *
  8414. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8415. *
  8416. * @static
  8417. * @memberOf _
  8418. * @since 4.6.0
  8419. * @category Array
  8420. * @param {Array} array The array to modify.
  8421. * @param {Array} values The values to remove.
  8422. * @param {Function} [comparator] The comparator invoked per element.
  8423. * @returns {Array} Returns `array`.
  8424. * @example
  8425. *
  8426. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8427. *
  8428. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8429. * console.log(array);
  8430. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8431. */
  8432. function pullAllWith(array, values, comparator) {
  8433. return (array && array.length && values && values.length)
  8434. ? basePullAll(array, values, undefined, comparator)
  8435. : array;
  8436. }
  8437. /**
  8438. * Removes elements from `array` corresponding to `indexes` and returns an
  8439. * array of removed elements.
  8440. *
  8441. * **Note:** Unlike `_.at`, this method mutates `array`.
  8442. *
  8443. * @static
  8444. * @memberOf _
  8445. * @since 3.0.0
  8446. * @category Array
  8447. * @param {Array} array The array to modify.
  8448. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8449. * @returns {Array} Returns the new array of removed elements.
  8450. * @example
  8451. *
  8452. * var array = ['a', 'b', 'c', 'd'];
  8453. * var pulled = _.pullAt(array, [1, 3]);
  8454. *
  8455. * console.log(array);
  8456. * // => ['a', 'c']
  8457. *
  8458. * console.log(pulled);
  8459. * // => ['b', 'd']
  8460. */
  8461. var pullAt = flatRest(function(array, indexes) {
  8462. var length = array == null ? 0 : array.length,
  8463. result = baseAt(array, indexes);
  8464. basePullAt(array, arrayMap(indexes, function(index) {
  8465. return isIndex(index, length) ? +index : index;
  8466. }).sort(compareAscending));
  8467. return result;
  8468. });
  8469. /**
  8470. * Removes all elements from `array` that `predicate` returns truthy for
  8471. * and returns an array of the removed elements. The predicate is invoked
  8472. * with three arguments: (value, index, array).
  8473. *
  8474. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8475. * to pull elements from an array by value.
  8476. *
  8477. * @static
  8478. * @memberOf _
  8479. * @since 2.0.0
  8480. * @category Array
  8481. * @param {Array} array The array to modify.
  8482. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8483. * @returns {Array} Returns the new array of removed elements.
  8484. * @example
  8485. *
  8486. * var array = [1, 2, 3, 4];
  8487. * var evens = _.remove(array, function(n) {
  8488. * return n % 2 == 0;
  8489. * });
  8490. *
  8491. * console.log(array);
  8492. * // => [1, 3]
  8493. *
  8494. * console.log(evens);
  8495. * // => [2, 4]
  8496. */
  8497. function remove(array, predicate) {
  8498. var result = [];
  8499. if (!(array && array.length)) {
  8500. return result;
  8501. }
  8502. var index = -1,
  8503. indexes = [],
  8504. length = array.length;
  8505. predicate = getIteratee(predicate, 3);
  8506. while (++index < length) {
  8507. var value = array[index];
  8508. if (predicate(value, index, array)) {
  8509. result.push(value);
  8510. indexes.push(index);
  8511. }
  8512. }
  8513. basePullAt(array, indexes);
  8514. return result;
  8515. }
  8516. /**
  8517. * Reverses `array` so that the first element becomes the last, the second
  8518. * element becomes the second to last, and so on.
  8519. *
  8520. * **Note:** This method mutates `array` and is based on
  8521. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8522. *
  8523. * @static
  8524. * @memberOf _
  8525. * @since 4.0.0
  8526. * @category Array
  8527. * @param {Array} array The array to modify.
  8528. * @returns {Array} Returns `array`.
  8529. * @example
  8530. *
  8531. * var array = [1, 2, 3];
  8532. *
  8533. * _.reverse(array);
  8534. * // => [3, 2, 1]
  8535. *
  8536. * console.log(array);
  8537. * // => [3, 2, 1]
  8538. */
  8539. function reverse(array) {
  8540. return array == null ? array : nativeReverse.call(array);
  8541. }
  8542. /**
  8543. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8544. *
  8545. * **Note:** This method is used instead of
  8546. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8547. * returned.
  8548. *
  8549. * @static
  8550. * @memberOf _
  8551. * @since 3.0.0
  8552. * @category Array
  8553. * @param {Array} array The array to slice.
  8554. * @param {number} [start=0] The start position.
  8555. * @param {number} [end=array.length] The end position.
  8556. * @returns {Array} Returns the slice of `array`.
  8557. */
  8558. function slice(array, start, end) {
  8559. var length = array == null ? 0 : array.length;
  8560. if (!length) {
  8561. return [];
  8562. }
  8563. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8564. start = 0;
  8565. end = length;
  8566. }
  8567. else {
  8568. start = start == null ? 0 : toInteger(start);
  8569. end = end === undefined ? length : toInteger(end);
  8570. }
  8571. return baseSlice(array, start, end);
  8572. }
  8573. /**
  8574. * Uses a binary search to determine the lowest index at which `value`
  8575. * should be inserted into `array` in order to maintain its sort order.
  8576. *
  8577. * @static
  8578. * @memberOf _
  8579. * @since 0.1.0
  8580. * @category Array
  8581. * @param {Array} array The sorted array to inspect.
  8582. * @param {*} value The value to evaluate.
  8583. * @returns {number} Returns the index at which `value` should be inserted
  8584. * into `array`.
  8585. * @example
  8586. *
  8587. * _.sortedIndex([30, 50], 40);
  8588. * // => 1
  8589. */
  8590. function sortedIndex(array, value) {
  8591. return baseSortedIndex(array, value);
  8592. }
  8593. /**
  8594. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8595. * which is invoked for `value` and each element of `array` to compute their
  8596. * sort ranking. The iteratee is invoked with one argument: (value).
  8597. *
  8598. * @static
  8599. * @memberOf _
  8600. * @since 4.0.0
  8601. * @category Array
  8602. * @param {Array} array The sorted array to inspect.
  8603. * @param {*} value The value to evaluate.
  8604. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8605. * @returns {number} Returns the index at which `value` should be inserted
  8606. * into `array`.
  8607. * @example
  8608. *
  8609. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8610. *
  8611. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8612. * // => 0
  8613. *
  8614. * // The `_.property` iteratee shorthand.
  8615. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8616. * // => 0
  8617. */
  8618. function sortedIndexBy(array, value, iteratee) {
  8619. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8620. }
  8621. /**
  8622. * This method is like `_.indexOf` except that it performs a binary
  8623. * search on a sorted `array`.
  8624. *
  8625. * @static
  8626. * @memberOf _
  8627. * @since 4.0.0
  8628. * @category Array
  8629. * @param {Array} array The array to inspect.
  8630. * @param {*} value The value to search for.
  8631. * @returns {number} Returns the index of the matched value, else `-1`.
  8632. * @example
  8633. *
  8634. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8635. * // => 1
  8636. */
  8637. function sortedIndexOf(array, value) {
  8638. var length = array == null ? 0 : array.length;
  8639. if (length) {
  8640. var index = baseSortedIndex(array, value);
  8641. if (index < length && eq(array[index], value)) {
  8642. return index;
  8643. }
  8644. }
  8645. return -1;
  8646. }
  8647. /**
  8648. * This method is like `_.sortedIndex` except that it returns the highest
  8649. * index at which `value` should be inserted into `array` in order to
  8650. * maintain its sort order.
  8651. *
  8652. * @static
  8653. * @memberOf _
  8654. * @since 3.0.0
  8655. * @category Array
  8656. * @param {Array} array The sorted array to inspect.
  8657. * @param {*} value The value to evaluate.
  8658. * @returns {number} Returns the index at which `value` should be inserted
  8659. * into `array`.
  8660. * @example
  8661. *
  8662. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8663. * // => 4
  8664. */
  8665. function sortedLastIndex(array, value) {
  8666. return baseSortedIndex(array, value, true);
  8667. }
  8668. /**
  8669. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8670. * which is invoked for `value` and each element of `array` to compute their
  8671. * sort ranking. The iteratee is invoked with one argument: (value).
  8672. *
  8673. * @static
  8674. * @memberOf _
  8675. * @since 4.0.0
  8676. * @category Array
  8677. * @param {Array} array The sorted array to inspect.
  8678. * @param {*} value The value to evaluate.
  8679. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8680. * @returns {number} Returns the index at which `value` should be inserted
  8681. * into `array`.
  8682. * @example
  8683. *
  8684. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8685. *
  8686. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8687. * // => 1
  8688. *
  8689. * // The `_.property` iteratee shorthand.
  8690. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8691. * // => 1
  8692. */
  8693. function sortedLastIndexBy(array, value, iteratee) {
  8694. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8695. }
  8696. /**
  8697. * This method is like `_.lastIndexOf` except that it performs a binary
  8698. * search on a sorted `array`.
  8699. *
  8700. * @static
  8701. * @memberOf _
  8702. * @since 4.0.0
  8703. * @category Array
  8704. * @param {Array} array The array to inspect.
  8705. * @param {*} value The value to search for.
  8706. * @returns {number} Returns the index of the matched value, else `-1`.
  8707. * @example
  8708. *
  8709. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8710. * // => 3
  8711. */
  8712. function sortedLastIndexOf(array, value) {
  8713. var length = array == null ? 0 : array.length;
  8714. if (length) {
  8715. var index = baseSortedIndex(array, value, true) - 1;
  8716. if (eq(array[index], value)) {
  8717. return index;
  8718. }
  8719. }
  8720. return -1;
  8721. }
  8722. /**
  8723. * This method is like `_.uniq` except that it's designed and optimized
  8724. * for sorted arrays.
  8725. *
  8726. * @static
  8727. * @memberOf _
  8728. * @since 4.0.0
  8729. * @category Array
  8730. * @param {Array} array The array to inspect.
  8731. * @returns {Array} Returns the new duplicate free array.
  8732. * @example
  8733. *
  8734. * _.sortedUniq([1, 1, 2]);
  8735. * // => [1, 2]
  8736. */
  8737. function sortedUniq(array) {
  8738. return (array && array.length)
  8739. ? baseSortedUniq(array)
  8740. : [];
  8741. }
  8742. /**
  8743. * This method is like `_.uniqBy` except that it's designed and optimized
  8744. * for sorted arrays.
  8745. *
  8746. * @static
  8747. * @memberOf _
  8748. * @since 4.0.0
  8749. * @category Array
  8750. * @param {Array} array The array to inspect.
  8751. * @param {Function} [iteratee] The iteratee invoked per element.
  8752. * @returns {Array} Returns the new duplicate free array.
  8753. * @example
  8754. *
  8755. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8756. * // => [1.1, 2.3]
  8757. */
  8758. function sortedUniqBy(array, iteratee) {
  8759. return (array && array.length)
  8760. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8761. : [];
  8762. }
  8763. /**
  8764. * Gets all but the first element of `array`.
  8765. *
  8766. * @static
  8767. * @memberOf _
  8768. * @since 4.0.0
  8769. * @category Array
  8770. * @param {Array} array The array to query.
  8771. * @returns {Array} Returns the slice of `array`.
  8772. * @example
  8773. *
  8774. * _.tail([1, 2, 3]);
  8775. * // => [2, 3]
  8776. */
  8777. function tail(array) {
  8778. var length = array == null ? 0 : array.length;
  8779. return length ? baseSlice(array, 1, length) : [];
  8780. }
  8781. /**
  8782. * Creates a slice of `array` with `n` elements taken from the beginning.
  8783. *
  8784. * @static
  8785. * @memberOf _
  8786. * @since 0.1.0
  8787. * @category Array
  8788. * @param {Array} array The array to query.
  8789. * @param {number} [n=1] The number of elements to take.
  8790. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8791. * @returns {Array} Returns the slice of `array`.
  8792. * @example
  8793. *
  8794. * _.take([1, 2, 3]);
  8795. * // => [1]
  8796. *
  8797. * _.take([1, 2, 3], 2);
  8798. * // => [1, 2]
  8799. *
  8800. * _.take([1, 2, 3], 5);
  8801. * // => [1, 2, 3]
  8802. *
  8803. * _.take([1, 2, 3], 0);
  8804. * // => []
  8805. */
  8806. function take(array, n, guard) {
  8807. if (!(array && array.length)) {
  8808. return [];
  8809. }
  8810. n = (guard || n === undefined) ? 1 : toInteger(n);
  8811. return baseSlice(array, 0, n < 0 ? 0 : n);
  8812. }
  8813. /**
  8814. * Creates a slice of `array` with `n` elements taken from the end.
  8815. *
  8816. * @static
  8817. * @memberOf _
  8818. * @since 3.0.0
  8819. * @category Array
  8820. * @param {Array} array The array to query.
  8821. * @param {number} [n=1] The number of elements to take.
  8822. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8823. * @returns {Array} Returns the slice of `array`.
  8824. * @example
  8825. *
  8826. * _.takeRight([1, 2, 3]);
  8827. * // => [3]
  8828. *
  8829. * _.takeRight([1, 2, 3], 2);
  8830. * // => [2, 3]
  8831. *
  8832. * _.takeRight([1, 2, 3], 5);
  8833. * // => [1, 2, 3]
  8834. *
  8835. * _.takeRight([1, 2, 3], 0);
  8836. * // => []
  8837. */
  8838. function takeRight(array, n, guard) {
  8839. var length = array == null ? 0 : array.length;
  8840. if (!length) {
  8841. return [];
  8842. }
  8843. n = (guard || n === undefined) ? 1 : toInteger(n);
  8844. n = length - n;
  8845. return baseSlice(array, n < 0 ? 0 : n, length);
  8846. }
  8847. /**
  8848. * Creates a slice of `array` with elements taken from the end. Elements are
  8849. * taken until `predicate` returns falsey. The predicate is invoked with
  8850. * three arguments: (value, index, array).
  8851. *
  8852. * @static
  8853. * @memberOf _
  8854. * @since 3.0.0
  8855. * @category Array
  8856. * @param {Array} array The array to query.
  8857. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8858. * @returns {Array} Returns the slice of `array`.
  8859. * @example
  8860. *
  8861. * var users = [
  8862. * { 'user': 'barney', 'active': true },
  8863. * { 'user': 'fred', 'active': false },
  8864. * { 'user': 'pebbles', 'active': false }
  8865. * ];
  8866. *
  8867. * _.takeRightWhile(users, function(o) { return !o.active; });
  8868. * // => objects for ['fred', 'pebbles']
  8869. *
  8870. * // The `_.matches` iteratee shorthand.
  8871. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8872. * // => objects for ['pebbles']
  8873. *
  8874. * // The `_.matchesProperty` iteratee shorthand.
  8875. * _.takeRightWhile(users, ['active', false]);
  8876. * // => objects for ['fred', 'pebbles']
  8877. *
  8878. * // The `_.property` iteratee shorthand.
  8879. * _.takeRightWhile(users, 'active');
  8880. * // => []
  8881. */
  8882. function takeRightWhile(array, predicate) {
  8883. return (array && array.length)
  8884. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8885. : [];
  8886. }
  8887. /**
  8888. * Creates a slice of `array` with elements taken from the beginning. Elements
  8889. * are taken until `predicate` returns falsey. The predicate is invoked with
  8890. * three arguments: (value, index, array).
  8891. *
  8892. * @static
  8893. * @memberOf _
  8894. * @since 3.0.0
  8895. * @category Array
  8896. * @param {Array} array The array to query.
  8897. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8898. * @returns {Array} Returns the slice of `array`.
  8899. * @example
  8900. *
  8901. * var users = [
  8902. * { 'user': 'barney', 'active': false },
  8903. * { 'user': 'fred', 'active': false },
  8904. * { 'user': 'pebbles', 'active': true }
  8905. * ];
  8906. *
  8907. * _.takeWhile(users, function(o) { return !o.active; });
  8908. * // => objects for ['barney', 'fred']
  8909. *
  8910. * // The `_.matches` iteratee shorthand.
  8911. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8912. * // => objects for ['barney']
  8913. *
  8914. * // The `_.matchesProperty` iteratee shorthand.
  8915. * _.takeWhile(users, ['active', false]);
  8916. * // => objects for ['barney', 'fred']
  8917. *
  8918. * // The `_.property` iteratee shorthand.
  8919. * _.takeWhile(users, 'active');
  8920. * // => []
  8921. */
  8922. function takeWhile(array, predicate) {
  8923. return (array && array.length)
  8924. ? baseWhile(array, getIteratee(predicate, 3))
  8925. : [];
  8926. }
  8927. /**
  8928. * Creates an array of unique values, in order, from all given arrays using
  8929. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8930. * for equality comparisons.
  8931. *
  8932. * @static
  8933. * @memberOf _
  8934. * @since 0.1.0
  8935. * @category Array
  8936. * @param {...Array} [arrays] The arrays to inspect.
  8937. * @returns {Array} Returns the new array of combined values.
  8938. * @example
  8939. *
  8940. * _.union([2], [1, 2]);
  8941. * // => [2, 1]
  8942. */
  8943. var union = baseRest(function(arrays) {
  8944. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8945. });
  8946. /**
  8947. * This method is like `_.union` except that it accepts `iteratee` which is
  8948. * invoked for each element of each `arrays` to generate the criterion by
  8949. * which uniqueness is computed. Result values are chosen from the first
  8950. * array in which the value occurs. The iteratee is invoked with one argument:
  8951. * (value).
  8952. *
  8953. * @static
  8954. * @memberOf _
  8955. * @since 4.0.0
  8956. * @category Array
  8957. * @param {...Array} [arrays] The arrays to inspect.
  8958. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8959. * @returns {Array} Returns the new array of combined values.
  8960. * @example
  8961. *
  8962. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8963. * // => [2.1, 1.2]
  8964. *
  8965. * // The `_.property` iteratee shorthand.
  8966. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8967. * // => [{ 'x': 1 }, { 'x': 2 }]
  8968. */
  8969. var unionBy = baseRest(function(arrays) {
  8970. var iteratee = last(arrays);
  8971. if (isArrayLikeObject(iteratee)) {
  8972. iteratee = undefined;
  8973. }
  8974. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8975. });
  8976. /**
  8977. * This method is like `_.union` except that it accepts `comparator` which
  8978. * is invoked to compare elements of `arrays`. Result values are chosen from
  8979. * the first array in which the value occurs. The comparator is invoked
  8980. * with two arguments: (arrVal, othVal).
  8981. *
  8982. * @static
  8983. * @memberOf _
  8984. * @since 4.0.0
  8985. * @category Array
  8986. * @param {...Array} [arrays] The arrays to inspect.
  8987. * @param {Function} [comparator] The comparator invoked per element.
  8988. * @returns {Array} Returns the new array of combined values.
  8989. * @example
  8990. *
  8991. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8992. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8993. *
  8994. * _.unionWith(objects, others, _.isEqual);
  8995. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8996. */
  8997. var unionWith = baseRest(function(arrays) {
  8998. var comparator = last(arrays);
  8999. comparator = typeof comparator == 'function' ? comparator : undefined;
  9000. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9001. });
  9002. /**
  9003. * Creates a duplicate-free version of an array, using
  9004. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9005. * for equality comparisons, in which only the first occurrence of each element
  9006. * is kept. The order of result values is determined by the order they occur
  9007. * in the array.
  9008. *
  9009. * @static
  9010. * @memberOf _
  9011. * @since 0.1.0
  9012. * @category Array
  9013. * @param {Array} array The array to inspect.
  9014. * @returns {Array} Returns the new duplicate free array.
  9015. * @example
  9016. *
  9017. * _.uniq([2, 1, 2]);
  9018. * // => [2, 1]
  9019. */
  9020. function uniq(array) {
  9021. return (array && array.length) ? baseUniq(array) : [];
  9022. }
  9023. /**
  9024. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9025. * invoked for each element in `array` to generate the criterion by which
  9026. * uniqueness is computed. The order of result values is determined by the
  9027. * order they occur in the array. The iteratee is invoked with one argument:
  9028. * (value).
  9029. *
  9030. * @static
  9031. * @memberOf _
  9032. * @since 4.0.0
  9033. * @category Array
  9034. * @param {Array} array The array to inspect.
  9035. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9036. * @returns {Array} Returns the new duplicate free array.
  9037. * @example
  9038. *
  9039. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9040. * // => [2.1, 1.2]
  9041. *
  9042. * // The `_.property` iteratee shorthand.
  9043. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9044. * // => [{ 'x': 1 }, { 'x': 2 }]
  9045. */
  9046. function uniqBy(array, iteratee) {
  9047. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9048. }
  9049. /**
  9050. * This method is like `_.uniq` except that it accepts `comparator` which
  9051. * is invoked to compare elements of `array`. The order of result values is
  9052. * determined by the order they occur in the array.The comparator is invoked
  9053. * with two arguments: (arrVal, othVal).
  9054. *
  9055. * @static
  9056. * @memberOf _
  9057. * @since 4.0.0
  9058. * @category Array
  9059. * @param {Array} array The array to inspect.
  9060. * @param {Function} [comparator] The comparator invoked per element.
  9061. * @returns {Array} Returns the new duplicate free array.
  9062. * @example
  9063. *
  9064. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9065. *
  9066. * _.uniqWith(objects, _.isEqual);
  9067. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9068. */
  9069. function uniqWith(array, comparator) {
  9070. comparator = typeof comparator == 'function' ? comparator : undefined;
  9071. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9072. }
  9073. /**
  9074. * This method is like `_.zip` except that it accepts an array of grouped
  9075. * elements and creates an array regrouping the elements to their pre-zip
  9076. * configuration.
  9077. *
  9078. * @static
  9079. * @memberOf _
  9080. * @since 1.2.0
  9081. * @category Array
  9082. * @param {Array} array The array of grouped elements to process.
  9083. * @returns {Array} Returns the new array of regrouped elements.
  9084. * @example
  9085. *
  9086. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9087. * // => [['a', 1, true], ['b', 2, false]]
  9088. *
  9089. * _.unzip(zipped);
  9090. * // => [['a', 'b'], [1, 2], [true, false]]
  9091. */
  9092. function unzip(array) {
  9093. if (!(array && array.length)) {
  9094. return [];
  9095. }
  9096. var length = 0;
  9097. array = arrayFilter(array, function(group) {
  9098. if (isArrayLikeObject(group)) {
  9099. length = nativeMax(group.length, length);
  9100. return true;
  9101. }
  9102. });
  9103. return baseTimes(length, function(index) {
  9104. return arrayMap(array, baseProperty(index));
  9105. });
  9106. }
  9107. /**
  9108. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9109. * how regrouped values should be combined. The iteratee is invoked with the
  9110. * elements of each group: (...group).
  9111. *
  9112. * @static
  9113. * @memberOf _
  9114. * @since 3.8.0
  9115. * @category Array
  9116. * @param {Array} array The array of grouped elements to process.
  9117. * @param {Function} [iteratee=_.identity] The function to combine
  9118. * regrouped values.
  9119. * @returns {Array} Returns the new array of regrouped elements.
  9120. * @example
  9121. *
  9122. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9123. * // => [[1, 10, 100], [2, 20, 200]]
  9124. *
  9125. * _.unzipWith(zipped, _.add);
  9126. * // => [3, 30, 300]
  9127. */
  9128. function unzipWith(array, iteratee) {
  9129. if (!(array && array.length)) {
  9130. return [];
  9131. }
  9132. var result = unzip(array);
  9133. if (iteratee == null) {
  9134. return result;
  9135. }
  9136. return arrayMap(result, function(group) {
  9137. return apply(iteratee, undefined, group);
  9138. });
  9139. }
  9140. /**
  9141. * Creates an array excluding all given values using
  9142. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9143. * for equality comparisons.
  9144. *
  9145. * **Note:** Unlike `_.pull`, this method returns a new array.
  9146. *
  9147. * @static
  9148. * @memberOf _
  9149. * @since 0.1.0
  9150. * @category Array
  9151. * @param {Array} array The array to inspect.
  9152. * @param {...*} [values] The values to exclude.
  9153. * @returns {Array} Returns the new array of filtered values.
  9154. * @see _.difference, _.xor
  9155. * @example
  9156. *
  9157. * _.without([2, 1, 2, 3], 1, 2);
  9158. * // => [3]
  9159. */
  9160. var without = baseRest(function(array, values) {
  9161. return isArrayLikeObject(array)
  9162. ? baseDifference(array, values)
  9163. : [];
  9164. });
  9165. /**
  9166. * Creates an array of unique values that is the
  9167. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9168. * of the given arrays. The order of result values is determined by the order
  9169. * they occur in the arrays.
  9170. *
  9171. * @static
  9172. * @memberOf _
  9173. * @since 2.4.0
  9174. * @category Array
  9175. * @param {...Array} [arrays] The arrays to inspect.
  9176. * @returns {Array} Returns the new array of filtered values.
  9177. * @see _.difference, _.without
  9178. * @example
  9179. *
  9180. * _.xor([2, 1], [2, 3]);
  9181. * // => [1, 3]
  9182. */
  9183. var xor = baseRest(function(arrays) {
  9184. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9185. });
  9186. /**
  9187. * This method is like `_.xor` except that it accepts `iteratee` which is
  9188. * invoked for each element of each `arrays` to generate the criterion by
  9189. * which by which they're compared. The order of result values is determined
  9190. * by the order they occur in the arrays. The iteratee is invoked with one
  9191. * argument: (value).
  9192. *
  9193. * @static
  9194. * @memberOf _
  9195. * @since 4.0.0
  9196. * @category Array
  9197. * @param {...Array} [arrays] The arrays to inspect.
  9198. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9199. * @returns {Array} Returns the new array of filtered values.
  9200. * @example
  9201. *
  9202. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9203. * // => [1.2, 3.4]
  9204. *
  9205. * // The `_.property` iteratee shorthand.
  9206. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9207. * // => [{ 'x': 2 }]
  9208. */
  9209. var xorBy = baseRest(function(arrays) {
  9210. var iteratee = last(arrays);
  9211. if (isArrayLikeObject(iteratee)) {
  9212. iteratee = undefined;
  9213. }
  9214. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9215. });
  9216. /**
  9217. * This method is like `_.xor` except that it accepts `comparator` which is
  9218. * invoked to compare elements of `arrays`. The order of result values is
  9219. * determined by the order they occur in the arrays. The comparator is invoked
  9220. * with two arguments: (arrVal, othVal).
  9221. *
  9222. * @static
  9223. * @memberOf _
  9224. * @since 4.0.0
  9225. * @category Array
  9226. * @param {...Array} [arrays] The arrays to inspect.
  9227. * @param {Function} [comparator] The comparator invoked per element.
  9228. * @returns {Array} Returns the new array of filtered values.
  9229. * @example
  9230. *
  9231. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9232. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9233. *
  9234. * _.xorWith(objects, others, _.isEqual);
  9235. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9236. */
  9237. var xorWith = baseRest(function(arrays) {
  9238. var comparator = last(arrays);
  9239. comparator = typeof comparator == 'function' ? comparator : undefined;
  9240. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9241. });
  9242. /**
  9243. * Creates an array of grouped elements, the first of which contains the
  9244. * first elements of the given arrays, the second of which contains the
  9245. * second elements of the given arrays, and so on.
  9246. *
  9247. * @static
  9248. * @memberOf _
  9249. * @since 0.1.0
  9250. * @category Array
  9251. * @param {...Array} [arrays] The arrays to process.
  9252. * @returns {Array} Returns the new array of grouped elements.
  9253. * @example
  9254. *
  9255. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9256. * // => [['a', 1, true], ['b', 2, false]]
  9257. */
  9258. var zip = baseRest(unzip);
  9259. /**
  9260. * This method is like `_.fromPairs` except that it accepts two arrays,
  9261. * one of property identifiers and one of corresponding values.
  9262. *
  9263. * @static
  9264. * @memberOf _
  9265. * @since 0.4.0
  9266. * @category Array
  9267. * @param {Array} [props=[]] The property identifiers.
  9268. * @param {Array} [values=[]] The property values.
  9269. * @returns {Object} Returns the new object.
  9270. * @example
  9271. *
  9272. * _.zipObject(['a', 'b'], [1, 2]);
  9273. * // => { 'a': 1, 'b': 2 }
  9274. */
  9275. function zipObject(props, values) {
  9276. return baseZipObject(props || [], values || [], assignValue);
  9277. }
  9278. /**
  9279. * This method is like `_.zipObject` except that it supports property paths.
  9280. *
  9281. * @static
  9282. * @memberOf _
  9283. * @since 4.1.0
  9284. * @category Array
  9285. * @param {Array} [props=[]] The property identifiers.
  9286. * @param {Array} [values=[]] The property values.
  9287. * @returns {Object} Returns the new object.
  9288. * @example
  9289. *
  9290. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9291. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9292. */
  9293. function zipObjectDeep(props, values) {
  9294. return baseZipObject(props || [], values || [], baseSet);
  9295. }
  9296. /**
  9297. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9298. * how grouped values should be combined. The iteratee is invoked with the
  9299. * elements of each group: (...group).
  9300. *
  9301. * @static
  9302. * @memberOf _
  9303. * @since 3.8.0
  9304. * @category Array
  9305. * @param {...Array} [arrays] The arrays to process.
  9306. * @param {Function} [iteratee=_.identity] The function to combine
  9307. * grouped values.
  9308. * @returns {Array} Returns the new array of grouped elements.
  9309. * @example
  9310. *
  9311. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9312. * return a + b + c;
  9313. * });
  9314. * // => [111, 222]
  9315. */
  9316. var zipWith = baseRest(function(arrays) {
  9317. var length = arrays.length,
  9318. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9319. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9320. return unzipWith(arrays, iteratee);
  9321. });
  9322. /*------------------------------------------------------------------------*/
  9323. /**
  9324. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9325. * chain sequences enabled. The result of such sequences must be unwrapped
  9326. * with `_#value`.
  9327. *
  9328. * @static
  9329. * @memberOf _
  9330. * @since 1.3.0
  9331. * @category Seq
  9332. * @param {*} value The value to wrap.
  9333. * @returns {Object} Returns the new `lodash` wrapper instance.
  9334. * @example
  9335. *
  9336. * var users = [
  9337. * { 'user': 'barney', 'age': 36 },
  9338. * { 'user': 'fred', 'age': 40 },
  9339. * { 'user': 'pebbles', 'age': 1 }
  9340. * ];
  9341. *
  9342. * var youngest = _
  9343. * .chain(users)
  9344. * .sortBy('age')
  9345. * .map(function(o) {
  9346. * return o.user + ' is ' + o.age;
  9347. * })
  9348. * .head()
  9349. * .value();
  9350. * // => 'pebbles is 1'
  9351. */
  9352. function chain(value) {
  9353. var result = lodash(value);
  9354. result.__chain__ = true;
  9355. return result;
  9356. }
  9357. /**
  9358. * This method invokes `interceptor` and returns `value`. The interceptor
  9359. * is invoked with one argument; (value). The purpose of this method is to
  9360. * "tap into" a method chain sequence in order to modify intermediate results.
  9361. *
  9362. * @static
  9363. * @memberOf _
  9364. * @since 0.1.0
  9365. * @category Seq
  9366. * @param {*} value The value to provide to `interceptor`.
  9367. * @param {Function} interceptor The function to invoke.
  9368. * @returns {*} Returns `value`.
  9369. * @example
  9370. *
  9371. * _([1, 2, 3])
  9372. * .tap(function(array) {
  9373. * // Mutate input array.
  9374. * array.pop();
  9375. * })
  9376. * .reverse()
  9377. * .value();
  9378. * // => [2, 1]
  9379. */
  9380. function tap(value, interceptor) {
  9381. interceptor(value);
  9382. return value;
  9383. }
  9384. /**
  9385. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9386. * The purpose of this method is to "pass thru" values replacing intermediate
  9387. * results in a method chain sequence.
  9388. *
  9389. * @static
  9390. * @memberOf _
  9391. * @since 3.0.0
  9392. * @category Seq
  9393. * @param {*} value The value to provide to `interceptor`.
  9394. * @param {Function} interceptor The function to invoke.
  9395. * @returns {*} Returns the result of `interceptor`.
  9396. * @example
  9397. *
  9398. * _(' abc ')
  9399. * .chain()
  9400. * .trim()
  9401. * .thru(function(value) {
  9402. * return [value];
  9403. * })
  9404. * .value();
  9405. * // => ['abc']
  9406. */
  9407. function thru(value, interceptor) {
  9408. return interceptor(value);
  9409. }
  9410. /**
  9411. * This method is the wrapper version of `_.at`.
  9412. *
  9413. * @name at
  9414. * @memberOf _
  9415. * @since 1.0.0
  9416. * @category Seq
  9417. * @param {...(string|string[])} [paths] The property paths to pick.
  9418. * @returns {Object} Returns the new `lodash` wrapper instance.
  9419. * @example
  9420. *
  9421. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9422. *
  9423. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9424. * // => [3, 4]
  9425. */
  9426. var wrapperAt = flatRest(function(paths) {
  9427. var length = paths.length,
  9428. start = length ? paths[0] : 0,
  9429. value = this.__wrapped__,
  9430. interceptor = function(object) { return baseAt(object, paths); };
  9431. if (length > 1 || this.__actions__.length ||
  9432. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9433. return this.thru(interceptor);
  9434. }
  9435. value = value.slice(start, +start + (length ? 1 : 0));
  9436. value.__actions__.push({
  9437. 'func': thru,
  9438. 'args': [interceptor],
  9439. 'thisArg': undefined
  9440. });
  9441. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9442. if (length && !array.length) {
  9443. array.push(undefined);
  9444. }
  9445. return array;
  9446. });
  9447. });
  9448. /**
  9449. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9450. *
  9451. * @name chain
  9452. * @memberOf _
  9453. * @since 0.1.0
  9454. * @category Seq
  9455. * @returns {Object} Returns the new `lodash` wrapper instance.
  9456. * @example
  9457. *
  9458. * var users = [
  9459. * { 'user': 'barney', 'age': 36 },
  9460. * { 'user': 'fred', 'age': 40 }
  9461. * ];
  9462. *
  9463. * // A sequence without explicit chaining.
  9464. * _(users).head();
  9465. * // => { 'user': 'barney', 'age': 36 }
  9466. *
  9467. * // A sequence with explicit chaining.
  9468. * _(users)
  9469. * .chain()
  9470. * .head()
  9471. * .pick('user')
  9472. * .value();
  9473. * // => { 'user': 'barney' }
  9474. */
  9475. function wrapperChain() {
  9476. return chain(this);
  9477. }
  9478. /**
  9479. * Executes the chain sequence and returns the wrapped result.
  9480. *
  9481. * @name commit
  9482. * @memberOf _
  9483. * @since 3.2.0
  9484. * @category Seq
  9485. * @returns {Object} Returns the new `lodash` wrapper instance.
  9486. * @example
  9487. *
  9488. * var array = [1, 2];
  9489. * var wrapped = _(array).push(3);
  9490. *
  9491. * console.log(array);
  9492. * // => [1, 2]
  9493. *
  9494. * wrapped = wrapped.commit();
  9495. * console.log(array);
  9496. * // => [1, 2, 3]
  9497. *
  9498. * wrapped.last();
  9499. * // => 3
  9500. *
  9501. * console.log(array);
  9502. * // => [1, 2, 3]
  9503. */
  9504. function wrapperCommit() {
  9505. return new LodashWrapper(this.value(), this.__chain__);
  9506. }
  9507. /**
  9508. * Gets the next value on a wrapped object following the
  9509. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9510. *
  9511. * @name next
  9512. * @memberOf _
  9513. * @since 4.0.0
  9514. * @category Seq
  9515. * @returns {Object} Returns the next iterator value.
  9516. * @example
  9517. *
  9518. * var wrapped = _([1, 2]);
  9519. *
  9520. * wrapped.next();
  9521. * // => { 'done': false, 'value': 1 }
  9522. *
  9523. * wrapped.next();
  9524. * // => { 'done': false, 'value': 2 }
  9525. *
  9526. * wrapped.next();
  9527. * // => { 'done': true, 'value': undefined }
  9528. */
  9529. function wrapperNext() {
  9530. if (this.__values__ === undefined) {
  9531. this.__values__ = toArray(this.value());
  9532. }
  9533. var done = this.__index__ >= this.__values__.length,
  9534. value = done ? undefined : this.__values__[this.__index__++];
  9535. return { 'done': done, 'value': value };
  9536. }
  9537. /**
  9538. * Enables the wrapper to be iterable.
  9539. *
  9540. * @name Symbol.iterator
  9541. * @memberOf _
  9542. * @since 4.0.0
  9543. * @category Seq
  9544. * @returns {Object} Returns the wrapper object.
  9545. * @example
  9546. *
  9547. * var wrapped = _([1, 2]);
  9548. *
  9549. * wrapped[Symbol.iterator]() === wrapped;
  9550. * // => true
  9551. *
  9552. * Array.from(wrapped);
  9553. * // => [1, 2]
  9554. */
  9555. function wrapperToIterator() {
  9556. return this;
  9557. }
  9558. /**
  9559. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9560. *
  9561. * @name plant
  9562. * @memberOf _
  9563. * @since 3.2.0
  9564. * @category Seq
  9565. * @param {*} value The value to plant.
  9566. * @returns {Object} Returns the new `lodash` wrapper instance.
  9567. * @example
  9568. *
  9569. * function square(n) {
  9570. * return n * n;
  9571. * }
  9572. *
  9573. * var wrapped = _([1, 2]).map(square);
  9574. * var other = wrapped.plant([3, 4]);
  9575. *
  9576. * other.value();
  9577. * // => [9, 16]
  9578. *
  9579. * wrapped.value();
  9580. * // => [1, 4]
  9581. */
  9582. function wrapperPlant(value) {
  9583. var result,
  9584. parent = this;
  9585. while (parent instanceof baseLodash) {
  9586. var clone = wrapperClone(parent);
  9587. clone.__index__ = 0;
  9588. clone.__values__ = undefined;
  9589. if (result) {
  9590. previous.__wrapped__ = clone;
  9591. } else {
  9592. result = clone;
  9593. }
  9594. var previous = clone;
  9595. parent = parent.__wrapped__;
  9596. }
  9597. previous.__wrapped__ = value;
  9598. return result;
  9599. }
  9600. /**
  9601. * This method is the wrapper version of `_.reverse`.
  9602. *
  9603. * **Note:** This method mutates the wrapped array.
  9604. *
  9605. * @name reverse
  9606. * @memberOf _
  9607. * @since 0.1.0
  9608. * @category Seq
  9609. * @returns {Object} Returns the new `lodash` wrapper instance.
  9610. * @example
  9611. *
  9612. * var array = [1, 2, 3];
  9613. *
  9614. * _(array).reverse().value()
  9615. * // => [3, 2, 1]
  9616. *
  9617. * console.log(array);
  9618. * // => [3, 2, 1]
  9619. */
  9620. function wrapperReverse() {
  9621. var value = this.__wrapped__;
  9622. if (value instanceof LazyWrapper) {
  9623. var wrapped = value;
  9624. if (this.__actions__.length) {
  9625. wrapped = new LazyWrapper(this);
  9626. }
  9627. wrapped = wrapped.reverse();
  9628. wrapped.__actions__.push({
  9629. 'func': thru,
  9630. 'args': [reverse],
  9631. 'thisArg': undefined
  9632. });
  9633. return new LodashWrapper(wrapped, this.__chain__);
  9634. }
  9635. return this.thru(reverse);
  9636. }
  9637. /**
  9638. * Executes the chain sequence to resolve the unwrapped value.
  9639. *
  9640. * @name value
  9641. * @memberOf _
  9642. * @since 0.1.0
  9643. * @alias toJSON, valueOf
  9644. * @category Seq
  9645. * @returns {*} Returns the resolved unwrapped value.
  9646. * @example
  9647. *
  9648. * _([1, 2, 3]).value();
  9649. * // => [1, 2, 3]
  9650. */
  9651. function wrapperValue() {
  9652. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9653. }
  9654. /*------------------------------------------------------------------------*/
  9655. /**
  9656. * Creates an object composed of keys generated from the results of running
  9657. * each element of `collection` thru `iteratee`. The corresponding value of
  9658. * each key is the number of times the key was returned by `iteratee`. The
  9659. * iteratee is invoked with one argument: (value).
  9660. *
  9661. * @static
  9662. * @memberOf _
  9663. * @since 0.5.0
  9664. * @category Collection
  9665. * @param {Array|Object} collection The collection to iterate over.
  9666. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9667. * @returns {Object} Returns the composed aggregate object.
  9668. * @example
  9669. *
  9670. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9671. * // => { '4': 1, '6': 2 }
  9672. *
  9673. * // The `_.property` iteratee shorthand.
  9674. * _.countBy(['one', 'two', 'three'], 'length');
  9675. * // => { '3': 2, '5': 1 }
  9676. */
  9677. var countBy = createAggregator(function(result, value, key) {
  9678. if (hasOwnProperty.call(result, key)) {
  9679. ++result[key];
  9680. } else {
  9681. baseAssignValue(result, key, 1);
  9682. }
  9683. });
  9684. /**
  9685. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9686. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9687. * invoked with three arguments: (value, index|key, collection).
  9688. *
  9689. * **Note:** This method returns `true` for
  9690. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9691. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9692. * elements of empty collections.
  9693. *
  9694. * @static
  9695. * @memberOf _
  9696. * @since 0.1.0
  9697. * @category Collection
  9698. * @param {Array|Object} collection The collection to iterate over.
  9699. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9700. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9701. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9702. * else `false`.
  9703. * @example
  9704. *
  9705. * _.every([true, 1, null, 'yes'], Boolean);
  9706. * // => false
  9707. *
  9708. * var users = [
  9709. * { 'user': 'barney', 'age': 36, 'active': false },
  9710. * { 'user': 'fred', 'age': 40, 'active': false }
  9711. * ];
  9712. *
  9713. * // The `_.matches` iteratee shorthand.
  9714. * _.every(users, { 'user': 'barney', 'active': false });
  9715. * // => false
  9716. *
  9717. * // The `_.matchesProperty` iteratee shorthand.
  9718. * _.every(users, ['active', false]);
  9719. * // => true
  9720. *
  9721. * // The `_.property` iteratee shorthand.
  9722. * _.every(users, 'active');
  9723. * // => false
  9724. */
  9725. function every(collection, predicate, guard) {
  9726. var func = isArray(collection) ? arrayEvery : baseEvery;
  9727. if (guard && isIterateeCall(collection, predicate, guard)) {
  9728. predicate = undefined;
  9729. }
  9730. return func(collection, getIteratee(predicate, 3));
  9731. }
  9732. /**
  9733. * Iterates over elements of `collection`, returning an array of all elements
  9734. * `predicate` returns truthy for. The predicate is invoked with three
  9735. * arguments: (value, index|key, collection).
  9736. *
  9737. * **Note:** Unlike `_.remove`, this method returns a new array.
  9738. *
  9739. * @static
  9740. * @memberOf _
  9741. * @since 0.1.0
  9742. * @category Collection
  9743. * @param {Array|Object} collection The collection to iterate over.
  9744. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9745. * @returns {Array} Returns the new filtered array.
  9746. * @see _.reject
  9747. * @example
  9748. *
  9749. * var users = [
  9750. * { 'user': 'barney', 'age': 36, 'active': true },
  9751. * { 'user': 'fred', 'age': 40, 'active': false }
  9752. * ];
  9753. *
  9754. * _.filter(users, function(o) { return !o.active; });
  9755. * // => objects for ['fred']
  9756. *
  9757. * // The `_.matches` iteratee shorthand.
  9758. * _.filter(users, { 'age': 36, 'active': true });
  9759. * // => objects for ['barney']
  9760. *
  9761. * // The `_.matchesProperty` iteratee shorthand.
  9762. * _.filter(users, ['active', false]);
  9763. * // => objects for ['fred']
  9764. *
  9765. * // The `_.property` iteratee shorthand.
  9766. * _.filter(users, 'active');
  9767. * // => objects for ['barney']
  9768. *
  9769. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9770. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9771. * // => objects for ['fred', 'barney']
  9772. */
  9773. function filter(collection, predicate) {
  9774. var func = isArray(collection) ? arrayFilter : baseFilter;
  9775. return func(collection, getIteratee(predicate, 3));
  9776. }
  9777. /**
  9778. * Iterates over elements of `collection`, returning the first element
  9779. * `predicate` returns truthy for. The predicate is invoked with three
  9780. * arguments: (value, index|key, collection).
  9781. *
  9782. * @static
  9783. * @memberOf _
  9784. * @since 0.1.0
  9785. * @category Collection
  9786. * @param {Array|Object} collection The collection to inspect.
  9787. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9788. * @param {number} [fromIndex=0] The index to search from.
  9789. * @returns {*} Returns the matched element, else `undefined`.
  9790. * @example
  9791. *
  9792. * var users = [
  9793. * { 'user': 'barney', 'age': 36, 'active': true },
  9794. * { 'user': 'fred', 'age': 40, 'active': false },
  9795. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9796. * ];
  9797. *
  9798. * _.find(users, function(o) { return o.age < 40; });
  9799. * // => object for 'barney'
  9800. *
  9801. * // The `_.matches` iteratee shorthand.
  9802. * _.find(users, { 'age': 1, 'active': true });
  9803. * // => object for 'pebbles'
  9804. *
  9805. * // The `_.matchesProperty` iteratee shorthand.
  9806. * _.find(users, ['active', false]);
  9807. * // => object for 'fred'
  9808. *
  9809. * // The `_.property` iteratee shorthand.
  9810. * _.find(users, 'active');
  9811. * // => object for 'barney'
  9812. */
  9813. var find = createFind(findIndex);
  9814. /**
  9815. * This method is like `_.find` except that it iterates over elements of
  9816. * `collection` from right to left.
  9817. *
  9818. * @static
  9819. * @memberOf _
  9820. * @since 2.0.0
  9821. * @category Collection
  9822. * @param {Array|Object} collection The collection to inspect.
  9823. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9824. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9825. * @returns {*} Returns the matched element, else `undefined`.
  9826. * @example
  9827. *
  9828. * _.findLast([1, 2, 3, 4], function(n) {
  9829. * return n % 2 == 1;
  9830. * });
  9831. * // => 3
  9832. */
  9833. var findLast = createFind(findLastIndex);
  9834. /**
  9835. * Creates a flattened array of values by running each element in `collection`
  9836. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9837. * with three arguments: (value, index|key, collection).
  9838. *
  9839. * @static
  9840. * @memberOf _
  9841. * @since 4.0.0
  9842. * @category Collection
  9843. * @param {Array|Object} collection The collection to iterate over.
  9844. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9845. * @returns {Array} Returns the new flattened array.
  9846. * @example
  9847. *
  9848. * function duplicate(n) {
  9849. * return [n, n];
  9850. * }
  9851. *
  9852. * _.flatMap([1, 2], duplicate);
  9853. * // => [1, 1, 2, 2]
  9854. */
  9855. function flatMap(collection, iteratee) {
  9856. return baseFlatten(map(collection, iteratee), 1);
  9857. }
  9858. /**
  9859. * This method is like `_.flatMap` except that it recursively flattens the
  9860. * mapped results.
  9861. *
  9862. * @static
  9863. * @memberOf _
  9864. * @since 4.7.0
  9865. * @category Collection
  9866. * @param {Array|Object} collection The collection to iterate over.
  9867. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9868. * @returns {Array} Returns the new flattened array.
  9869. * @example
  9870. *
  9871. * function duplicate(n) {
  9872. * return [[[n, n]]];
  9873. * }
  9874. *
  9875. * _.flatMapDeep([1, 2], duplicate);
  9876. * // => [1, 1, 2, 2]
  9877. */
  9878. function flatMapDeep(collection, iteratee) {
  9879. return baseFlatten(map(collection, iteratee), INFINITY);
  9880. }
  9881. /**
  9882. * This method is like `_.flatMap` except that it recursively flattens the
  9883. * mapped results up to `depth` times.
  9884. *
  9885. * @static
  9886. * @memberOf _
  9887. * @since 4.7.0
  9888. * @category Collection
  9889. * @param {Array|Object} collection The collection to iterate over.
  9890. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9891. * @param {number} [depth=1] The maximum recursion depth.
  9892. * @returns {Array} Returns the new flattened array.
  9893. * @example
  9894. *
  9895. * function duplicate(n) {
  9896. * return [[[n, n]]];
  9897. * }
  9898. *
  9899. * _.flatMapDepth([1, 2], duplicate, 2);
  9900. * // => [[1, 1], [2, 2]]
  9901. */
  9902. function flatMapDepth(collection, iteratee, depth) {
  9903. depth = depth === undefined ? 1 : toInteger(depth);
  9904. return baseFlatten(map(collection, iteratee), depth);
  9905. }
  9906. /**
  9907. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9908. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9909. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9910. *
  9911. * **Note:** As with other "Collections" methods, objects with a "length"
  9912. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9913. * or `_.forOwn` for object iteration.
  9914. *
  9915. * @static
  9916. * @memberOf _
  9917. * @since 0.1.0
  9918. * @alias each
  9919. * @category Collection
  9920. * @param {Array|Object} collection The collection to iterate over.
  9921. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9922. * @returns {Array|Object} Returns `collection`.
  9923. * @see _.forEachRight
  9924. * @example
  9925. *
  9926. * _.forEach([1, 2], function(value) {
  9927. * console.log(value);
  9928. * });
  9929. * // => Logs `1` then `2`.
  9930. *
  9931. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9932. * console.log(key);
  9933. * });
  9934. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9935. */
  9936. function forEach(collection, iteratee) {
  9937. var func = isArray(collection) ? arrayEach : baseEach;
  9938. return func(collection, getIteratee(iteratee, 3));
  9939. }
  9940. /**
  9941. * This method is like `_.forEach` except that it iterates over elements of
  9942. * `collection` from right to left.
  9943. *
  9944. * @static
  9945. * @memberOf _
  9946. * @since 2.0.0
  9947. * @alias eachRight
  9948. * @category Collection
  9949. * @param {Array|Object} collection The collection to iterate over.
  9950. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9951. * @returns {Array|Object} Returns `collection`.
  9952. * @see _.forEach
  9953. * @example
  9954. *
  9955. * _.forEachRight([1, 2], function(value) {
  9956. * console.log(value);
  9957. * });
  9958. * // => Logs `2` then `1`.
  9959. */
  9960. function forEachRight(collection, iteratee) {
  9961. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9962. return func(collection, getIteratee(iteratee, 3));
  9963. }
  9964. /**
  9965. * Creates an object composed of keys generated from the results of running
  9966. * each element of `collection` thru `iteratee`. The order of grouped values
  9967. * is determined by the order they occur in `collection`. The corresponding
  9968. * value of each key is an array of elements responsible for generating the
  9969. * key. The iteratee is invoked with one argument: (value).
  9970. *
  9971. * @static
  9972. * @memberOf _
  9973. * @since 0.1.0
  9974. * @category Collection
  9975. * @param {Array|Object} collection The collection to iterate over.
  9976. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9977. * @returns {Object} Returns the composed aggregate object.
  9978. * @example
  9979. *
  9980. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9981. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9982. *
  9983. * // The `_.property` iteratee shorthand.
  9984. * _.groupBy(['one', 'two', 'three'], 'length');
  9985. * // => { '3': ['one', 'two'], '5': ['three'] }
  9986. */
  9987. var groupBy = createAggregator(function(result, value, key) {
  9988. if (hasOwnProperty.call(result, key)) {
  9989. result[key].push(value);
  9990. } else {
  9991. baseAssignValue(result, key, [value]);
  9992. }
  9993. });
  9994. /**
  9995. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9996. * checked for a substring of `value`, otherwise
  9997. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9998. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9999. * the offset from the end of `collection`.
  10000. *
  10001. * @static
  10002. * @memberOf _
  10003. * @since 0.1.0
  10004. * @category Collection
  10005. * @param {Array|Object|string} collection The collection to inspect.
  10006. * @param {*} value The value to search for.
  10007. * @param {number} [fromIndex=0] The index to search from.
  10008. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10009. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10010. * @example
  10011. *
  10012. * _.includes([1, 2, 3], 1);
  10013. * // => true
  10014. *
  10015. * _.includes([1, 2, 3], 1, 2);
  10016. * // => false
  10017. *
  10018. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10019. * // => true
  10020. *
  10021. * _.includes('abcd', 'bc');
  10022. * // => true
  10023. */
  10024. function includes(collection, value, fromIndex, guard) {
  10025. collection = isArrayLike(collection) ? collection : values(collection);
  10026. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10027. var length = collection.length;
  10028. if (fromIndex < 0) {
  10029. fromIndex = nativeMax(length + fromIndex, 0);
  10030. }
  10031. return isString(collection)
  10032. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10033. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10034. }
  10035. /**
  10036. * Invokes the method at `path` of each element in `collection`, returning
  10037. * an array of the results of each invoked method. Any additional arguments
  10038. * are provided to each invoked method. If `path` is a function, it's invoked
  10039. * for, and `this` bound to, each element in `collection`.
  10040. *
  10041. * @static
  10042. * @memberOf _
  10043. * @since 4.0.0
  10044. * @category Collection
  10045. * @param {Array|Object} collection The collection to iterate over.
  10046. * @param {Array|Function|string} path The path of the method to invoke or
  10047. * the function invoked per iteration.
  10048. * @param {...*} [args] The arguments to invoke each method with.
  10049. * @returns {Array} Returns the array of results.
  10050. * @example
  10051. *
  10052. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10053. * // => [[1, 5, 7], [1, 2, 3]]
  10054. *
  10055. * _.invokeMap([123, 456], String.prototype.split, '');
  10056. * // => [['1', '2', '3'], ['4', '5', '6']]
  10057. */
  10058. var invokeMap = baseRest(function(collection, path, args) {
  10059. var index = -1,
  10060. isFunc = typeof path == 'function',
  10061. result = isArrayLike(collection) ? Array(collection.length) : [];
  10062. baseEach(collection, function(value) {
  10063. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10064. });
  10065. return result;
  10066. });
  10067. /**
  10068. * Creates an object composed of keys generated from the results of running
  10069. * each element of `collection` thru `iteratee`. The corresponding value of
  10070. * each key is the last element responsible for generating the key. The
  10071. * iteratee is invoked with one argument: (value).
  10072. *
  10073. * @static
  10074. * @memberOf _
  10075. * @since 4.0.0
  10076. * @category Collection
  10077. * @param {Array|Object} collection The collection to iterate over.
  10078. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10079. * @returns {Object} Returns the composed aggregate object.
  10080. * @example
  10081. *
  10082. * var array = [
  10083. * { 'dir': 'left', 'code': 97 },
  10084. * { 'dir': 'right', 'code': 100 }
  10085. * ];
  10086. *
  10087. * _.keyBy(array, function(o) {
  10088. * return String.fromCharCode(o.code);
  10089. * });
  10090. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10091. *
  10092. * _.keyBy(array, 'dir');
  10093. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10094. */
  10095. var keyBy = createAggregator(function(result, value, key) {
  10096. baseAssignValue(result, key, value);
  10097. });
  10098. /**
  10099. * Creates an array of values by running each element in `collection` thru
  10100. * `iteratee`. The iteratee is invoked with three arguments:
  10101. * (value, index|key, collection).
  10102. *
  10103. * Many lodash methods are guarded to work as iteratees for methods like
  10104. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10105. *
  10106. * The guarded methods are:
  10107. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10108. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10109. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10110. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10111. *
  10112. * @static
  10113. * @memberOf _
  10114. * @since 0.1.0
  10115. * @category Collection
  10116. * @param {Array|Object} collection The collection to iterate over.
  10117. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10118. * @returns {Array} Returns the new mapped array.
  10119. * @example
  10120. *
  10121. * function square(n) {
  10122. * return n * n;
  10123. * }
  10124. *
  10125. * _.map([4, 8], square);
  10126. * // => [16, 64]
  10127. *
  10128. * _.map({ 'a': 4, 'b': 8 }, square);
  10129. * // => [16, 64] (iteration order is not guaranteed)
  10130. *
  10131. * var users = [
  10132. * { 'user': 'barney' },
  10133. * { 'user': 'fred' }
  10134. * ];
  10135. *
  10136. * // The `_.property` iteratee shorthand.
  10137. * _.map(users, 'user');
  10138. * // => ['barney', 'fred']
  10139. */
  10140. function map(collection, iteratee) {
  10141. var func = isArray(collection) ? arrayMap : baseMap;
  10142. return func(collection, getIteratee(iteratee, 3));
  10143. }
  10144. /**
  10145. * This method is like `_.sortBy` except that it allows specifying the sort
  10146. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10147. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10148. * descending or "asc" for ascending sort order of corresponding values.
  10149. *
  10150. * @static
  10151. * @memberOf _
  10152. * @since 4.0.0
  10153. * @category Collection
  10154. * @param {Array|Object} collection The collection to iterate over.
  10155. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10156. * The iteratees to sort by.
  10157. * @param {string[]} [orders] The sort orders of `iteratees`.
  10158. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10159. * @returns {Array} Returns the new sorted array.
  10160. * @example
  10161. *
  10162. * var users = [
  10163. * { 'user': 'fred', 'age': 48 },
  10164. * { 'user': 'barney', 'age': 34 },
  10165. * { 'user': 'fred', 'age': 40 },
  10166. * { 'user': 'barney', 'age': 36 }
  10167. * ];
  10168. *
  10169. * // Sort by `user` in ascending order and by `age` in descending order.
  10170. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10171. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10172. */
  10173. function orderBy(collection, iteratees, orders, guard) {
  10174. if (collection == null) {
  10175. return [];
  10176. }
  10177. if (!isArray(iteratees)) {
  10178. iteratees = iteratees == null ? [] : [iteratees];
  10179. }
  10180. orders = guard ? undefined : orders;
  10181. if (!isArray(orders)) {
  10182. orders = orders == null ? [] : [orders];
  10183. }
  10184. return baseOrderBy(collection, iteratees, orders);
  10185. }
  10186. /**
  10187. * Creates an array of elements split into two groups, the first of which
  10188. * contains elements `predicate` returns truthy for, the second of which
  10189. * contains elements `predicate` returns falsey for. The predicate is
  10190. * invoked with one argument: (value).
  10191. *
  10192. * @static
  10193. * @memberOf _
  10194. * @since 3.0.0
  10195. * @category Collection
  10196. * @param {Array|Object} collection The collection to iterate over.
  10197. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10198. * @returns {Array} Returns the array of grouped elements.
  10199. * @example
  10200. *
  10201. * var users = [
  10202. * { 'user': 'barney', 'age': 36, 'active': false },
  10203. * { 'user': 'fred', 'age': 40, 'active': true },
  10204. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10205. * ];
  10206. *
  10207. * _.partition(users, function(o) { return o.active; });
  10208. * // => objects for [['fred'], ['barney', 'pebbles']]
  10209. *
  10210. * // The `_.matches` iteratee shorthand.
  10211. * _.partition(users, { 'age': 1, 'active': false });
  10212. * // => objects for [['pebbles'], ['barney', 'fred']]
  10213. *
  10214. * // The `_.matchesProperty` iteratee shorthand.
  10215. * _.partition(users, ['active', false]);
  10216. * // => objects for [['barney', 'pebbles'], ['fred']]
  10217. *
  10218. * // The `_.property` iteratee shorthand.
  10219. * _.partition(users, 'active');
  10220. * // => objects for [['fred'], ['barney', 'pebbles']]
  10221. */
  10222. var partition = createAggregator(function(result, value, key) {
  10223. result[key ? 0 : 1].push(value);
  10224. }, function() { return [[], []]; });
  10225. /**
  10226. * Reduces `collection` to a value which is the accumulated result of running
  10227. * each element in `collection` thru `iteratee`, where each successive
  10228. * invocation is supplied the return value of the previous. If `accumulator`
  10229. * is not given, the first element of `collection` is used as the initial
  10230. * value. The iteratee is invoked with four arguments:
  10231. * (accumulator, value, index|key, collection).
  10232. *
  10233. * Many lodash methods are guarded to work as iteratees for methods like
  10234. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10235. *
  10236. * The guarded methods are:
  10237. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10238. * and `sortBy`
  10239. *
  10240. * @static
  10241. * @memberOf _
  10242. * @since 0.1.0
  10243. * @category Collection
  10244. * @param {Array|Object} collection The collection to iterate over.
  10245. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10246. * @param {*} [accumulator] The initial value.
  10247. * @returns {*} Returns the accumulated value.
  10248. * @see _.reduceRight
  10249. * @example
  10250. *
  10251. * _.reduce([1, 2], function(sum, n) {
  10252. * return sum + n;
  10253. * }, 0);
  10254. * // => 3
  10255. *
  10256. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10257. * (result[value] || (result[value] = [])).push(key);
  10258. * return result;
  10259. * }, {});
  10260. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10261. */
  10262. function reduce(collection, iteratee, accumulator) {
  10263. var func = isArray(collection) ? arrayReduce : baseReduce,
  10264. initAccum = arguments.length < 3;
  10265. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10266. }
  10267. /**
  10268. * This method is like `_.reduce` except that it iterates over elements of
  10269. * `collection` from right to left.
  10270. *
  10271. * @static
  10272. * @memberOf _
  10273. * @since 0.1.0
  10274. * @category Collection
  10275. * @param {Array|Object} collection The collection to iterate over.
  10276. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10277. * @param {*} [accumulator] The initial value.
  10278. * @returns {*} Returns the accumulated value.
  10279. * @see _.reduce
  10280. * @example
  10281. *
  10282. * var array = [[0, 1], [2, 3], [4, 5]];
  10283. *
  10284. * _.reduceRight(array, function(flattened, other) {
  10285. * return flattened.concat(other);
  10286. * }, []);
  10287. * // => [4, 5, 2, 3, 0, 1]
  10288. */
  10289. function reduceRight(collection, iteratee, accumulator) {
  10290. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10291. initAccum = arguments.length < 3;
  10292. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10293. }
  10294. /**
  10295. * The opposite of `_.filter`; this method returns the elements of `collection`
  10296. * that `predicate` does **not** return truthy for.
  10297. *
  10298. * @static
  10299. * @memberOf _
  10300. * @since 0.1.0
  10301. * @category Collection
  10302. * @param {Array|Object} collection The collection to iterate over.
  10303. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10304. * @returns {Array} Returns the new filtered array.
  10305. * @see _.filter
  10306. * @example
  10307. *
  10308. * var users = [
  10309. * { 'user': 'barney', 'age': 36, 'active': false },
  10310. * { 'user': 'fred', 'age': 40, 'active': true }
  10311. * ];
  10312. *
  10313. * _.reject(users, function(o) { return !o.active; });
  10314. * // => objects for ['fred']
  10315. *
  10316. * // The `_.matches` iteratee shorthand.
  10317. * _.reject(users, { 'age': 40, 'active': true });
  10318. * // => objects for ['barney']
  10319. *
  10320. * // The `_.matchesProperty` iteratee shorthand.
  10321. * _.reject(users, ['active', false]);
  10322. * // => objects for ['fred']
  10323. *
  10324. * // The `_.property` iteratee shorthand.
  10325. * _.reject(users, 'active');
  10326. * // => objects for ['barney']
  10327. */
  10328. function reject(collection, predicate) {
  10329. var func = isArray(collection) ? arrayFilter : baseFilter;
  10330. return func(collection, negate(getIteratee(predicate, 3)));
  10331. }
  10332. /**
  10333. * Gets a random element from `collection`.
  10334. *
  10335. * @static
  10336. * @memberOf _
  10337. * @since 2.0.0
  10338. * @category Collection
  10339. * @param {Array|Object} collection The collection to sample.
  10340. * @returns {*} Returns the random element.
  10341. * @example
  10342. *
  10343. * _.sample([1, 2, 3, 4]);
  10344. * // => 2
  10345. */
  10346. function sample(collection) {
  10347. var func = isArray(collection) ? arraySample : baseSample;
  10348. return func(collection);
  10349. }
  10350. /**
  10351. * Gets `n` random elements at unique keys from `collection` up to the
  10352. * size of `collection`.
  10353. *
  10354. * @static
  10355. * @memberOf _
  10356. * @since 4.0.0
  10357. * @category Collection
  10358. * @param {Array|Object} collection The collection to sample.
  10359. * @param {number} [n=1] The number of elements to sample.
  10360. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10361. * @returns {Array} Returns the random elements.
  10362. * @example
  10363. *
  10364. * _.sampleSize([1, 2, 3], 2);
  10365. * // => [3, 1]
  10366. *
  10367. * _.sampleSize([1, 2, 3], 4);
  10368. * // => [2, 3, 1]
  10369. */
  10370. function sampleSize(collection, n, guard) {
  10371. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10372. n = 1;
  10373. } else {
  10374. n = toInteger(n);
  10375. }
  10376. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10377. return func(collection, n);
  10378. }
  10379. /**
  10380. * Creates an array of shuffled values, using a version of the
  10381. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10382. *
  10383. * @static
  10384. * @memberOf _
  10385. * @since 0.1.0
  10386. * @category Collection
  10387. * @param {Array|Object} collection The collection to shuffle.
  10388. * @returns {Array} Returns the new shuffled array.
  10389. * @example
  10390. *
  10391. * _.shuffle([1, 2, 3, 4]);
  10392. * // => [4, 1, 3, 2]
  10393. */
  10394. function shuffle(collection) {
  10395. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10396. return func(collection);
  10397. }
  10398. /**
  10399. * Gets the size of `collection` by returning its length for array-like
  10400. * values or the number of own enumerable string keyed properties for objects.
  10401. *
  10402. * @static
  10403. * @memberOf _
  10404. * @since 0.1.0
  10405. * @category Collection
  10406. * @param {Array|Object|string} collection The collection to inspect.
  10407. * @returns {number} Returns the collection size.
  10408. * @example
  10409. *
  10410. * _.size([1, 2, 3]);
  10411. * // => 3
  10412. *
  10413. * _.size({ 'a': 1, 'b': 2 });
  10414. * // => 2
  10415. *
  10416. * _.size('pebbles');
  10417. * // => 7
  10418. */
  10419. function size(collection) {
  10420. if (collection == null) {
  10421. return 0;
  10422. }
  10423. if (isArrayLike(collection)) {
  10424. return isString(collection) ? stringSize(collection) : collection.length;
  10425. }
  10426. var tag = getTag(collection);
  10427. if (tag == mapTag || tag == setTag) {
  10428. return collection.size;
  10429. }
  10430. return baseKeys(collection).length;
  10431. }
  10432. /**
  10433. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10434. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10435. * invoked with three arguments: (value, index|key, collection).
  10436. *
  10437. * @static
  10438. * @memberOf _
  10439. * @since 0.1.0
  10440. * @category Collection
  10441. * @param {Array|Object} collection The collection to iterate over.
  10442. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10443. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10444. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10445. * else `false`.
  10446. * @example
  10447. *
  10448. * _.some([null, 0, 'yes', false], Boolean);
  10449. * // => true
  10450. *
  10451. * var users = [
  10452. * { 'user': 'barney', 'active': true },
  10453. * { 'user': 'fred', 'active': false }
  10454. * ];
  10455. *
  10456. * // The `_.matches` iteratee shorthand.
  10457. * _.some(users, { 'user': 'barney', 'active': false });
  10458. * // => false
  10459. *
  10460. * // The `_.matchesProperty` iteratee shorthand.
  10461. * _.some(users, ['active', false]);
  10462. * // => true
  10463. *
  10464. * // The `_.property` iteratee shorthand.
  10465. * _.some(users, 'active');
  10466. * // => true
  10467. */
  10468. function some(collection, predicate, guard) {
  10469. var func = isArray(collection) ? arraySome : baseSome;
  10470. if (guard && isIterateeCall(collection, predicate, guard)) {
  10471. predicate = undefined;
  10472. }
  10473. return func(collection, getIteratee(predicate, 3));
  10474. }
  10475. /**
  10476. * Creates an array of elements, sorted in ascending order by the results of
  10477. * running each element in a collection thru each iteratee. This method
  10478. * performs a stable sort, that is, it preserves the original sort order of
  10479. * equal elements. The iteratees are invoked with one argument: (value).
  10480. *
  10481. * @static
  10482. * @memberOf _
  10483. * @since 0.1.0
  10484. * @category Collection
  10485. * @param {Array|Object} collection The collection to iterate over.
  10486. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10487. * The iteratees to sort by.
  10488. * @returns {Array} Returns the new sorted array.
  10489. * @example
  10490. *
  10491. * var users = [
  10492. * { 'user': 'fred', 'age': 48 },
  10493. * { 'user': 'barney', 'age': 36 },
  10494. * { 'user': 'fred', 'age': 30 },
  10495. * { 'user': 'barney', 'age': 34 }
  10496. * ];
  10497. *
  10498. * _.sortBy(users, [function(o) { return o.user; }]);
  10499. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10500. *
  10501. * _.sortBy(users, ['user', 'age']);
  10502. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10503. */
  10504. var sortBy = baseRest(function(collection, iteratees) {
  10505. if (collection == null) {
  10506. return [];
  10507. }
  10508. var length = iteratees.length;
  10509. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10510. iteratees = [];
  10511. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10512. iteratees = [iteratees[0]];
  10513. }
  10514. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10515. });
  10516. /*------------------------------------------------------------------------*/
  10517. /**
  10518. * Gets the timestamp of the number of milliseconds that have elapsed since
  10519. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10520. *
  10521. * @static
  10522. * @memberOf _
  10523. * @since 2.4.0
  10524. * @category Date
  10525. * @returns {number} Returns the timestamp.
  10526. * @example
  10527. *
  10528. * _.defer(function(stamp) {
  10529. * console.log(_.now() - stamp);
  10530. * }, _.now());
  10531. * // => Logs the number of milliseconds it took for the deferred invocation.
  10532. */
  10533. var now = ctxNow || function() {
  10534. return root.Date.now();
  10535. };
  10536. /*------------------------------------------------------------------------*/
  10537. /**
  10538. * The opposite of `_.before`; this method creates a function that invokes
  10539. * `func` once it's called `n` or more times.
  10540. *
  10541. * @static
  10542. * @memberOf _
  10543. * @since 0.1.0
  10544. * @category Function
  10545. * @param {number} n The number of calls before `func` is invoked.
  10546. * @param {Function} func The function to restrict.
  10547. * @returns {Function} Returns the new restricted function.
  10548. * @example
  10549. *
  10550. * var saves = ['profile', 'settings'];
  10551. *
  10552. * var done = _.after(saves.length, function() {
  10553. * console.log('done saving!');
  10554. * });
  10555. *
  10556. * _.forEach(saves, function(type) {
  10557. * asyncSave({ 'type': type, 'complete': done });
  10558. * });
  10559. * // => Logs 'done saving!' after the two async saves have completed.
  10560. */
  10561. function after(n, func) {
  10562. if (typeof func != 'function') {
  10563. throw new TypeError(FUNC_ERROR_TEXT);
  10564. }
  10565. n = toInteger(n);
  10566. return function() {
  10567. if (--n < 1) {
  10568. return func.apply(this, arguments);
  10569. }
  10570. };
  10571. }
  10572. /**
  10573. * Creates a function that invokes `func`, with up to `n` arguments,
  10574. * ignoring any additional arguments.
  10575. *
  10576. * @static
  10577. * @memberOf _
  10578. * @since 3.0.0
  10579. * @category Function
  10580. * @param {Function} func The function to cap arguments for.
  10581. * @param {number} [n=func.length] The arity cap.
  10582. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10583. * @returns {Function} Returns the new capped function.
  10584. * @example
  10585. *
  10586. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10587. * // => [6, 8, 10]
  10588. */
  10589. function ary(func, n, guard) {
  10590. n = guard ? undefined : n;
  10591. n = (func && n == null) ? func.length : n;
  10592. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10593. }
  10594. /**
  10595. * Creates a function that invokes `func`, with the `this` binding and arguments
  10596. * of the created function, while it's called less than `n` times. Subsequent
  10597. * calls to the created function return the result of the last `func` invocation.
  10598. *
  10599. * @static
  10600. * @memberOf _
  10601. * @since 3.0.0
  10602. * @category Function
  10603. * @param {number} n The number of calls at which `func` is no longer invoked.
  10604. * @param {Function} func The function to restrict.
  10605. * @returns {Function} Returns the new restricted function.
  10606. * @example
  10607. *
  10608. * jQuery(element).on('click', _.before(5, addContactToList));
  10609. * // => Allows adding up to 4 contacts to the list.
  10610. */
  10611. function before(n, func) {
  10612. var result;
  10613. if (typeof func != 'function') {
  10614. throw new TypeError(FUNC_ERROR_TEXT);
  10615. }
  10616. n = toInteger(n);
  10617. return function() {
  10618. if (--n > 0) {
  10619. result = func.apply(this, arguments);
  10620. }
  10621. if (n <= 1) {
  10622. func = undefined;
  10623. }
  10624. return result;
  10625. };
  10626. }
  10627. /**
  10628. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10629. * and `partials` prepended to the arguments it receives.
  10630. *
  10631. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10632. * may be used as a placeholder for partially applied arguments.
  10633. *
  10634. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10635. * property of bound functions.
  10636. *
  10637. * @static
  10638. * @memberOf _
  10639. * @since 0.1.0
  10640. * @category Function
  10641. * @param {Function} func The function to bind.
  10642. * @param {*} thisArg The `this` binding of `func`.
  10643. * @param {...*} [partials] The arguments to be partially applied.
  10644. * @returns {Function} Returns the new bound function.
  10645. * @example
  10646. *
  10647. * function greet(greeting, punctuation) {
  10648. * return greeting + ' ' + this.user + punctuation;
  10649. * }
  10650. *
  10651. * var object = { 'user': 'fred' };
  10652. *
  10653. * var bound = _.bind(greet, object, 'hi');
  10654. * bound('!');
  10655. * // => 'hi fred!'
  10656. *
  10657. * // Bound with placeholders.
  10658. * var bound = _.bind(greet, object, _, '!');
  10659. * bound('hi');
  10660. * // => 'hi fred!'
  10661. */
  10662. var bind = baseRest(function(func, thisArg, partials) {
  10663. var bitmask = WRAP_BIND_FLAG;
  10664. if (partials.length) {
  10665. var holders = replaceHolders(partials, getHolder(bind));
  10666. bitmask |= WRAP_PARTIAL_FLAG;
  10667. }
  10668. return createWrap(func, bitmask, thisArg, partials, holders);
  10669. });
  10670. /**
  10671. * Creates a function that invokes the method at `object[key]` with `partials`
  10672. * prepended to the arguments it receives.
  10673. *
  10674. * This method differs from `_.bind` by allowing bound functions to reference
  10675. * methods that may be redefined or don't yet exist. See
  10676. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10677. * for more details.
  10678. *
  10679. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10680. * builds, may be used as a placeholder for partially applied arguments.
  10681. *
  10682. * @static
  10683. * @memberOf _
  10684. * @since 0.10.0
  10685. * @category Function
  10686. * @param {Object} object The object to invoke the method on.
  10687. * @param {string} key The key of the method.
  10688. * @param {...*} [partials] The arguments to be partially applied.
  10689. * @returns {Function} Returns the new bound function.
  10690. * @example
  10691. *
  10692. * var object = {
  10693. * 'user': 'fred',
  10694. * 'greet': function(greeting, punctuation) {
  10695. * return greeting + ' ' + this.user + punctuation;
  10696. * }
  10697. * };
  10698. *
  10699. * var bound = _.bindKey(object, 'greet', 'hi');
  10700. * bound('!');
  10701. * // => 'hi fred!'
  10702. *
  10703. * object.greet = function(greeting, punctuation) {
  10704. * return greeting + 'ya ' + this.user + punctuation;
  10705. * };
  10706. *
  10707. * bound('!');
  10708. * // => 'hiya fred!'
  10709. *
  10710. * // Bound with placeholders.
  10711. * var bound = _.bindKey(object, 'greet', _, '!');
  10712. * bound('hi');
  10713. * // => 'hiya fred!'
  10714. */
  10715. var bindKey = baseRest(function(object, key, partials) {
  10716. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10717. if (partials.length) {
  10718. var holders = replaceHolders(partials, getHolder(bindKey));
  10719. bitmask |= WRAP_PARTIAL_FLAG;
  10720. }
  10721. return createWrap(key, bitmask, object, partials, holders);
  10722. });
  10723. /**
  10724. * Creates a function that accepts arguments of `func` and either invokes
  10725. * `func` returning its result, if at least `arity` number of arguments have
  10726. * been provided, or returns a function that accepts the remaining `func`
  10727. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10728. * is not sufficient.
  10729. *
  10730. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10731. * may be used as a placeholder for provided arguments.
  10732. *
  10733. * **Note:** This method doesn't set the "length" property of curried functions.
  10734. *
  10735. * @static
  10736. * @memberOf _
  10737. * @since 2.0.0
  10738. * @category Function
  10739. * @param {Function} func The function to curry.
  10740. * @param {number} [arity=func.length] The arity of `func`.
  10741. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10742. * @returns {Function} Returns the new curried function.
  10743. * @example
  10744. *
  10745. * var abc = function(a, b, c) {
  10746. * return [a, b, c];
  10747. * };
  10748. *
  10749. * var curried = _.curry(abc);
  10750. *
  10751. * curried(1)(2)(3);
  10752. * // => [1, 2, 3]
  10753. *
  10754. * curried(1, 2)(3);
  10755. * // => [1, 2, 3]
  10756. *
  10757. * curried(1, 2, 3);
  10758. * // => [1, 2, 3]
  10759. *
  10760. * // Curried with placeholders.
  10761. * curried(1)(_, 3)(2);
  10762. * // => [1, 2, 3]
  10763. */
  10764. function curry(func, arity, guard) {
  10765. arity = guard ? undefined : arity;
  10766. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10767. result.placeholder = curry.placeholder;
  10768. return result;
  10769. }
  10770. /**
  10771. * This method is like `_.curry` except that arguments are applied to `func`
  10772. * in the manner of `_.partialRight` instead of `_.partial`.
  10773. *
  10774. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10775. * builds, may be used as a placeholder for provided arguments.
  10776. *
  10777. * **Note:** This method doesn't set the "length" property of curried functions.
  10778. *
  10779. * @static
  10780. * @memberOf _
  10781. * @since 3.0.0
  10782. * @category Function
  10783. * @param {Function} func The function to curry.
  10784. * @param {number} [arity=func.length] The arity of `func`.
  10785. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10786. * @returns {Function} Returns the new curried function.
  10787. * @example
  10788. *
  10789. * var abc = function(a, b, c) {
  10790. * return [a, b, c];
  10791. * };
  10792. *
  10793. * var curried = _.curryRight(abc);
  10794. *
  10795. * curried(3)(2)(1);
  10796. * // => [1, 2, 3]
  10797. *
  10798. * curried(2, 3)(1);
  10799. * // => [1, 2, 3]
  10800. *
  10801. * curried(1, 2, 3);
  10802. * // => [1, 2, 3]
  10803. *
  10804. * // Curried with placeholders.
  10805. * curried(3)(1, _)(2);
  10806. * // => [1, 2, 3]
  10807. */
  10808. function curryRight(func, arity, guard) {
  10809. arity = guard ? undefined : arity;
  10810. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10811. result.placeholder = curryRight.placeholder;
  10812. return result;
  10813. }
  10814. /**
  10815. * Creates a debounced function that delays invoking `func` until after `wait`
  10816. * milliseconds have elapsed since the last time the debounced function was
  10817. * invoked. The debounced function comes with a `cancel` method to cancel
  10818. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10819. * Provide `options` to indicate whether `func` should be invoked on the
  10820. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10821. * with the last arguments provided to the debounced function. Subsequent
  10822. * calls to the debounced function return the result of the last `func`
  10823. * invocation.
  10824. *
  10825. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10826. * invoked on the trailing edge of the timeout only if the debounced function
  10827. * is invoked more than once during the `wait` timeout.
  10828. *
  10829. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10830. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10831. *
  10832. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10833. * for details over the differences between `_.debounce` and `_.throttle`.
  10834. *
  10835. * @static
  10836. * @memberOf _
  10837. * @since 0.1.0
  10838. * @category Function
  10839. * @param {Function} func The function to debounce.
  10840. * @param {number} [wait=0] The number of milliseconds to delay.
  10841. * @param {Object} [options={}] The options object.
  10842. * @param {boolean} [options.leading=false]
  10843. * Specify invoking on the leading edge of the timeout.
  10844. * @param {number} [options.maxWait]
  10845. * The maximum time `func` is allowed to be delayed before it's invoked.
  10846. * @param {boolean} [options.trailing=true]
  10847. * Specify invoking on the trailing edge of the timeout.
  10848. * @returns {Function} Returns the new debounced function.
  10849. * @example
  10850. *
  10851. * // Avoid costly calculations while the window size is in flux.
  10852. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10853. *
  10854. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10855. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10856. * 'leading': true,
  10857. * 'trailing': false
  10858. * }));
  10859. *
  10860. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10861. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10862. * var source = new EventSource('/stream');
  10863. * jQuery(source).on('message', debounced);
  10864. *
  10865. * // Cancel the trailing debounced invocation.
  10866. * jQuery(window).on('popstate', debounced.cancel);
  10867. */
  10868. function debounce(func, wait, options) {
  10869. var lastArgs,
  10870. lastThis,
  10871. maxWait,
  10872. result,
  10873. timerId,
  10874. lastCallTime,
  10875. lastInvokeTime = 0,
  10876. leading = false,
  10877. maxing = false,
  10878. trailing = true;
  10879. if (typeof func != 'function') {
  10880. throw new TypeError(FUNC_ERROR_TEXT);
  10881. }
  10882. wait = toNumber(wait) || 0;
  10883. if (isObject(options)) {
  10884. leading = !!options.leading;
  10885. maxing = 'maxWait' in options;
  10886. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10887. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10888. }
  10889. function invokeFunc(time) {
  10890. var args = lastArgs,
  10891. thisArg = lastThis;
  10892. lastArgs = lastThis = undefined;
  10893. lastInvokeTime = time;
  10894. result = func.apply(thisArg, args);
  10895. return result;
  10896. }
  10897. function leadingEdge(time) {
  10898. // Reset any `maxWait` timer.
  10899. lastInvokeTime = time;
  10900. // Start the timer for the trailing edge.
  10901. timerId = setTimeout(timerExpired, wait);
  10902. // Invoke the leading edge.
  10903. return leading ? invokeFunc(time) : result;
  10904. }
  10905. function remainingWait(time) {
  10906. var timeSinceLastCall = time - lastCallTime,
  10907. timeSinceLastInvoke = time - lastInvokeTime,
  10908. timeWaiting = wait - timeSinceLastCall;
  10909. return maxing
  10910. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10911. : timeWaiting;
  10912. }
  10913. function shouldInvoke(time) {
  10914. var timeSinceLastCall = time - lastCallTime,
  10915. timeSinceLastInvoke = time - lastInvokeTime;
  10916. // Either this is the first call, activity has stopped and we're at the
  10917. // trailing edge, the system time has gone backwards and we're treating
  10918. // it as the trailing edge, or we've hit the `maxWait` limit.
  10919. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10920. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10921. }
  10922. function timerExpired() {
  10923. var time = now();
  10924. if (shouldInvoke(time)) {
  10925. return trailingEdge(time);
  10926. }
  10927. // Restart the timer.
  10928. timerId = setTimeout(timerExpired, remainingWait(time));
  10929. }
  10930. function trailingEdge(time) {
  10931. timerId = undefined;
  10932. // Only invoke if we have `lastArgs` which means `func` has been
  10933. // debounced at least once.
  10934. if (trailing && lastArgs) {
  10935. return invokeFunc(time);
  10936. }
  10937. lastArgs = lastThis = undefined;
  10938. return result;
  10939. }
  10940. function cancel() {
  10941. if (timerId !== undefined) {
  10942. clearTimeout(timerId);
  10943. }
  10944. lastInvokeTime = 0;
  10945. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10946. }
  10947. function flush() {
  10948. return timerId === undefined ? result : trailingEdge(now());
  10949. }
  10950. function debounced() {
  10951. var time = now(),
  10952. isInvoking = shouldInvoke(time);
  10953. lastArgs = arguments;
  10954. lastThis = this;
  10955. lastCallTime = time;
  10956. if (isInvoking) {
  10957. if (timerId === undefined) {
  10958. return leadingEdge(lastCallTime);
  10959. }
  10960. if (maxing) {
  10961. // Handle invocations in a tight loop.
  10962. clearTimeout(timerId);
  10963. timerId = setTimeout(timerExpired, wait);
  10964. return invokeFunc(lastCallTime);
  10965. }
  10966. }
  10967. if (timerId === undefined) {
  10968. timerId = setTimeout(timerExpired, wait);
  10969. }
  10970. return result;
  10971. }
  10972. debounced.cancel = cancel;
  10973. debounced.flush = flush;
  10974. return debounced;
  10975. }
  10976. /**
  10977. * Defers invoking the `func` until the current call stack has cleared. Any
  10978. * additional arguments are provided to `func` when it's invoked.
  10979. *
  10980. * @static
  10981. * @memberOf _
  10982. * @since 0.1.0
  10983. * @category Function
  10984. * @param {Function} func The function to defer.
  10985. * @param {...*} [args] The arguments to invoke `func` with.
  10986. * @returns {number} Returns the timer id.
  10987. * @example
  10988. *
  10989. * _.defer(function(text) {
  10990. * console.log(text);
  10991. * }, 'deferred');
  10992. * // => Logs 'deferred' after one millisecond.
  10993. */
  10994. var defer = baseRest(function(func, args) {
  10995. return baseDelay(func, 1, args);
  10996. });
  10997. /**
  10998. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10999. * provided to `func` when it's invoked.
  11000. *
  11001. * @static
  11002. * @memberOf _
  11003. * @since 0.1.0
  11004. * @category Function
  11005. * @param {Function} func The function to delay.
  11006. * @param {number} wait The number of milliseconds to delay invocation.
  11007. * @param {...*} [args] The arguments to invoke `func` with.
  11008. * @returns {number} Returns the timer id.
  11009. * @example
  11010. *
  11011. * _.delay(function(text) {
  11012. * console.log(text);
  11013. * }, 1000, 'later');
  11014. * // => Logs 'later' after one second.
  11015. */
  11016. var delay = baseRest(function(func, wait, args) {
  11017. return baseDelay(func, toNumber(wait) || 0, args);
  11018. });
  11019. /**
  11020. * Creates a function that invokes `func` with arguments reversed.
  11021. *
  11022. * @static
  11023. * @memberOf _
  11024. * @since 4.0.0
  11025. * @category Function
  11026. * @param {Function} func The function to flip arguments for.
  11027. * @returns {Function} Returns the new flipped function.
  11028. * @example
  11029. *
  11030. * var flipped = _.flip(function() {
  11031. * return _.toArray(arguments);
  11032. * });
  11033. *
  11034. * flipped('a', 'b', 'c', 'd');
  11035. * // => ['d', 'c', 'b', 'a']
  11036. */
  11037. function flip(func) {
  11038. return createWrap(func, WRAP_FLIP_FLAG);
  11039. }
  11040. /**
  11041. * Creates a function that memoizes the result of `func`. If `resolver` is
  11042. * provided, it determines the cache key for storing the result based on the
  11043. * arguments provided to the memoized function. By default, the first argument
  11044. * provided to the memoized function is used as the map cache key. The `func`
  11045. * is invoked with the `this` binding of the memoized function.
  11046. *
  11047. * **Note:** The cache is exposed as the `cache` property on the memoized
  11048. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11049. * constructor with one whose instances implement the
  11050. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11051. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11052. *
  11053. * @static
  11054. * @memberOf _
  11055. * @since 0.1.0
  11056. * @category Function
  11057. * @param {Function} func The function to have its output memoized.
  11058. * @param {Function} [resolver] The function to resolve the cache key.
  11059. * @returns {Function} Returns the new memoized function.
  11060. * @example
  11061. *
  11062. * var object = { 'a': 1, 'b': 2 };
  11063. * var other = { 'c': 3, 'd': 4 };
  11064. *
  11065. * var values = _.memoize(_.values);
  11066. * values(object);
  11067. * // => [1, 2]
  11068. *
  11069. * values(other);
  11070. * // => [3, 4]
  11071. *
  11072. * object.a = 2;
  11073. * values(object);
  11074. * // => [1, 2]
  11075. *
  11076. * // Modify the result cache.
  11077. * values.cache.set(object, ['a', 'b']);
  11078. * values(object);
  11079. * // => ['a', 'b']
  11080. *
  11081. * // Replace `_.memoize.Cache`.
  11082. * _.memoize.Cache = WeakMap;
  11083. */
  11084. function memoize(func, resolver) {
  11085. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11086. throw new TypeError(FUNC_ERROR_TEXT);
  11087. }
  11088. var memoized = function() {
  11089. var args = arguments,
  11090. key = resolver ? resolver.apply(this, args) : args[0],
  11091. cache = memoized.cache;
  11092. if (cache.has(key)) {
  11093. return cache.get(key);
  11094. }
  11095. var result = func.apply(this, args);
  11096. memoized.cache = cache.set(key, result) || cache;
  11097. return result;
  11098. };
  11099. memoized.cache = new (memoize.Cache || MapCache);
  11100. return memoized;
  11101. }
  11102. // Expose `MapCache`.
  11103. memoize.Cache = MapCache;
  11104. /**
  11105. * Creates a function that negates the result of the predicate `func`. The
  11106. * `func` predicate is invoked with the `this` binding and arguments of the
  11107. * created function.
  11108. *
  11109. * @static
  11110. * @memberOf _
  11111. * @since 3.0.0
  11112. * @category Function
  11113. * @param {Function} predicate The predicate to negate.
  11114. * @returns {Function} Returns the new negated function.
  11115. * @example
  11116. *
  11117. * function isEven(n) {
  11118. * return n % 2 == 0;
  11119. * }
  11120. *
  11121. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11122. * // => [1, 3, 5]
  11123. */
  11124. function negate(predicate) {
  11125. if (typeof predicate != 'function') {
  11126. throw new TypeError(FUNC_ERROR_TEXT);
  11127. }
  11128. return function() {
  11129. var args = arguments;
  11130. switch (args.length) {
  11131. case 0: return !predicate.call(this);
  11132. case 1: return !predicate.call(this, args[0]);
  11133. case 2: return !predicate.call(this, args[0], args[1]);
  11134. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11135. }
  11136. return !predicate.apply(this, args);
  11137. };
  11138. }
  11139. /**
  11140. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11141. * to the function return the value of the first invocation. The `func` is
  11142. * invoked with the `this` binding and arguments of the created function.
  11143. *
  11144. * @static
  11145. * @memberOf _
  11146. * @since 0.1.0
  11147. * @category Function
  11148. * @param {Function} func The function to restrict.
  11149. * @returns {Function} Returns the new restricted function.
  11150. * @example
  11151. *
  11152. * var initialize = _.once(createApplication);
  11153. * initialize();
  11154. * initialize();
  11155. * // => `createApplication` is invoked once
  11156. */
  11157. function once(func) {
  11158. return before(2, func);
  11159. }
  11160. /**
  11161. * Creates a function that invokes `func` with its arguments transformed.
  11162. *
  11163. * @static
  11164. * @since 4.0.0
  11165. * @memberOf _
  11166. * @category Function
  11167. * @param {Function} func The function to wrap.
  11168. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11169. * The argument transforms.
  11170. * @returns {Function} Returns the new function.
  11171. * @example
  11172. *
  11173. * function doubled(n) {
  11174. * return n * 2;
  11175. * }
  11176. *
  11177. * function square(n) {
  11178. * return n * n;
  11179. * }
  11180. *
  11181. * var func = _.overArgs(function(x, y) {
  11182. * return [x, y];
  11183. * }, [square, doubled]);
  11184. *
  11185. * func(9, 3);
  11186. * // => [81, 6]
  11187. *
  11188. * func(10, 5);
  11189. * // => [100, 10]
  11190. */
  11191. var overArgs = castRest(function(func, transforms) {
  11192. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11193. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11194. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11195. var funcsLength = transforms.length;
  11196. return baseRest(function(args) {
  11197. var index = -1,
  11198. length = nativeMin(args.length, funcsLength);
  11199. while (++index < length) {
  11200. args[index] = transforms[index].call(this, args[index]);
  11201. }
  11202. return apply(func, this, args);
  11203. });
  11204. });
  11205. /**
  11206. * Creates a function that invokes `func` with `partials` prepended to the
  11207. * arguments it receives. This method is like `_.bind` except it does **not**
  11208. * alter the `this` binding.
  11209. *
  11210. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11211. * builds, may be used as a placeholder for partially applied arguments.
  11212. *
  11213. * **Note:** This method doesn't set the "length" property of partially
  11214. * applied functions.
  11215. *
  11216. * @static
  11217. * @memberOf _
  11218. * @since 0.2.0
  11219. * @category Function
  11220. * @param {Function} func The function to partially apply arguments to.
  11221. * @param {...*} [partials] The arguments to be partially applied.
  11222. * @returns {Function} Returns the new partially applied function.
  11223. * @example
  11224. *
  11225. * function greet(greeting, name) {
  11226. * return greeting + ' ' + name;
  11227. * }
  11228. *
  11229. * var sayHelloTo = _.partial(greet, 'hello');
  11230. * sayHelloTo('fred');
  11231. * // => 'hello fred'
  11232. *
  11233. * // Partially applied with placeholders.
  11234. * var greetFred = _.partial(greet, _, 'fred');
  11235. * greetFred('hi');
  11236. * // => 'hi fred'
  11237. */
  11238. var partial = baseRest(function(func, partials) {
  11239. var holders = replaceHolders(partials, getHolder(partial));
  11240. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11241. });
  11242. /**
  11243. * This method is like `_.partial` except that partially applied arguments
  11244. * are appended to the arguments it receives.
  11245. *
  11246. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11247. * builds, may be used as a placeholder for partially applied arguments.
  11248. *
  11249. * **Note:** This method doesn't set the "length" property of partially
  11250. * applied functions.
  11251. *
  11252. * @static
  11253. * @memberOf _
  11254. * @since 1.0.0
  11255. * @category Function
  11256. * @param {Function} func The function to partially apply arguments to.
  11257. * @param {...*} [partials] The arguments to be partially applied.
  11258. * @returns {Function} Returns the new partially applied function.
  11259. * @example
  11260. *
  11261. * function greet(greeting, name) {
  11262. * return greeting + ' ' + name;
  11263. * }
  11264. *
  11265. * var greetFred = _.partialRight(greet, 'fred');
  11266. * greetFred('hi');
  11267. * // => 'hi fred'
  11268. *
  11269. * // Partially applied with placeholders.
  11270. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11271. * sayHelloTo('fred');
  11272. * // => 'hello fred'
  11273. */
  11274. var partialRight = baseRest(function(func, partials) {
  11275. var holders = replaceHolders(partials, getHolder(partialRight));
  11276. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11277. });
  11278. /**
  11279. * Creates a function that invokes `func` with arguments arranged according
  11280. * to the specified `indexes` where the argument value at the first index is
  11281. * provided as the first argument, the argument value at the second index is
  11282. * provided as the second argument, and so on.
  11283. *
  11284. * @static
  11285. * @memberOf _
  11286. * @since 3.0.0
  11287. * @category Function
  11288. * @param {Function} func The function to rearrange arguments for.
  11289. * @param {...(number|number[])} indexes The arranged argument indexes.
  11290. * @returns {Function} Returns the new function.
  11291. * @example
  11292. *
  11293. * var rearged = _.rearg(function(a, b, c) {
  11294. * return [a, b, c];
  11295. * }, [2, 0, 1]);
  11296. *
  11297. * rearged('b', 'c', 'a')
  11298. * // => ['a', 'b', 'c']
  11299. */
  11300. var rearg = flatRest(function(func, indexes) {
  11301. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11302. });
  11303. /**
  11304. * Creates a function that invokes `func` with the `this` binding of the
  11305. * created function and arguments from `start` and beyond provided as
  11306. * an array.
  11307. *
  11308. * **Note:** This method is based on the
  11309. * [rest parameter](https://mdn.io/rest_parameters).
  11310. *
  11311. * @static
  11312. * @memberOf _
  11313. * @since 4.0.0
  11314. * @category Function
  11315. * @param {Function} func The function to apply a rest parameter to.
  11316. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11317. * @returns {Function} Returns the new function.
  11318. * @example
  11319. *
  11320. * var say = _.rest(function(what, names) {
  11321. * return what + ' ' + _.initial(names).join(', ') +
  11322. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11323. * });
  11324. *
  11325. * say('hello', 'fred', 'barney', 'pebbles');
  11326. * // => 'hello fred, barney, & pebbles'
  11327. */
  11328. function rest(func, start) {
  11329. if (typeof func != 'function') {
  11330. throw new TypeError(FUNC_ERROR_TEXT);
  11331. }
  11332. start = start === undefined ? start : toInteger(start);
  11333. return baseRest(func, start);
  11334. }
  11335. /**
  11336. * Creates a function that invokes `func` with the `this` binding of the
  11337. * create function and an array of arguments much like
  11338. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11339. *
  11340. * **Note:** This method is based on the
  11341. * [spread operator](https://mdn.io/spread_operator).
  11342. *
  11343. * @static
  11344. * @memberOf _
  11345. * @since 3.2.0
  11346. * @category Function
  11347. * @param {Function} func The function to spread arguments over.
  11348. * @param {number} [start=0] The start position of the spread.
  11349. * @returns {Function} Returns the new function.
  11350. * @example
  11351. *
  11352. * var say = _.spread(function(who, what) {
  11353. * return who + ' says ' + what;
  11354. * });
  11355. *
  11356. * say(['fred', 'hello']);
  11357. * // => 'fred says hello'
  11358. *
  11359. * var numbers = Promise.all([
  11360. * Promise.resolve(40),
  11361. * Promise.resolve(36)
  11362. * ]);
  11363. *
  11364. * numbers.then(_.spread(function(x, y) {
  11365. * return x + y;
  11366. * }));
  11367. * // => a Promise of 76
  11368. */
  11369. function spread(func, start) {
  11370. if (typeof func != 'function') {
  11371. throw new TypeError(FUNC_ERROR_TEXT);
  11372. }
  11373. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11374. return baseRest(function(args) {
  11375. var array = args[start],
  11376. otherArgs = castSlice(args, 0, start);
  11377. if (array) {
  11378. arrayPush(otherArgs, array);
  11379. }
  11380. return apply(func, this, otherArgs);
  11381. });
  11382. }
  11383. /**
  11384. * Creates a throttled function that only invokes `func` at most once per
  11385. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11386. * method to cancel delayed `func` invocations and a `flush` method to
  11387. * immediately invoke them. Provide `options` to indicate whether `func`
  11388. * should be invoked on the leading and/or trailing edge of the `wait`
  11389. * timeout. The `func` is invoked with the last arguments provided to the
  11390. * throttled function. Subsequent calls to the throttled function return the
  11391. * result of the last `func` invocation.
  11392. *
  11393. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11394. * invoked on the trailing edge of the timeout only if the throttled function
  11395. * is invoked more than once during the `wait` timeout.
  11396. *
  11397. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11398. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11399. *
  11400. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11401. * for details over the differences between `_.throttle` and `_.debounce`.
  11402. *
  11403. * @static
  11404. * @memberOf _
  11405. * @since 0.1.0
  11406. * @category Function
  11407. * @param {Function} func The function to throttle.
  11408. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11409. * @param {Object} [options={}] The options object.
  11410. * @param {boolean} [options.leading=true]
  11411. * Specify invoking on the leading edge of the timeout.
  11412. * @param {boolean} [options.trailing=true]
  11413. * Specify invoking on the trailing edge of the timeout.
  11414. * @returns {Function} Returns the new throttled function.
  11415. * @example
  11416. *
  11417. * // Avoid excessively updating the position while scrolling.
  11418. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11419. *
  11420. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11421. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11422. * jQuery(element).on('click', throttled);
  11423. *
  11424. * // Cancel the trailing throttled invocation.
  11425. * jQuery(window).on('popstate', throttled.cancel);
  11426. */
  11427. function throttle(func, wait, options) {
  11428. var leading = true,
  11429. trailing = true;
  11430. if (typeof func != 'function') {
  11431. throw new TypeError(FUNC_ERROR_TEXT);
  11432. }
  11433. if (isObject(options)) {
  11434. leading = 'leading' in options ? !!options.leading : leading;
  11435. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11436. }
  11437. return debounce(func, wait, {
  11438. 'leading': leading,
  11439. 'maxWait': wait,
  11440. 'trailing': trailing
  11441. });
  11442. }
  11443. /**
  11444. * Creates a function that accepts up to one argument, ignoring any
  11445. * additional arguments.
  11446. *
  11447. * @static
  11448. * @memberOf _
  11449. * @since 4.0.0
  11450. * @category Function
  11451. * @param {Function} func The function to cap arguments for.
  11452. * @returns {Function} Returns the new capped function.
  11453. * @example
  11454. *
  11455. * _.map(['6', '8', '10'], _.unary(parseInt));
  11456. * // => [6, 8, 10]
  11457. */
  11458. function unary(func) {
  11459. return ary(func, 1);
  11460. }
  11461. /**
  11462. * Creates a function that provides `value` to `wrapper` as its first
  11463. * argument. Any additional arguments provided to the function are appended
  11464. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11465. * binding of the created function.
  11466. *
  11467. * @static
  11468. * @memberOf _
  11469. * @since 0.1.0
  11470. * @category Function
  11471. * @param {*} value The value to wrap.
  11472. * @param {Function} [wrapper=identity] The wrapper function.
  11473. * @returns {Function} Returns the new function.
  11474. * @example
  11475. *
  11476. * var p = _.wrap(_.escape, function(func, text) {
  11477. * return '<p>' + func(text) + '</p>';
  11478. * });
  11479. *
  11480. * p('fred, barney, & pebbles');
  11481. * // => '<p>fred, barney, &amp; pebbles</p>'
  11482. */
  11483. function wrap(value, wrapper) {
  11484. return partial(castFunction(wrapper), value);
  11485. }
  11486. /*------------------------------------------------------------------------*/
  11487. /**
  11488. * Casts `value` as an array if it's not one.
  11489. *
  11490. * @static
  11491. * @memberOf _
  11492. * @since 4.4.0
  11493. * @category Lang
  11494. * @param {*} value The value to inspect.
  11495. * @returns {Array} Returns the cast array.
  11496. * @example
  11497. *
  11498. * _.castArray(1);
  11499. * // => [1]
  11500. *
  11501. * _.castArray({ 'a': 1 });
  11502. * // => [{ 'a': 1 }]
  11503. *
  11504. * _.castArray('abc');
  11505. * // => ['abc']
  11506. *
  11507. * _.castArray(null);
  11508. * // => [null]
  11509. *
  11510. * _.castArray(undefined);
  11511. * // => [undefined]
  11512. *
  11513. * _.castArray();
  11514. * // => []
  11515. *
  11516. * var array = [1, 2, 3];
  11517. * console.log(_.castArray(array) === array);
  11518. * // => true
  11519. */
  11520. function castArray() {
  11521. if (!arguments.length) {
  11522. return [];
  11523. }
  11524. var value = arguments[0];
  11525. return isArray(value) ? value : [value];
  11526. }
  11527. /**
  11528. * Creates a shallow clone of `value`.
  11529. *
  11530. * **Note:** This method is loosely based on the
  11531. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11532. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11533. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11534. * arrays. The own enumerable properties of `arguments` objects are cloned
  11535. * as plain objects. An empty object is returned for uncloneable values such
  11536. * as error objects, functions, DOM nodes, and WeakMaps.
  11537. *
  11538. * @static
  11539. * @memberOf _
  11540. * @since 0.1.0
  11541. * @category Lang
  11542. * @param {*} value The value to clone.
  11543. * @returns {*} Returns the cloned value.
  11544. * @see _.cloneDeep
  11545. * @example
  11546. *
  11547. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11548. *
  11549. * var shallow = _.clone(objects);
  11550. * console.log(shallow[0] === objects[0]);
  11551. * // => true
  11552. */
  11553. function clone(value) {
  11554. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11555. }
  11556. /**
  11557. * This method is like `_.clone` except that it accepts `customizer` which
  11558. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11559. * cloning is handled by the method instead. The `customizer` is invoked with
  11560. * up to four arguments; (value [, index|key, object, stack]).
  11561. *
  11562. * @static
  11563. * @memberOf _
  11564. * @since 4.0.0
  11565. * @category Lang
  11566. * @param {*} value The value to clone.
  11567. * @param {Function} [customizer] The function to customize cloning.
  11568. * @returns {*} Returns the cloned value.
  11569. * @see _.cloneDeepWith
  11570. * @example
  11571. *
  11572. * function customizer(value) {
  11573. * if (_.isElement(value)) {
  11574. * return value.cloneNode(false);
  11575. * }
  11576. * }
  11577. *
  11578. * var el = _.cloneWith(document.body, customizer);
  11579. *
  11580. * console.log(el === document.body);
  11581. * // => false
  11582. * console.log(el.nodeName);
  11583. * // => 'BODY'
  11584. * console.log(el.childNodes.length);
  11585. * // => 0
  11586. */
  11587. function cloneWith(value, customizer) {
  11588. customizer = typeof customizer == 'function' ? customizer : undefined;
  11589. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11590. }
  11591. /**
  11592. * This method is like `_.clone` except that it recursively clones `value`.
  11593. *
  11594. * @static
  11595. * @memberOf _
  11596. * @since 1.0.0
  11597. * @category Lang
  11598. * @param {*} value The value to recursively clone.
  11599. * @returns {*} Returns the deep cloned value.
  11600. * @see _.clone
  11601. * @example
  11602. *
  11603. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11604. *
  11605. * var deep = _.cloneDeep(objects);
  11606. * console.log(deep[0] === objects[0]);
  11607. * // => false
  11608. */
  11609. function cloneDeep(value) {
  11610. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11611. }
  11612. /**
  11613. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11614. *
  11615. * @static
  11616. * @memberOf _
  11617. * @since 4.0.0
  11618. * @category Lang
  11619. * @param {*} value The value to recursively clone.
  11620. * @param {Function} [customizer] The function to customize cloning.
  11621. * @returns {*} Returns the deep cloned value.
  11622. * @see _.cloneWith
  11623. * @example
  11624. *
  11625. * function customizer(value) {
  11626. * if (_.isElement(value)) {
  11627. * return value.cloneNode(true);
  11628. * }
  11629. * }
  11630. *
  11631. * var el = _.cloneDeepWith(document.body, customizer);
  11632. *
  11633. * console.log(el === document.body);
  11634. * // => false
  11635. * console.log(el.nodeName);
  11636. * // => 'BODY'
  11637. * console.log(el.childNodes.length);
  11638. * // => 20
  11639. */
  11640. function cloneDeepWith(value, customizer) {
  11641. customizer = typeof customizer == 'function' ? customizer : undefined;
  11642. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11643. }
  11644. /**
  11645. * Checks if `object` conforms to `source` by invoking the predicate
  11646. * properties of `source` with the corresponding property values of `object`.
  11647. *
  11648. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11649. * partially applied.
  11650. *
  11651. * @static
  11652. * @memberOf _
  11653. * @since 4.14.0
  11654. * @category Lang
  11655. * @param {Object} object The object to inspect.
  11656. * @param {Object} source The object of property predicates to conform to.
  11657. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11658. * @example
  11659. *
  11660. * var object = { 'a': 1, 'b': 2 };
  11661. *
  11662. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11663. * // => true
  11664. *
  11665. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11666. * // => false
  11667. */
  11668. function conformsTo(object, source) {
  11669. return source == null || baseConformsTo(object, source, keys(source));
  11670. }
  11671. /**
  11672. * Performs a
  11673. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11674. * comparison between two values to determine if they are equivalent.
  11675. *
  11676. * @static
  11677. * @memberOf _
  11678. * @since 4.0.0
  11679. * @category Lang
  11680. * @param {*} value The value to compare.
  11681. * @param {*} other The other value to compare.
  11682. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11683. * @example
  11684. *
  11685. * var object = { 'a': 1 };
  11686. * var other = { 'a': 1 };
  11687. *
  11688. * _.eq(object, object);
  11689. * // => true
  11690. *
  11691. * _.eq(object, other);
  11692. * // => false
  11693. *
  11694. * _.eq('a', 'a');
  11695. * // => true
  11696. *
  11697. * _.eq('a', Object('a'));
  11698. * // => false
  11699. *
  11700. * _.eq(NaN, NaN);
  11701. * // => true
  11702. */
  11703. function eq(value, other) {
  11704. return value === other || (value !== value && other !== other);
  11705. }
  11706. /**
  11707. * Checks if `value` is greater than `other`.
  11708. *
  11709. * @static
  11710. * @memberOf _
  11711. * @since 3.9.0
  11712. * @category Lang
  11713. * @param {*} value The value to compare.
  11714. * @param {*} other The other value to compare.
  11715. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11716. * else `false`.
  11717. * @see _.lt
  11718. * @example
  11719. *
  11720. * _.gt(3, 1);
  11721. * // => true
  11722. *
  11723. * _.gt(3, 3);
  11724. * // => false
  11725. *
  11726. * _.gt(1, 3);
  11727. * // => false
  11728. */
  11729. var gt = createRelationalOperation(baseGt);
  11730. /**
  11731. * Checks if `value` is greater than or equal to `other`.
  11732. *
  11733. * @static
  11734. * @memberOf _
  11735. * @since 3.9.0
  11736. * @category Lang
  11737. * @param {*} value The value to compare.
  11738. * @param {*} other The other value to compare.
  11739. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11740. * `other`, else `false`.
  11741. * @see _.lte
  11742. * @example
  11743. *
  11744. * _.gte(3, 1);
  11745. * // => true
  11746. *
  11747. * _.gte(3, 3);
  11748. * // => true
  11749. *
  11750. * _.gte(1, 3);
  11751. * // => false
  11752. */
  11753. var gte = createRelationalOperation(function(value, other) {
  11754. return value >= other;
  11755. });
  11756. /**
  11757. * Checks if `value` is likely an `arguments` object.
  11758. *
  11759. * @static
  11760. * @memberOf _
  11761. * @since 0.1.0
  11762. * @category Lang
  11763. * @param {*} value The value to check.
  11764. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11765. * else `false`.
  11766. * @example
  11767. *
  11768. * _.isArguments(function() { return arguments; }());
  11769. * // => true
  11770. *
  11771. * _.isArguments([1, 2, 3]);
  11772. * // => false
  11773. */
  11774. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11775. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11776. !propertyIsEnumerable.call(value, 'callee');
  11777. };
  11778. /**
  11779. * Checks if `value` is classified as an `Array` object.
  11780. *
  11781. * @static
  11782. * @memberOf _
  11783. * @since 0.1.0
  11784. * @category Lang
  11785. * @param {*} value The value to check.
  11786. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11787. * @example
  11788. *
  11789. * _.isArray([1, 2, 3]);
  11790. * // => true
  11791. *
  11792. * _.isArray(document.body.children);
  11793. * // => false
  11794. *
  11795. * _.isArray('abc');
  11796. * // => false
  11797. *
  11798. * _.isArray(_.noop);
  11799. * // => false
  11800. */
  11801. var isArray = Array.isArray;
  11802. /**
  11803. * Checks if `value` is classified as an `ArrayBuffer` object.
  11804. *
  11805. * @static
  11806. * @memberOf _
  11807. * @since 4.3.0
  11808. * @category Lang
  11809. * @param {*} value The value to check.
  11810. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11811. * @example
  11812. *
  11813. * _.isArrayBuffer(new ArrayBuffer(2));
  11814. * // => true
  11815. *
  11816. * _.isArrayBuffer(new Array(2));
  11817. * // => false
  11818. */
  11819. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11820. /**
  11821. * Checks if `value` is array-like. A value is considered array-like if it's
  11822. * not a function and has a `value.length` that's an integer greater than or
  11823. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11824. *
  11825. * @static
  11826. * @memberOf _
  11827. * @since 4.0.0
  11828. * @category Lang
  11829. * @param {*} value The value to check.
  11830. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11831. * @example
  11832. *
  11833. * _.isArrayLike([1, 2, 3]);
  11834. * // => true
  11835. *
  11836. * _.isArrayLike(document.body.children);
  11837. * // => true
  11838. *
  11839. * _.isArrayLike('abc');
  11840. * // => true
  11841. *
  11842. * _.isArrayLike(_.noop);
  11843. * // => false
  11844. */
  11845. function isArrayLike(value) {
  11846. return value != null && isLength(value.length) && !isFunction(value);
  11847. }
  11848. /**
  11849. * This method is like `_.isArrayLike` except that it also checks if `value`
  11850. * is an object.
  11851. *
  11852. * @static
  11853. * @memberOf _
  11854. * @since 4.0.0
  11855. * @category Lang
  11856. * @param {*} value The value to check.
  11857. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11858. * else `false`.
  11859. * @example
  11860. *
  11861. * _.isArrayLikeObject([1, 2, 3]);
  11862. * // => true
  11863. *
  11864. * _.isArrayLikeObject(document.body.children);
  11865. * // => true
  11866. *
  11867. * _.isArrayLikeObject('abc');
  11868. * // => false
  11869. *
  11870. * _.isArrayLikeObject(_.noop);
  11871. * // => false
  11872. */
  11873. function isArrayLikeObject(value) {
  11874. return isObjectLike(value) && isArrayLike(value);
  11875. }
  11876. /**
  11877. * Checks if `value` is classified as a boolean primitive or object.
  11878. *
  11879. * @static
  11880. * @memberOf _
  11881. * @since 0.1.0
  11882. * @category Lang
  11883. * @param {*} value The value to check.
  11884. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11885. * @example
  11886. *
  11887. * _.isBoolean(false);
  11888. * // => true
  11889. *
  11890. * _.isBoolean(null);
  11891. * // => false
  11892. */
  11893. function isBoolean(value) {
  11894. return value === true || value === false ||
  11895. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11896. }
  11897. /**
  11898. * Checks if `value` is a buffer.
  11899. *
  11900. * @static
  11901. * @memberOf _
  11902. * @since 4.3.0
  11903. * @category Lang
  11904. * @param {*} value The value to check.
  11905. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11906. * @example
  11907. *
  11908. * _.isBuffer(new Buffer(2));
  11909. * // => true
  11910. *
  11911. * _.isBuffer(new Uint8Array(2));
  11912. * // => false
  11913. */
  11914. var isBuffer = nativeIsBuffer || stubFalse;
  11915. /**
  11916. * Checks if `value` is classified as a `Date` object.
  11917. *
  11918. * @static
  11919. * @memberOf _
  11920. * @since 0.1.0
  11921. * @category Lang
  11922. * @param {*} value The value to check.
  11923. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11924. * @example
  11925. *
  11926. * _.isDate(new Date);
  11927. * // => true
  11928. *
  11929. * _.isDate('Mon April 23 2012');
  11930. * // => false
  11931. */
  11932. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11933. /**
  11934. * Checks if `value` is likely a DOM element.
  11935. *
  11936. * @static
  11937. * @memberOf _
  11938. * @since 0.1.0
  11939. * @category Lang
  11940. * @param {*} value The value to check.
  11941. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11942. * @example
  11943. *
  11944. * _.isElement(document.body);
  11945. * // => true
  11946. *
  11947. * _.isElement('<body>');
  11948. * // => false
  11949. */
  11950. function isElement(value) {
  11951. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11952. }
  11953. /**
  11954. * Checks if `value` is an empty object, collection, map, or set.
  11955. *
  11956. * Objects are considered empty if they have no own enumerable string keyed
  11957. * properties.
  11958. *
  11959. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11960. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11961. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11962. *
  11963. * @static
  11964. * @memberOf _
  11965. * @since 0.1.0
  11966. * @category Lang
  11967. * @param {*} value The value to check.
  11968. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11969. * @example
  11970. *
  11971. * _.isEmpty(null);
  11972. * // => true
  11973. *
  11974. * _.isEmpty(true);
  11975. * // => true
  11976. *
  11977. * _.isEmpty(1);
  11978. * // => true
  11979. *
  11980. * _.isEmpty([1, 2, 3]);
  11981. * // => false
  11982. *
  11983. * _.isEmpty({ 'a': 1 });
  11984. * // => false
  11985. */
  11986. function isEmpty(value) {
  11987. if (value == null) {
  11988. return true;
  11989. }
  11990. if (isArrayLike(value) &&
  11991. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11992. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11993. return !value.length;
  11994. }
  11995. var tag = getTag(value);
  11996. if (tag == mapTag || tag == setTag) {
  11997. return !value.size;
  11998. }
  11999. if (isPrototype(value)) {
  12000. return !baseKeys(value).length;
  12001. }
  12002. for (var key in value) {
  12003. if (hasOwnProperty.call(value, key)) {
  12004. return false;
  12005. }
  12006. }
  12007. return true;
  12008. }
  12009. /**
  12010. * Performs a deep comparison between two values to determine if they are
  12011. * equivalent.
  12012. *
  12013. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12014. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12015. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12016. * by their own, not inherited, enumerable properties. Functions and DOM
  12017. * nodes are compared by strict equality, i.e. `===`.
  12018. *
  12019. * @static
  12020. * @memberOf _
  12021. * @since 0.1.0
  12022. * @category Lang
  12023. * @param {*} value The value to compare.
  12024. * @param {*} other The other value to compare.
  12025. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12026. * @example
  12027. *
  12028. * var object = { 'a': 1 };
  12029. * var other = { 'a': 1 };
  12030. *
  12031. * _.isEqual(object, other);
  12032. * // => true
  12033. *
  12034. * object === other;
  12035. * // => false
  12036. */
  12037. function isEqual(value, other) {
  12038. return baseIsEqual(value, other);
  12039. }
  12040. /**
  12041. * This method is like `_.isEqual` except that it accepts `customizer` which
  12042. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12043. * are handled by the method instead. The `customizer` is invoked with up to
  12044. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12045. *
  12046. * @static
  12047. * @memberOf _
  12048. * @since 4.0.0
  12049. * @category Lang
  12050. * @param {*} value The value to compare.
  12051. * @param {*} other The other value to compare.
  12052. * @param {Function} [customizer] The function to customize comparisons.
  12053. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12054. * @example
  12055. *
  12056. * function isGreeting(value) {
  12057. * return /^h(?:i|ello)$/.test(value);
  12058. * }
  12059. *
  12060. * function customizer(objValue, othValue) {
  12061. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12062. * return true;
  12063. * }
  12064. * }
  12065. *
  12066. * var array = ['hello', 'goodbye'];
  12067. * var other = ['hi', 'goodbye'];
  12068. *
  12069. * _.isEqualWith(array, other, customizer);
  12070. * // => true
  12071. */
  12072. function isEqualWith(value, other, customizer) {
  12073. customizer = typeof customizer == 'function' ? customizer : undefined;
  12074. var result = customizer ? customizer(value, other) : undefined;
  12075. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12076. }
  12077. /**
  12078. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12079. * `SyntaxError`, `TypeError`, or `URIError` object.
  12080. *
  12081. * @static
  12082. * @memberOf _
  12083. * @since 3.0.0
  12084. * @category Lang
  12085. * @param {*} value The value to check.
  12086. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12087. * @example
  12088. *
  12089. * _.isError(new Error);
  12090. * // => true
  12091. *
  12092. * _.isError(Error);
  12093. * // => false
  12094. */
  12095. function isError(value) {
  12096. if (!isObjectLike(value)) {
  12097. return false;
  12098. }
  12099. var tag = baseGetTag(value);
  12100. return tag == errorTag || tag == domExcTag ||
  12101. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12102. }
  12103. /**
  12104. * Checks if `value` is a finite primitive number.
  12105. *
  12106. * **Note:** This method is based on
  12107. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12108. *
  12109. * @static
  12110. * @memberOf _
  12111. * @since 0.1.0
  12112. * @category Lang
  12113. * @param {*} value The value to check.
  12114. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12115. * @example
  12116. *
  12117. * _.isFinite(3);
  12118. * // => true
  12119. *
  12120. * _.isFinite(Number.MIN_VALUE);
  12121. * // => true
  12122. *
  12123. * _.isFinite(Infinity);
  12124. * // => false
  12125. *
  12126. * _.isFinite('3');
  12127. * // => false
  12128. */
  12129. function isFinite(value) {
  12130. return typeof value == 'number' && nativeIsFinite(value);
  12131. }
  12132. /**
  12133. * Checks if `value` is classified as a `Function` object.
  12134. *
  12135. * @static
  12136. * @memberOf _
  12137. * @since 0.1.0
  12138. * @category Lang
  12139. * @param {*} value The value to check.
  12140. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12141. * @example
  12142. *
  12143. * _.isFunction(_);
  12144. * // => true
  12145. *
  12146. * _.isFunction(/abc/);
  12147. * // => false
  12148. */
  12149. function isFunction(value) {
  12150. if (!isObject(value)) {
  12151. return false;
  12152. }
  12153. // The use of `Object#toString` avoids issues with the `typeof` operator
  12154. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12155. var tag = baseGetTag(value);
  12156. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12157. }
  12158. /**
  12159. * Checks if `value` is an integer.
  12160. *
  12161. * **Note:** This method is based on
  12162. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12163. *
  12164. * @static
  12165. * @memberOf _
  12166. * @since 4.0.0
  12167. * @category Lang
  12168. * @param {*} value The value to check.
  12169. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12170. * @example
  12171. *
  12172. * _.isInteger(3);
  12173. * // => true
  12174. *
  12175. * _.isInteger(Number.MIN_VALUE);
  12176. * // => false
  12177. *
  12178. * _.isInteger(Infinity);
  12179. * // => false
  12180. *
  12181. * _.isInteger('3');
  12182. * // => false
  12183. */
  12184. function isInteger(value) {
  12185. return typeof value == 'number' && value == toInteger(value);
  12186. }
  12187. /**
  12188. * Checks if `value` is a valid array-like length.
  12189. *
  12190. * **Note:** This method is loosely based on
  12191. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12192. *
  12193. * @static
  12194. * @memberOf _
  12195. * @since 4.0.0
  12196. * @category Lang
  12197. * @param {*} value The value to check.
  12198. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12199. * @example
  12200. *
  12201. * _.isLength(3);
  12202. * // => true
  12203. *
  12204. * _.isLength(Number.MIN_VALUE);
  12205. * // => false
  12206. *
  12207. * _.isLength(Infinity);
  12208. * // => false
  12209. *
  12210. * _.isLength('3');
  12211. * // => false
  12212. */
  12213. function isLength(value) {
  12214. return typeof value == 'number' &&
  12215. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12216. }
  12217. /**
  12218. * Checks if `value` is the
  12219. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12220. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12221. *
  12222. * @static
  12223. * @memberOf _
  12224. * @since 0.1.0
  12225. * @category Lang
  12226. * @param {*} value The value to check.
  12227. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12228. * @example
  12229. *
  12230. * _.isObject({});
  12231. * // => true
  12232. *
  12233. * _.isObject([1, 2, 3]);
  12234. * // => true
  12235. *
  12236. * _.isObject(_.noop);
  12237. * // => true
  12238. *
  12239. * _.isObject(null);
  12240. * // => false
  12241. */
  12242. function isObject(value) {
  12243. var type = typeof value;
  12244. return value != null && (type == 'object' || type == 'function');
  12245. }
  12246. /**
  12247. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12248. * and has a `typeof` result of "object".
  12249. *
  12250. * @static
  12251. * @memberOf _
  12252. * @since 4.0.0
  12253. * @category Lang
  12254. * @param {*} value The value to check.
  12255. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12256. * @example
  12257. *
  12258. * _.isObjectLike({});
  12259. * // => true
  12260. *
  12261. * _.isObjectLike([1, 2, 3]);
  12262. * // => true
  12263. *
  12264. * _.isObjectLike(_.noop);
  12265. * // => false
  12266. *
  12267. * _.isObjectLike(null);
  12268. * // => false
  12269. */
  12270. function isObjectLike(value) {
  12271. return value != null && typeof value == 'object';
  12272. }
  12273. /**
  12274. * Checks if `value` is classified as a `Map` object.
  12275. *
  12276. * @static
  12277. * @memberOf _
  12278. * @since 4.3.0
  12279. * @category Lang
  12280. * @param {*} value The value to check.
  12281. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12282. * @example
  12283. *
  12284. * _.isMap(new Map);
  12285. * // => true
  12286. *
  12287. * _.isMap(new WeakMap);
  12288. * // => false
  12289. */
  12290. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12291. /**
  12292. * Performs a partial deep comparison between `object` and `source` to
  12293. * determine if `object` contains equivalent property values.
  12294. *
  12295. * **Note:** This method is equivalent to `_.matches` when `source` is
  12296. * partially applied.
  12297. *
  12298. * Partial comparisons will match empty array and empty object `source`
  12299. * values against any array or object value, respectively. See `_.isEqual`
  12300. * for a list of supported value comparisons.
  12301. *
  12302. * @static
  12303. * @memberOf _
  12304. * @since 3.0.0
  12305. * @category Lang
  12306. * @param {Object} object The object to inspect.
  12307. * @param {Object} source The object of property values to match.
  12308. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12309. * @example
  12310. *
  12311. * var object = { 'a': 1, 'b': 2 };
  12312. *
  12313. * _.isMatch(object, { 'b': 2 });
  12314. * // => true
  12315. *
  12316. * _.isMatch(object, { 'b': 1 });
  12317. * // => false
  12318. */
  12319. function isMatch(object, source) {
  12320. return object === source || baseIsMatch(object, source, getMatchData(source));
  12321. }
  12322. /**
  12323. * This method is like `_.isMatch` except that it accepts `customizer` which
  12324. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12325. * are handled by the method instead. The `customizer` is invoked with five
  12326. * arguments: (objValue, srcValue, index|key, object, source).
  12327. *
  12328. * @static
  12329. * @memberOf _
  12330. * @since 4.0.0
  12331. * @category Lang
  12332. * @param {Object} object The object to inspect.
  12333. * @param {Object} source The object of property values to match.
  12334. * @param {Function} [customizer] The function to customize comparisons.
  12335. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12336. * @example
  12337. *
  12338. * function isGreeting(value) {
  12339. * return /^h(?:i|ello)$/.test(value);
  12340. * }
  12341. *
  12342. * function customizer(objValue, srcValue) {
  12343. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12344. * return true;
  12345. * }
  12346. * }
  12347. *
  12348. * var object = { 'greeting': 'hello' };
  12349. * var source = { 'greeting': 'hi' };
  12350. *
  12351. * _.isMatchWith(object, source, customizer);
  12352. * // => true
  12353. */
  12354. function isMatchWith(object, source, customizer) {
  12355. customizer = typeof customizer == 'function' ? customizer : undefined;
  12356. return baseIsMatch(object, source, getMatchData(source), customizer);
  12357. }
  12358. /**
  12359. * Checks if `value` is `NaN`.
  12360. *
  12361. * **Note:** This method is based on
  12362. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12363. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12364. * `undefined` and other non-number values.
  12365. *
  12366. * @static
  12367. * @memberOf _
  12368. * @since 0.1.0
  12369. * @category Lang
  12370. * @param {*} value The value to check.
  12371. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12372. * @example
  12373. *
  12374. * _.isNaN(NaN);
  12375. * // => true
  12376. *
  12377. * _.isNaN(new Number(NaN));
  12378. * // => true
  12379. *
  12380. * isNaN(undefined);
  12381. * // => true
  12382. *
  12383. * _.isNaN(undefined);
  12384. * // => false
  12385. */
  12386. function isNaN(value) {
  12387. // An `NaN` primitive is the only value that is not equal to itself.
  12388. // Perform the `toStringTag` check first to avoid errors with some
  12389. // ActiveX objects in IE.
  12390. return isNumber(value) && value != +value;
  12391. }
  12392. /**
  12393. * Checks if `value` is a pristine native function.
  12394. *
  12395. * **Note:** This method can't reliably detect native functions in the presence
  12396. * of the core-js package because core-js circumvents this kind of detection.
  12397. * Despite multiple requests, the core-js maintainer has made it clear: any
  12398. * attempt to fix the detection will be obstructed. As a result, we're left
  12399. * with little choice but to throw an error. Unfortunately, this also affects
  12400. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12401. * which rely on core-js.
  12402. *
  12403. * @static
  12404. * @memberOf _
  12405. * @since 3.0.0
  12406. * @category Lang
  12407. * @param {*} value The value to check.
  12408. * @returns {boolean} Returns `true` if `value` is a native function,
  12409. * else `false`.
  12410. * @example
  12411. *
  12412. * _.isNative(Array.prototype.push);
  12413. * // => true
  12414. *
  12415. * _.isNative(_);
  12416. * // => false
  12417. */
  12418. function isNative(value) {
  12419. if (isMaskable(value)) {
  12420. throw new Error(CORE_ERROR_TEXT);
  12421. }
  12422. return baseIsNative(value);
  12423. }
  12424. /**
  12425. * Checks if `value` is `null`.
  12426. *
  12427. * @static
  12428. * @memberOf _
  12429. * @since 0.1.0
  12430. * @category Lang
  12431. * @param {*} value The value to check.
  12432. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12433. * @example
  12434. *
  12435. * _.isNull(null);
  12436. * // => true
  12437. *
  12438. * _.isNull(void 0);
  12439. * // => false
  12440. */
  12441. function isNull(value) {
  12442. return value === null;
  12443. }
  12444. /**
  12445. * Checks if `value` is `null` or `undefined`.
  12446. *
  12447. * @static
  12448. * @memberOf _
  12449. * @since 4.0.0
  12450. * @category Lang
  12451. * @param {*} value The value to check.
  12452. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12453. * @example
  12454. *
  12455. * _.isNil(null);
  12456. * // => true
  12457. *
  12458. * _.isNil(void 0);
  12459. * // => true
  12460. *
  12461. * _.isNil(NaN);
  12462. * // => false
  12463. */
  12464. function isNil(value) {
  12465. return value == null;
  12466. }
  12467. /**
  12468. * Checks if `value` is classified as a `Number` primitive or object.
  12469. *
  12470. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12471. * classified as numbers, use the `_.isFinite` method.
  12472. *
  12473. * @static
  12474. * @memberOf _
  12475. * @since 0.1.0
  12476. * @category Lang
  12477. * @param {*} value The value to check.
  12478. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12479. * @example
  12480. *
  12481. * _.isNumber(3);
  12482. * // => true
  12483. *
  12484. * _.isNumber(Number.MIN_VALUE);
  12485. * // => true
  12486. *
  12487. * _.isNumber(Infinity);
  12488. * // => true
  12489. *
  12490. * _.isNumber('3');
  12491. * // => false
  12492. */
  12493. function isNumber(value) {
  12494. return typeof value == 'number' ||
  12495. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12496. }
  12497. /**
  12498. * Checks if `value` is a plain object, that is, an object created by the
  12499. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12500. *
  12501. * @static
  12502. * @memberOf _
  12503. * @since 0.8.0
  12504. * @category Lang
  12505. * @param {*} value The value to check.
  12506. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12507. * @example
  12508. *
  12509. * function Foo() {
  12510. * this.a = 1;
  12511. * }
  12512. *
  12513. * _.isPlainObject(new Foo);
  12514. * // => false
  12515. *
  12516. * _.isPlainObject([1, 2, 3]);
  12517. * // => false
  12518. *
  12519. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12520. * // => true
  12521. *
  12522. * _.isPlainObject(Object.create(null));
  12523. * // => true
  12524. */
  12525. function isPlainObject(value) {
  12526. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12527. return false;
  12528. }
  12529. var proto = getPrototype(value);
  12530. if (proto === null) {
  12531. return true;
  12532. }
  12533. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12534. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12535. funcToString.call(Ctor) == objectCtorString;
  12536. }
  12537. /**
  12538. * Checks if `value` is classified as a `RegExp` object.
  12539. *
  12540. * @static
  12541. * @memberOf _
  12542. * @since 0.1.0
  12543. * @category Lang
  12544. * @param {*} value The value to check.
  12545. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12546. * @example
  12547. *
  12548. * _.isRegExp(/abc/);
  12549. * // => true
  12550. *
  12551. * _.isRegExp('/abc/');
  12552. * // => false
  12553. */
  12554. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12555. /**
  12556. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12557. * double precision number which isn't the result of a rounded unsafe integer.
  12558. *
  12559. * **Note:** This method is based on
  12560. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12561. *
  12562. * @static
  12563. * @memberOf _
  12564. * @since 4.0.0
  12565. * @category Lang
  12566. * @param {*} value The value to check.
  12567. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12568. * @example
  12569. *
  12570. * _.isSafeInteger(3);
  12571. * // => true
  12572. *
  12573. * _.isSafeInteger(Number.MIN_VALUE);
  12574. * // => false
  12575. *
  12576. * _.isSafeInteger(Infinity);
  12577. * // => false
  12578. *
  12579. * _.isSafeInteger('3');
  12580. * // => false
  12581. */
  12582. function isSafeInteger(value) {
  12583. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12584. }
  12585. /**
  12586. * Checks if `value` is classified as a `Set` object.
  12587. *
  12588. * @static
  12589. * @memberOf _
  12590. * @since 4.3.0
  12591. * @category Lang
  12592. * @param {*} value The value to check.
  12593. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12594. * @example
  12595. *
  12596. * _.isSet(new Set);
  12597. * // => true
  12598. *
  12599. * _.isSet(new WeakSet);
  12600. * // => false
  12601. */
  12602. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12603. /**
  12604. * Checks if `value` is classified as a `String` primitive or object.
  12605. *
  12606. * @static
  12607. * @since 0.1.0
  12608. * @memberOf _
  12609. * @category Lang
  12610. * @param {*} value The value to check.
  12611. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12612. * @example
  12613. *
  12614. * _.isString('abc');
  12615. * // => true
  12616. *
  12617. * _.isString(1);
  12618. * // => false
  12619. */
  12620. function isString(value) {
  12621. return typeof value == 'string' ||
  12622. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12623. }
  12624. /**
  12625. * Checks if `value` is classified as a `Symbol` primitive or object.
  12626. *
  12627. * @static
  12628. * @memberOf _
  12629. * @since 4.0.0
  12630. * @category Lang
  12631. * @param {*} value The value to check.
  12632. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12633. * @example
  12634. *
  12635. * _.isSymbol(Symbol.iterator);
  12636. * // => true
  12637. *
  12638. * _.isSymbol('abc');
  12639. * // => false
  12640. */
  12641. function isSymbol(value) {
  12642. return typeof value == 'symbol' ||
  12643. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12644. }
  12645. /**
  12646. * Checks if `value` is classified as a typed array.
  12647. *
  12648. * @static
  12649. * @memberOf _
  12650. * @since 3.0.0
  12651. * @category Lang
  12652. * @param {*} value The value to check.
  12653. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12654. * @example
  12655. *
  12656. * _.isTypedArray(new Uint8Array);
  12657. * // => true
  12658. *
  12659. * _.isTypedArray([]);
  12660. * // => false
  12661. */
  12662. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12663. /**
  12664. * Checks if `value` is `undefined`.
  12665. *
  12666. * @static
  12667. * @since 0.1.0
  12668. * @memberOf _
  12669. * @category Lang
  12670. * @param {*} value The value to check.
  12671. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12672. * @example
  12673. *
  12674. * _.isUndefined(void 0);
  12675. * // => true
  12676. *
  12677. * _.isUndefined(null);
  12678. * // => false
  12679. */
  12680. function isUndefined(value) {
  12681. return value === undefined;
  12682. }
  12683. /**
  12684. * Checks if `value` is classified as a `WeakMap` object.
  12685. *
  12686. * @static
  12687. * @memberOf _
  12688. * @since 4.3.0
  12689. * @category Lang
  12690. * @param {*} value The value to check.
  12691. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12692. * @example
  12693. *
  12694. * _.isWeakMap(new WeakMap);
  12695. * // => true
  12696. *
  12697. * _.isWeakMap(new Map);
  12698. * // => false
  12699. */
  12700. function isWeakMap(value) {
  12701. return isObjectLike(value) && getTag(value) == weakMapTag;
  12702. }
  12703. /**
  12704. * Checks if `value` is classified as a `WeakSet` object.
  12705. *
  12706. * @static
  12707. * @memberOf _
  12708. * @since 4.3.0
  12709. * @category Lang
  12710. * @param {*} value The value to check.
  12711. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12712. * @example
  12713. *
  12714. * _.isWeakSet(new WeakSet);
  12715. * // => true
  12716. *
  12717. * _.isWeakSet(new Set);
  12718. * // => false
  12719. */
  12720. function isWeakSet(value) {
  12721. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12722. }
  12723. /**
  12724. * Checks if `value` is less than `other`.
  12725. *
  12726. * @static
  12727. * @memberOf _
  12728. * @since 3.9.0
  12729. * @category Lang
  12730. * @param {*} value The value to compare.
  12731. * @param {*} other The other value to compare.
  12732. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12733. * else `false`.
  12734. * @see _.gt
  12735. * @example
  12736. *
  12737. * _.lt(1, 3);
  12738. * // => true
  12739. *
  12740. * _.lt(3, 3);
  12741. * // => false
  12742. *
  12743. * _.lt(3, 1);
  12744. * // => false
  12745. */
  12746. var lt = createRelationalOperation(baseLt);
  12747. /**
  12748. * Checks if `value` is less than or equal to `other`.
  12749. *
  12750. * @static
  12751. * @memberOf _
  12752. * @since 3.9.0
  12753. * @category Lang
  12754. * @param {*} value The value to compare.
  12755. * @param {*} other The other value to compare.
  12756. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12757. * `other`, else `false`.
  12758. * @see _.gte
  12759. * @example
  12760. *
  12761. * _.lte(1, 3);
  12762. * // => true
  12763. *
  12764. * _.lte(3, 3);
  12765. * // => true
  12766. *
  12767. * _.lte(3, 1);
  12768. * // => false
  12769. */
  12770. var lte = createRelationalOperation(function(value, other) {
  12771. return value <= other;
  12772. });
  12773. /**
  12774. * Converts `value` to an array.
  12775. *
  12776. * @static
  12777. * @since 0.1.0
  12778. * @memberOf _
  12779. * @category Lang
  12780. * @param {*} value The value to convert.
  12781. * @returns {Array} Returns the converted array.
  12782. * @example
  12783. *
  12784. * _.toArray({ 'a': 1, 'b': 2 });
  12785. * // => [1, 2]
  12786. *
  12787. * _.toArray('abc');
  12788. * // => ['a', 'b', 'c']
  12789. *
  12790. * _.toArray(1);
  12791. * // => []
  12792. *
  12793. * _.toArray(null);
  12794. * // => []
  12795. */
  12796. function toArray(value) {
  12797. if (!value) {
  12798. return [];
  12799. }
  12800. if (isArrayLike(value)) {
  12801. return isString(value) ? stringToArray(value) : copyArray(value);
  12802. }
  12803. if (symIterator && value[symIterator]) {
  12804. return iteratorToArray(value[symIterator]());
  12805. }
  12806. var tag = getTag(value),
  12807. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12808. return func(value);
  12809. }
  12810. /**
  12811. * Converts `value` to a finite number.
  12812. *
  12813. * @static
  12814. * @memberOf _
  12815. * @since 4.12.0
  12816. * @category Lang
  12817. * @param {*} value The value to convert.
  12818. * @returns {number} Returns the converted number.
  12819. * @example
  12820. *
  12821. * _.toFinite(3.2);
  12822. * // => 3.2
  12823. *
  12824. * _.toFinite(Number.MIN_VALUE);
  12825. * // => 5e-324
  12826. *
  12827. * _.toFinite(Infinity);
  12828. * // => 1.7976931348623157e+308
  12829. *
  12830. * _.toFinite('3.2');
  12831. * // => 3.2
  12832. */
  12833. function toFinite(value) {
  12834. if (!value) {
  12835. return value === 0 ? value : 0;
  12836. }
  12837. value = toNumber(value);
  12838. if (value === INFINITY || value === -INFINITY) {
  12839. var sign = (value < 0 ? -1 : 1);
  12840. return sign * MAX_INTEGER;
  12841. }
  12842. return value === value ? value : 0;
  12843. }
  12844. /**
  12845. * Converts `value` to an integer.
  12846. *
  12847. * **Note:** This method is loosely based on
  12848. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12849. *
  12850. * @static
  12851. * @memberOf _
  12852. * @since 4.0.0
  12853. * @category Lang
  12854. * @param {*} value The value to convert.
  12855. * @returns {number} Returns the converted integer.
  12856. * @example
  12857. *
  12858. * _.toInteger(3.2);
  12859. * // => 3
  12860. *
  12861. * _.toInteger(Number.MIN_VALUE);
  12862. * // => 0
  12863. *
  12864. * _.toInteger(Infinity);
  12865. * // => 1.7976931348623157e+308
  12866. *
  12867. * _.toInteger('3.2');
  12868. * // => 3
  12869. */
  12870. function toInteger(value) {
  12871. var result = toFinite(value),
  12872. remainder = result % 1;
  12873. return result === result ? (remainder ? result - remainder : result) : 0;
  12874. }
  12875. /**
  12876. * Converts `value` to an integer suitable for use as the length of an
  12877. * array-like object.
  12878. *
  12879. * **Note:** This method is based on
  12880. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12881. *
  12882. * @static
  12883. * @memberOf _
  12884. * @since 4.0.0
  12885. * @category Lang
  12886. * @param {*} value The value to convert.
  12887. * @returns {number} Returns the converted integer.
  12888. * @example
  12889. *
  12890. * _.toLength(3.2);
  12891. * // => 3
  12892. *
  12893. * _.toLength(Number.MIN_VALUE);
  12894. * // => 0
  12895. *
  12896. * _.toLength(Infinity);
  12897. * // => 4294967295
  12898. *
  12899. * _.toLength('3.2');
  12900. * // => 3
  12901. */
  12902. function toLength(value) {
  12903. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12904. }
  12905. /**
  12906. * Converts `value` to a number.
  12907. *
  12908. * @static
  12909. * @memberOf _
  12910. * @since 4.0.0
  12911. * @category Lang
  12912. * @param {*} value The value to process.
  12913. * @returns {number} Returns the number.
  12914. * @example
  12915. *
  12916. * _.toNumber(3.2);
  12917. * // => 3.2
  12918. *
  12919. * _.toNumber(Number.MIN_VALUE);
  12920. * // => 5e-324
  12921. *
  12922. * _.toNumber(Infinity);
  12923. * // => Infinity
  12924. *
  12925. * _.toNumber('3.2');
  12926. * // => 3.2
  12927. */
  12928. function toNumber(value) {
  12929. if (typeof value == 'number') {
  12930. return value;
  12931. }
  12932. if (isSymbol(value)) {
  12933. return NAN;
  12934. }
  12935. if (isObject(value)) {
  12936. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12937. value = isObject(other) ? (other + '') : other;
  12938. }
  12939. if (typeof value != 'string') {
  12940. return value === 0 ? value : +value;
  12941. }
  12942. value = baseTrim(value);
  12943. var isBinary = reIsBinary.test(value);
  12944. return (isBinary || reIsOctal.test(value))
  12945. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12946. : (reIsBadHex.test(value) ? NAN : +value);
  12947. }
  12948. /**
  12949. * Converts `value` to a plain object flattening inherited enumerable string
  12950. * keyed properties of `value` to own properties of the plain object.
  12951. *
  12952. * @static
  12953. * @memberOf _
  12954. * @since 3.0.0
  12955. * @category Lang
  12956. * @param {*} value The value to convert.
  12957. * @returns {Object} Returns the converted plain object.
  12958. * @example
  12959. *
  12960. * function Foo() {
  12961. * this.b = 2;
  12962. * }
  12963. *
  12964. * Foo.prototype.c = 3;
  12965. *
  12966. * _.assign({ 'a': 1 }, new Foo);
  12967. * // => { 'a': 1, 'b': 2 }
  12968. *
  12969. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12970. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12971. */
  12972. function toPlainObject(value) {
  12973. return copyObject(value, keysIn(value));
  12974. }
  12975. /**
  12976. * Converts `value` to a safe integer. A safe integer can be compared and
  12977. * represented correctly.
  12978. *
  12979. * @static
  12980. * @memberOf _
  12981. * @since 4.0.0
  12982. * @category Lang
  12983. * @param {*} value The value to convert.
  12984. * @returns {number} Returns the converted integer.
  12985. * @example
  12986. *
  12987. * _.toSafeInteger(3.2);
  12988. * // => 3
  12989. *
  12990. * _.toSafeInteger(Number.MIN_VALUE);
  12991. * // => 0
  12992. *
  12993. * _.toSafeInteger(Infinity);
  12994. * // => 9007199254740991
  12995. *
  12996. * _.toSafeInteger('3.2');
  12997. * // => 3
  12998. */
  12999. function toSafeInteger(value) {
  13000. return value
  13001. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13002. : (value === 0 ? value : 0);
  13003. }
  13004. /**
  13005. * Converts `value` to a string. An empty string is returned for `null`
  13006. * and `undefined` values. The sign of `-0` is preserved.
  13007. *
  13008. * @static
  13009. * @memberOf _
  13010. * @since 4.0.0
  13011. * @category Lang
  13012. * @param {*} value The value to convert.
  13013. * @returns {string} Returns the converted string.
  13014. * @example
  13015. *
  13016. * _.toString(null);
  13017. * // => ''
  13018. *
  13019. * _.toString(-0);
  13020. * // => '-0'
  13021. *
  13022. * _.toString([1, 2, 3]);
  13023. * // => '1,2,3'
  13024. */
  13025. function toString(value) {
  13026. return value == null ? '' : baseToString(value);
  13027. }
  13028. /*------------------------------------------------------------------------*/
  13029. /**
  13030. * Assigns own enumerable string keyed properties of source objects to the
  13031. * destination object. Source objects are applied from left to right.
  13032. * Subsequent sources overwrite property assignments of previous sources.
  13033. *
  13034. * **Note:** This method mutates `object` and is loosely based on
  13035. * [`Object.assign`](https://mdn.io/Object/assign).
  13036. *
  13037. * @static
  13038. * @memberOf _
  13039. * @since 0.10.0
  13040. * @category Object
  13041. * @param {Object} object The destination object.
  13042. * @param {...Object} [sources] The source objects.
  13043. * @returns {Object} Returns `object`.
  13044. * @see _.assignIn
  13045. * @example
  13046. *
  13047. * function Foo() {
  13048. * this.a = 1;
  13049. * }
  13050. *
  13051. * function Bar() {
  13052. * this.c = 3;
  13053. * }
  13054. *
  13055. * Foo.prototype.b = 2;
  13056. * Bar.prototype.d = 4;
  13057. *
  13058. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13059. * // => { 'a': 1, 'c': 3 }
  13060. */
  13061. var assign = createAssigner(function(object, source) {
  13062. if (isPrototype(source) || isArrayLike(source)) {
  13063. copyObject(source, keys(source), object);
  13064. return;
  13065. }
  13066. for (var key in source) {
  13067. if (hasOwnProperty.call(source, key)) {
  13068. assignValue(object, key, source[key]);
  13069. }
  13070. }
  13071. });
  13072. /**
  13073. * This method is like `_.assign` except that it iterates over own and
  13074. * inherited source properties.
  13075. *
  13076. * **Note:** This method mutates `object`.
  13077. *
  13078. * @static
  13079. * @memberOf _
  13080. * @since 4.0.0
  13081. * @alias extend
  13082. * @category Object
  13083. * @param {Object} object The destination object.
  13084. * @param {...Object} [sources] The source objects.
  13085. * @returns {Object} Returns `object`.
  13086. * @see _.assign
  13087. * @example
  13088. *
  13089. * function Foo() {
  13090. * this.a = 1;
  13091. * }
  13092. *
  13093. * function Bar() {
  13094. * this.c = 3;
  13095. * }
  13096. *
  13097. * Foo.prototype.b = 2;
  13098. * Bar.prototype.d = 4;
  13099. *
  13100. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13101. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13102. */
  13103. var assignIn = createAssigner(function(object, source) {
  13104. copyObject(source, keysIn(source), object);
  13105. });
  13106. /**
  13107. * This method is like `_.assignIn` except that it accepts `customizer`
  13108. * which is invoked to produce the assigned values. If `customizer` returns
  13109. * `undefined`, assignment is handled by the method instead. The `customizer`
  13110. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13111. *
  13112. * **Note:** This method mutates `object`.
  13113. *
  13114. * @static
  13115. * @memberOf _
  13116. * @since 4.0.0
  13117. * @alias extendWith
  13118. * @category Object
  13119. * @param {Object} object The destination object.
  13120. * @param {...Object} sources The source objects.
  13121. * @param {Function} [customizer] The function to customize assigned values.
  13122. * @returns {Object} Returns `object`.
  13123. * @see _.assignWith
  13124. * @example
  13125. *
  13126. * function customizer(objValue, srcValue) {
  13127. * return _.isUndefined(objValue) ? srcValue : objValue;
  13128. * }
  13129. *
  13130. * var defaults = _.partialRight(_.assignInWith, customizer);
  13131. *
  13132. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13133. * // => { 'a': 1, 'b': 2 }
  13134. */
  13135. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13136. copyObject(source, keysIn(source), object, customizer);
  13137. });
  13138. /**
  13139. * This method is like `_.assign` except that it accepts `customizer`
  13140. * which is invoked to produce the assigned values. If `customizer` returns
  13141. * `undefined`, assignment is handled by the method instead. The `customizer`
  13142. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13143. *
  13144. * **Note:** This method mutates `object`.
  13145. *
  13146. * @static
  13147. * @memberOf _
  13148. * @since 4.0.0
  13149. * @category Object
  13150. * @param {Object} object The destination object.
  13151. * @param {...Object} sources The source objects.
  13152. * @param {Function} [customizer] The function to customize assigned values.
  13153. * @returns {Object} Returns `object`.
  13154. * @see _.assignInWith
  13155. * @example
  13156. *
  13157. * function customizer(objValue, srcValue) {
  13158. * return _.isUndefined(objValue) ? srcValue : objValue;
  13159. * }
  13160. *
  13161. * var defaults = _.partialRight(_.assignWith, customizer);
  13162. *
  13163. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13164. * // => { 'a': 1, 'b': 2 }
  13165. */
  13166. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13167. copyObject(source, keys(source), object, customizer);
  13168. });
  13169. /**
  13170. * Creates an array of values corresponding to `paths` of `object`.
  13171. *
  13172. * @static
  13173. * @memberOf _
  13174. * @since 1.0.0
  13175. * @category Object
  13176. * @param {Object} object The object to iterate over.
  13177. * @param {...(string|string[])} [paths] The property paths to pick.
  13178. * @returns {Array} Returns the picked values.
  13179. * @example
  13180. *
  13181. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13182. *
  13183. * _.at(object, ['a[0].b.c', 'a[1]']);
  13184. * // => [3, 4]
  13185. */
  13186. var at = flatRest(baseAt);
  13187. /**
  13188. * Creates an object that inherits from the `prototype` object. If a
  13189. * `properties` object is given, its own enumerable string keyed properties
  13190. * are assigned to the created object.
  13191. *
  13192. * @static
  13193. * @memberOf _
  13194. * @since 2.3.0
  13195. * @category Object
  13196. * @param {Object} prototype The object to inherit from.
  13197. * @param {Object} [properties] The properties to assign to the object.
  13198. * @returns {Object} Returns the new object.
  13199. * @example
  13200. *
  13201. * function Shape() {
  13202. * this.x = 0;
  13203. * this.y = 0;
  13204. * }
  13205. *
  13206. * function Circle() {
  13207. * Shape.call(this);
  13208. * }
  13209. *
  13210. * Circle.prototype = _.create(Shape.prototype, {
  13211. * 'constructor': Circle
  13212. * });
  13213. *
  13214. * var circle = new Circle;
  13215. * circle instanceof Circle;
  13216. * // => true
  13217. *
  13218. * circle instanceof Shape;
  13219. * // => true
  13220. */
  13221. function create(prototype, properties) {
  13222. var result = baseCreate(prototype);
  13223. return properties == null ? result : baseAssign(result, properties);
  13224. }
  13225. /**
  13226. * Assigns own and inherited enumerable string keyed properties of source
  13227. * objects to the destination object for all destination properties that
  13228. * resolve to `undefined`. Source objects are applied from left to right.
  13229. * Once a property is set, additional values of the same property are ignored.
  13230. *
  13231. * **Note:** This method mutates `object`.
  13232. *
  13233. * @static
  13234. * @since 0.1.0
  13235. * @memberOf _
  13236. * @category Object
  13237. * @param {Object} object The destination object.
  13238. * @param {...Object} [sources] The source objects.
  13239. * @returns {Object} Returns `object`.
  13240. * @see _.defaultsDeep
  13241. * @example
  13242. *
  13243. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13244. * // => { 'a': 1, 'b': 2 }
  13245. */
  13246. var defaults = baseRest(function(object, sources) {
  13247. object = Object(object);
  13248. var index = -1;
  13249. var length = sources.length;
  13250. var guard = length > 2 ? sources[2] : undefined;
  13251. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13252. length = 1;
  13253. }
  13254. while (++index < length) {
  13255. var source = sources[index];
  13256. var props = keysIn(source);
  13257. var propsIndex = -1;
  13258. var propsLength = props.length;
  13259. while (++propsIndex < propsLength) {
  13260. var key = props[propsIndex];
  13261. var value = object[key];
  13262. if (value === undefined ||
  13263. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13264. object[key] = source[key];
  13265. }
  13266. }
  13267. }
  13268. return object;
  13269. });
  13270. /**
  13271. * This method is like `_.defaults` except that it recursively assigns
  13272. * default properties.
  13273. *
  13274. * **Note:** This method mutates `object`.
  13275. *
  13276. * @static
  13277. * @memberOf _
  13278. * @since 3.10.0
  13279. * @category Object
  13280. * @param {Object} object The destination object.
  13281. * @param {...Object} [sources] The source objects.
  13282. * @returns {Object} Returns `object`.
  13283. * @see _.defaults
  13284. * @example
  13285. *
  13286. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13287. * // => { 'a': { 'b': 2, 'c': 3 } }
  13288. */
  13289. var defaultsDeep = baseRest(function(args) {
  13290. args.push(undefined, customDefaultsMerge);
  13291. return apply(mergeWith, undefined, args);
  13292. });
  13293. /**
  13294. * This method is like `_.find` except that it returns the key of the first
  13295. * element `predicate` returns truthy for instead of the element itself.
  13296. *
  13297. * @static
  13298. * @memberOf _
  13299. * @since 1.1.0
  13300. * @category Object
  13301. * @param {Object} object The object to inspect.
  13302. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13303. * @returns {string|undefined} Returns the key of the matched element,
  13304. * else `undefined`.
  13305. * @example
  13306. *
  13307. * var users = {
  13308. * 'barney': { 'age': 36, 'active': true },
  13309. * 'fred': { 'age': 40, 'active': false },
  13310. * 'pebbles': { 'age': 1, 'active': true }
  13311. * };
  13312. *
  13313. * _.findKey(users, function(o) { return o.age < 40; });
  13314. * // => 'barney' (iteration order is not guaranteed)
  13315. *
  13316. * // The `_.matches` iteratee shorthand.
  13317. * _.findKey(users, { 'age': 1, 'active': true });
  13318. * // => 'pebbles'
  13319. *
  13320. * // The `_.matchesProperty` iteratee shorthand.
  13321. * _.findKey(users, ['active', false]);
  13322. * // => 'fred'
  13323. *
  13324. * // The `_.property` iteratee shorthand.
  13325. * _.findKey(users, 'active');
  13326. * // => 'barney'
  13327. */
  13328. function findKey(object, predicate) {
  13329. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13330. }
  13331. /**
  13332. * This method is like `_.findKey` except that it iterates over elements of
  13333. * a collection in the opposite order.
  13334. *
  13335. * @static
  13336. * @memberOf _
  13337. * @since 2.0.0
  13338. * @category Object
  13339. * @param {Object} object The object to inspect.
  13340. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13341. * @returns {string|undefined} Returns the key of the matched element,
  13342. * else `undefined`.
  13343. * @example
  13344. *
  13345. * var users = {
  13346. * 'barney': { 'age': 36, 'active': true },
  13347. * 'fred': { 'age': 40, 'active': false },
  13348. * 'pebbles': { 'age': 1, 'active': true }
  13349. * };
  13350. *
  13351. * _.findLastKey(users, function(o) { return o.age < 40; });
  13352. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13353. *
  13354. * // The `_.matches` iteratee shorthand.
  13355. * _.findLastKey(users, { 'age': 36, 'active': true });
  13356. * // => 'barney'
  13357. *
  13358. * // The `_.matchesProperty` iteratee shorthand.
  13359. * _.findLastKey(users, ['active', false]);
  13360. * // => 'fred'
  13361. *
  13362. * // The `_.property` iteratee shorthand.
  13363. * _.findLastKey(users, 'active');
  13364. * // => 'pebbles'
  13365. */
  13366. function findLastKey(object, predicate) {
  13367. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13368. }
  13369. /**
  13370. * Iterates over own and inherited enumerable string keyed properties of an
  13371. * object and invokes `iteratee` for each property. The iteratee is invoked
  13372. * with three arguments: (value, key, object). Iteratee functions may exit
  13373. * iteration early by explicitly returning `false`.
  13374. *
  13375. * @static
  13376. * @memberOf _
  13377. * @since 0.3.0
  13378. * @category Object
  13379. * @param {Object} object The object to iterate over.
  13380. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13381. * @returns {Object} Returns `object`.
  13382. * @see _.forInRight
  13383. * @example
  13384. *
  13385. * function Foo() {
  13386. * this.a = 1;
  13387. * this.b = 2;
  13388. * }
  13389. *
  13390. * Foo.prototype.c = 3;
  13391. *
  13392. * _.forIn(new Foo, function(value, key) {
  13393. * console.log(key);
  13394. * });
  13395. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13396. */
  13397. function forIn(object, iteratee) {
  13398. return object == null
  13399. ? object
  13400. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13401. }
  13402. /**
  13403. * This method is like `_.forIn` except that it iterates over properties of
  13404. * `object` in the opposite order.
  13405. *
  13406. * @static
  13407. * @memberOf _
  13408. * @since 2.0.0
  13409. * @category Object
  13410. * @param {Object} object The object to iterate over.
  13411. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13412. * @returns {Object} Returns `object`.
  13413. * @see _.forIn
  13414. * @example
  13415. *
  13416. * function Foo() {
  13417. * this.a = 1;
  13418. * this.b = 2;
  13419. * }
  13420. *
  13421. * Foo.prototype.c = 3;
  13422. *
  13423. * _.forInRight(new Foo, function(value, key) {
  13424. * console.log(key);
  13425. * });
  13426. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13427. */
  13428. function forInRight(object, iteratee) {
  13429. return object == null
  13430. ? object
  13431. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13432. }
  13433. /**
  13434. * Iterates over own enumerable string keyed properties of an object and
  13435. * invokes `iteratee` for each property. The iteratee is invoked with three
  13436. * arguments: (value, key, object). Iteratee functions may exit iteration
  13437. * early by explicitly returning `false`.
  13438. *
  13439. * @static
  13440. * @memberOf _
  13441. * @since 0.3.0
  13442. * @category Object
  13443. * @param {Object} object The object to iterate over.
  13444. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13445. * @returns {Object} Returns `object`.
  13446. * @see _.forOwnRight
  13447. * @example
  13448. *
  13449. * function Foo() {
  13450. * this.a = 1;
  13451. * this.b = 2;
  13452. * }
  13453. *
  13454. * Foo.prototype.c = 3;
  13455. *
  13456. * _.forOwn(new Foo, function(value, key) {
  13457. * console.log(key);
  13458. * });
  13459. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13460. */
  13461. function forOwn(object, iteratee) {
  13462. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13463. }
  13464. /**
  13465. * This method is like `_.forOwn` except that it iterates over properties of
  13466. * `object` in the opposite order.
  13467. *
  13468. * @static
  13469. * @memberOf _
  13470. * @since 2.0.0
  13471. * @category Object
  13472. * @param {Object} object The object to iterate over.
  13473. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13474. * @returns {Object} Returns `object`.
  13475. * @see _.forOwn
  13476. * @example
  13477. *
  13478. * function Foo() {
  13479. * this.a = 1;
  13480. * this.b = 2;
  13481. * }
  13482. *
  13483. * Foo.prototype.c = 3;
  13484. *
  13485. * _.forOwnRight(new Foo, function(value, key) {
  13486. * console.log(key);
  13487. * });
  13488. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13489. */
  13490. function forOwnRight(object, iteratee) {
  13491. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13492. }
  13493. /**
  13494. * Creates an array of function property names from own enumerable properties
  13495. * of `object`.
  13496. *
  13497. * @static
  13498. * @since 0.1.0
  13499. * @memberOf _
  13500. * @category Object
  13501. * @param {Object} object The object to inspect.
  13502. * @returns {Array} Returns the function names.
  13503. * @see _.functionsIn
  13504. * @example
  13505. *
  13506. * function Foo() {
  13507. * this.a = _.constant('a');
  13508. * this.b = _.constant('b');
  13509. * }
  13510. *
  13511. * Foo.prototype.c = _.constant('c');
  13512. *
  13513. * _.functions(new Foo);
  13514. * // => ['a', 'b']
  13515. */
  13516. function functions(object) {
  13517. return object == null ? [] : baseFunctions(object, keys(object));
  13518. }
  13519. /**
  13520. * Creates an array of function property names from own and inherited
  13521. * enumerable properties of `object`.
  13522. *
  13523. * @static
  13524. * @memberOf _
  13525. * @since 4.0.0
  13526. * @category Object
  13527. * @param {Object} object The object to inspect.
  13528. * @returns {Array} Returns the function names.
  13529. * @see _.functions
  13530. * @example
  13531. *
  13532. * function Foo() {
  13533. * this.a = _.constant('a');
  13534. * this.b = _.constant('b');
  13535. * }
  13536. *
  13537. * Foo.prototype.c = _.constant('c');
  13538. *
  13539. * _.functionsIn(new Foo);
  13540. * // => ['a', 'b', 'c']
  13541. */
  13542. function functionsIn(object) {
  13543. return object == null ? [] : baseFunctions(object, keysIn(object));
  13544. }
  13545. /**
  13546. * Gets the value at `path` of `object`. If the resolved value is
  13547. * `undefined`, the `defaultValue` is returned in its place.
  13548. *
  13549. * @static
  13550. * @memberOf _
  13551. * @since 3.7.0
  13552. * @category Object
  13553. * @param {Object} object The object to query.
  13554. * @param {Array|string} path The path of the property to get.
  13555. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13556. * @returns {*} Returns the resolved value.
  13557. * @example
  13558. *
  13559. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13560. *
  13561. * _.get(object, 'a[0].b.c');
  13562. * // => 3
  13563. *
  13564. * _.get(object, ['a', '0', 'b', 'c']);
  13565. * // => 3
  13566. *
  13567. * _.get(object, 'a.b.c', 'default');
  13568. * // => 'default'
  13569. */
  13570. function get(object, path, defaultValue) {
  13571. var result = object == null ? undefined : baseGet(object, path);
  13572. return result === undefined ? defaultValue : result;
  13573. }
  13574. /**
  13575. * Checks if `path` is a direct property of `object`.
  13576. *
  13577. * @static
  13578. * @since 0.1.0
  13579. * @memberOf _
  13580. * @category Object
  13581. * @param {Object} object The object to query.
  13582. * @param {Array|string} path The path to check.
  13583. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13584. * @example
  13585. *
  13586. * var object = { 'a': { 'b': 2 } };
  13587. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13588. *
  13589. * _.has(object, 'a');
  13590. * // => true
  13591. *
  13592. * _.has(object, 'a.b');
  13593. * // => true
  13594. *
  13595. * _.has(object, ['a', 'b']);
  13596. * // => true
  13597. *
  13598. * _.has(other, 'a');
  13599. * // => false
  13600. */
  13601. function has(object, path) {
  13602. return object != null && hasPath(object, path, baseHas);
  13603. }
  13604. /**
  13605. * Checks if `path` is a direct or inherited property of `object`.
  13606. *
  13607. * @static
  13608. * @memberOf _
  13609. * @since 4.0.0
  13610. * @category Object
  13611. * @param {Object} object The object to query.
  13612. * @param {Array|string} path The path to check.
  13613. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13614. * @example
  13615. *
  13616. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13617. *
  13618. * _.hasIn(object, 'a');
  13619. * // => true
  13620. *
  13621. * _.hasIn(object, 'a.b');
  13622. * // => true
  13623. *
  13624. * _.hasIn(object, ['a', 'b']);
  13625. * // => true
  13626. *
  13627. * _.hasIn(object, 'b');
  13628. * // => false
  13629. */
  13630. function hasIn(object, path) {
  13631. return object != null && hasPath(object, path, baseHasIn);
  13632. }
  13633. /**
  13634. * Creates an object composed of the inverted keys and values of `object`.
  13635. * If `object` contains duplicate values, subsequent values overwrite
  13636. * property assignments of previous values.
  13637. *
  13638. * @static
  13639. * @memberOf _
  13640. * @since 0.7.0
  13641. * @category Object
  13642. * @param {Object} object The object to invert.
  13643. * @returns {Object} Returns the new inverted object.
  13644. * @example
  13645. *
  13646. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13647. *
  13648. * _.invert(object);
  13649. * // => { '1': 'c', '2': 'b' }
  13650. */
  13651. var invert = createInverter(function(result, value, key) {
  13652. if (value != null &&
  13653. typeof value.toString != 'function') {
  13654. value = nativeObjectToString.call(value);
  13655. }
  13656. result[value] = key;
  13657. }, constant(identity));
  13658. /**
  13659. * This method is like `_.invert` except that the inverted object is generated
  13660. * from the results of running each element of `object` thru `iteratee`. The
  13661. * corresponding inverted value of each inverted key is an array of keys
  13662. * responsible for generating the inverted value. The iteratee is invoked
  13663. * with one argument: (value).
  13664. *
  13665. * @static
  13666. * @memberOf _
  13667. * @since 4.1.0
  13668. * @category Object
  13669. * @param {Object} object The object to invert.
  13670. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13671. * @returns {Object} Returns the new inverted object.
  13672. * @example
  13673. *
  13674. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13675. *
  13676. * _.invertBy(object);
  13677. * // => { '1': ['a', 'c'], '2': ['b'] }
  13678. *
  13679. * _.invertBy(object, function(value) {
  13680. * return 'group' + value;
  13681. * });
  13682. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13683. */
  13684. var invertBy = createInverter(function(result, value, key) {
  13685. if (value != null &&
  13686. typeof value.toString != 'function') {
  13687. value = nativeObjectToString.call(value);
  13688. }
  13689. if (hasOwnProperty.call(result, value)) {
  13690. result[value].push(key);
  13691. } else {
  13692. result[value] = [key];
  13693. }
  13694. }, getIteratee);
  13695. /**
  13696. * Invokes the method at `path` of `object`.
  13697. *
  13698. * @static
  13699. * @memberOf _
  13700. * @since 4.0.0
  13701. * @category Object
  13702. * @param {Object} object The object to query.
  13703. * @param {Array|string} path The path of the method to invoke.
  13704. * @param {...*} [args] The arguments to invoke the method with.
  13705. * @returns {*} Returns the result of the invoked method.
  13706. * @example
  13707. *
  13708. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13709. *
  13710. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13711. * // => [2, 3]
  13712. */
  13713. var invoke = baseRest(baseInvoke);
  13714. /**
  13715. * Creates an array of the own enumerable property names of `object`.
  13716. *
  13717. * **Note:** Non-object values are coerced to objects. See the
  13718. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13719. * for more details.
  13720. *
  13721. * @static
  13722. * @since 0.1.0
  13723. * @memberOf _
  13724. * @category Object
  13725. * @param {Object} object The object to query.
  13726. * @returns {Array} Returns the array of property names.
  13727. * @example
  13728. *
  13729. * function Foo() {
  13730. * this.a = 1;
  13731. * this.b = 2;
  13732. * }
  13733. *
  13734. * Foo.prototype.c = 3;
  13735. *
  13736. * _.keys(new Foo);
  13737. * // => ['a', 'b'] (iteration order is not guaranteed)
  13738. *
  13739. * _.keys('hi');
  13740. * // => ['0', '1']
  13741. */
  13742. function keys(object) {
  13743. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13744. }
  13745. /**
  13746. * Creates an array of the own and inherited enumerable property names of `object`.
  13747. *
  13748. * **Note:** Non-object values are coerced to objects.
  13749. *
  13750. * @static
  13751. * @memberOf _
  13752. * @since 3.0.0
  13753. * @category Object
  13754. * @param {Object} object The object to query.
  13755. * @returns {Array} Returns the array of property names.
  13756. * @example
  13757. *
  13758. * function Foo() {
  13759. * this.a = 1;
  13760. * this.b = 2;
  13761. * }
  13762. *
  13763. * Foo.prototype.c = 3;
  13764. *
  13765. * _.keysIn(new Foo);
  13766. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13767. */
  13768. function keysIn(object) {
  13769. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13770. }
  13771. /**
  13772. * The opposite of `_.mapValues`; this method creates an object with the
  13773. * same values as `object` and keys generated by running each own enumerable
  13774. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13775. * with three arguments: (value, key, object).
  13776. *
  13777. * @static
  13778. * @memberOf _
  13779. * @since 3.8.0
  13780. * @category Object
  13781. * @param {Object} object The object to iterate over.
  13782. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13783. * @returns {Object} Returns the new mapped object.
  13784. * @see _.mapValues
  13785. * @example
  13786. *
  13787. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13788. * return key + value;
  13789. * });
  13790. * // => { 'a1': 1, 'b2': 2 }
  13791. */
  13792. function mapKeys(object, iteratee) {
  13793. var result = {};
  13794. iteratee = getIteratee(iteratee, 3);
  13795. baseForOwn(object, function(value, key, object) {
  13796. baseAssignValue(result, iteratee(value, key, object), value);
  13797. });
  13798. return result;
  13799. }
  13800. /**
  13801. * Creates an object with the same keys as `object` and values generated
  13802. * by running each own enumerable string keyed property of `object` thru
  13803. * `iteratee`. The iteratee is invoked with three arguments:
  13804. * (value, key, object).
  13805. *
  13806. * @static
  13807. * @memberOf _
  13808. * @since 2.4.0
  13809. * @category Object
  13810. * @param {Object} object The object to iterate over.
  13811. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13812. * @returns {Object} Returns the new mapped object.
  13813. * @see _.mapKeys
  13814. * @example
  13815. *
  13816. * var users = {
  13817. * 'fred': { 'user': 'fred', 'age': 40 },
  13818. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13819. * };
  13820. *
  13821. * _.mapValues(users, function(o) { return o.age; });
  13822. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13823. *
  13824. * // The `_.property` iteratee shorthand.
  13825. * _.mapValues(users, 'age');
  13826. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13827. */
  13828. function mapValues(object, iteratee) {
  13829. var result = {};
  13830. iteratee = getIteratee(iteratee, 3);
  13831. baseForOwn(object, function(value, key, object) {
  13832. baseAssignValue(result, key, iteratee(value, key, object));
  13833. });
  13834. return result;
  13835. }
  13836. /**
  13837. * This method is like `_.assign` except that it recursively merges own and
  13838. * inherited enumerable string keyed properties of source objects into the
  13839. * destination object. Source properties that resolve to `undefined` are
  13840. * skipped if a destination value exists. Array and plain object properties
  13841. * are merged recursively. Other objects and value types are overridden by
  13842. * assignment. Source objects are applied from left to right. Subsequent
  13843. * sources overwrite property assignments of previous sources.
  13844. *
  13845. * **Note:** This method mutates `object`.
  13846. *
  13847. * @static
  13848. * @memberOf _
  13849. * @since 0.5.0
  13850. * @category Object
  13851. * @param {Object} object The destination object.
  13852. * @param {...Object} [sources] The source objects.
  13853. * @returns {Object} Returns `object`.
  13854. * @example
  13855. *
  13856. * var object = {
  13857. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13858. * };
  13859. *
  13860. * var other = {
  13861. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13862. * };
  13863. *
  13864. * _.merge(object, other);
  13865. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13866. */
  13867. var merge = createAssigner(function(object, source, srcIndex) {
  13868. baseMerge(object, source, srcIndex);
  13869. });
  13870. /**
  13871. * This method is like `_.merge` except that it accepts `customizer` which
  13872. * is invoked to produce the merged values of the destination and source
  13873. * properties. If `customizer` returns `undefined`, merging is handled by the
  13874. * method instead. The `customizer` is invoked with six arguments:
  13875. * (objValue, srcValue, key, object, source, stack).
  13876. *
  13877. * **Note:** This method mutates `object`.
  13878. *
  13879. * @static
  13880. * @memberOf _
  13881. * @since 4.0.0
  13882. * @category Object
  13883. * @param {Object} object The destination object.
  13884. * @param {...Object} sources The source objects.
  13885. * @param {Function} customizer The function to customize assigned values.
  13886. * @returns {Object} Returns `object`.
  13887. * @example
  13888. *
  13889. * function customizer(objValue, srcValue) {
  13890. * if (_.isArray(objValue)) {
  13891. * return objValue.concat(srcValue);
  13892. * }
  13893. * }
  13894. *
  13895. * var object = { 'a': [1], 'b': [2] };
  13896. * var other = { 'a': [3], 'b': [4] };
  13897. *
  13898. * _.mergeWith(object, other, customizer);
  13899. * // => { 'a': [1, 3], 'b': [2, 4] }
  13900. */
  13901. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13902. baseMerge(object, source, srcIndex, customizer);
  13903. });
  13904. /**
  13905. * The opposite of `_.pick`; this method creates an object composed of the
  13906. * own and inherited enumerable property paths of `object` that are not omitted.
  13907. *
  13908. * **Note:** This method is considerably slower than `_.pick`.
  13909. *
  13910. * @static
  13911. * @since 0.1.0
  13912. * @memberOf _
  13913. * @category Object
  13914. * @param {Object} object The source object.
  13915. * @param {...(string|string[])} [paths] The property paths to omit.
  13916. * @returns {Object} Returns the new object.
  13917. * @example
  13918. *
  13919. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13920. *
  13921. * _.omit(object, ['a', 'c']);
  13922. * // => { 'b': '2' }
  13923. */
  13924. var omit = flatRest(function(object, paths) {
  13925. var result = {};
  13926. if (object == null) {
  13927. return result;
  13928. }
  13929. var isDeep = false;
  13930. paths = arrayMap(paths, function(path) {
  13931. path = castPath(path, object);
  13932. isDeep || (isDeep = path.length > 1);
  13933. return path;
  13934. });
  13935. copyObject(object, getAllKeysIn(object), result);
  13936. if (isDeep) {
  13937. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13938. }
  13939. var length = paths.length;
  13940. while (length--) {
  13941. baseUnset(result, paths[length]);
  13942. }
  13943. return result;
  13944. });
  13945. /**
  13946. * The opposite of `_.pickBy`; this method creates an object composed of
  13947. * the own and inherited enumerable string keyed properties of `object` that
  13948. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13949. * arguments: (value, key).
  13950. *
  13951. * @static
  13952. * @memberOf _
  13953. * @since 4.0.0
  13954. * @category Object
  13955. * @param {Object} object The source object.
  13956. * @param {Function} [predicate=_.identity] The function invoked per property.
  13957. * @returns {Object} Returns the new object.
  13958. * @example
  13959. *
  13960. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13961. *
  13962. * _.omitBy(object, _.isNumber);
  13963. * // => { 'b': '2' }
  13964. */
  13965. function omitBy(object, predicate) {
  13966. return pickBy(object, negate(getIteratee(predicate)));
  13967. }
  13968. /**
  13969. * Creates an object composed of the picked `object` properties.
  13970. *
  13971. * @static
  13972. * @since 0.1.0
  13973. * @memberOf _
  13974. * @category Object
  13975. * @param {Object} object The source object.
  13976. * @param {...(string|string[])} [paths] The property paths to pick.
  13977. * @returns {Object} Returns the new object.
  13978. * @example
  13979. *
  13980. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13981. *
  13982. * _.pick(object, ['a', 'c']);
  13983. * // => { 'a': 1, 'c': 3 }
  13984. */
  13985. var pick = flatRest(function(object, paths) {
  13986. return object == null ? {} : basePick(object, paths);
  13987. });
  13988. /**
  13989. * Creates an object composed of the `object` properties `predicate` returns
  13990. * truthy for. The predicate is invoked with two arguments: (value, key).
  13991. *
  13992. * @static
  13993. * @memberOf _
  13994. * @since 4.0.0
  13995. * @category Object
  13996. * @param {Object} object The source object.
  13997. * @param {Function} [predicate=_.identity] The function invoked per property.
  13998. * @returns {Object} Returns the new object.
  13999. * @example
  14000. *
  14001. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14002. *
  14003. * _.pickBy(object, _.isNumber);
  14004. * // => { 'a': 1, 'c': 3 }
  14005. */
  14006. function pickBy(object, predicate) {
  14007. if (object == null) {
  14008. return {};
  14009. }
  14010. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14011. return [prop];
  14012. });
  14013. predicate = getIteratee(predicate);
  14014. return basePickBy(object, props, function(value, path) {
  14015. return predicate(value, path[0]);
  14016. });
  14017. }
  14018. /**
  14019. * This method is like `_.get` except that if the resolved value is a
  14020. * function it's invoked with the `this` binding of its parent object and
  14021. * its result is returned.
  14022. *
  14023. * @static
  14024. * @since 0.1.0
  14025. * @memberOf _
  14026. * @category Object
  14027. * @param {Object} object The object to query.
  14028. * @param {Array|string} path The path of the property to resolve.
  14029. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14030. * @returns {*} Returns the resolved value.
  14031. * @example
  14032. *
  14033. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14034. *
  14035. * _.result(object, 'a[0].b.c1');
  14036. * // => 3
  14037. *
  14038. * _.result(object, 'a[0].b.c2');
  14039. * // => 4
  14040. *
  14041. * _.result(object, 'a[0].b.c3', 'default');
  14042. * // => 'default'
  14043. *
  14044. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14045. * // => 'default'
  14046. */
  14047. function result(object, path, defaultValue) {
  14048. path = castPath(path, object);
  14049. var index = -1,
  14050. length = path.length;
  14051. // Ensure the loop is entered when path is empty.
  14052. if (!length) {
  14053. length = 1;
  14054. object = undefined;
  14055. }
  14056. while (++index < length) {
  14057. var value = object == null ? undefined : object[toKey(path[index])];
  14058. if (value === undefined) {
  14059. index = length;
  14060. value = defaultValue;
  14061. }
  14062. object = isFunction(value) ? value.call(object) : value;
  14063. }
  14064. return object;
  14065. }
  14066. /**
  14067. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14068. * it's created. Arrays are created for missing index properties while objects
  14069. * are created for all other missing properties. Use `_.setWith` to customize
  14070. * `path` creation.
  14071. *
  14072. * **Note:** This method mutates `object`.
  14073. *
  14074. * @static
  14075. * @memberOf _
  14076. * @since 3.7.0
  14077. * @category Object
  14078. * @param {Object} object The object to modify.
  14079. * @param {Array|string} path The path of the property to set.
  14080. * @param {*} value The value to set.
  14081. * @returns {Object} Returns `object`.
  14082. * @example
  14083. *
  14084. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14085. *
  14086. * _.set(object, 'a[0].b.c', 4);
  14087. * console.log(object.a[0].b.c);
  14088. * // => 4
  14089. *
  14090. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14091. * console.log(object.x[0].y.z);
  14092. * // => 5
  14093. */
  14094. function set(object, path, value) {
  14095. return object == null ? object : baseSet(object, path, value);
  14096. }
  14097. /**
  14098. * This method is like `_.set` except that it accepts `customizer` which is
  14099. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14100. * path creation is handled by the method instead. The `customizer` is invoked
  14101. * with three arguments: (nsValue, key, nsObject).
  14102. *
  14103. * **Note:** This method mutates `object`.
  14104. *
  14105. * @static
  14106. * @memberOf _
  14107. * @since 4.0.0
  14108. * @category Object
  14109. * @param {Object} object The object to modify.
  14110. * @param {Array|string} path The path of the property to set.
  14111. * @param {*} value The value to set.
  14112. * @param {Function} [customizer] The function to customize assigned values.
  14113. * @returns {Object} Returns `object`.
  14114. * @example
  14115. *
  14116. * var object = {};
  14117. *
  14118. * _.setWith(object, '[0][1]', 'a', Object);
  14119. * // => { '0': { '1': 'a' } }
  14120. */
  14121. function setWith(object, path, value, customizer) {
  14122. customizer = typeof customizer == 'function' ? customizer : undefined;
  14123. return object == null ? object : baseSet(object, path, value, customizer);
  14124. }
  14125. /**
  14126. * Creates an array of own enumerable string keyed-value pairs for `object`
  14127. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14128. * entries are returned.
  14129. *
  14130. * @static
  14131. * @memberOf _
  14132. * @since 4.0.0
  14133. * @alias entries
  14134. * @category Object
  14135. * @param {Object} object The object to query.
  14136. * @returns {Array} Returns the key-value pairs.
  14137. * @example
  14138. *
  14139. * function Foo() {
  14140. * this.a = 1;
  14141. * this.b = 2;
  14142. * }
  14143. *
  14144. * Foo.prototype.c = 3;
  14145. *
  14146. * _.toPairs(new Foo);
  14147. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14148. */
  14149. var toPairs = createToPairs(keys);
  14150. /**
  14151. * Creates an array of own and inherited enumerable string keyed-value pairs
  14152. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14153. * or set, its entries are returned.
  14154. *
  14155. * @static
  14156. * @memberOf _
  14157. * @since 4.0.0
  14158. * @alias entriesIn
  14159. * @category Object
  14160. * @param {Object} object The object to query.
  14161. * @returns {Array} Returns the key-value pairs.
  14162. * @example
  14163. *
  14164. * function Foo() {
  14165. * this.a = 1;
  14166. * this.b = 2;
  14167. * }
  14168. *
  14169. * Foo.prototype.c = 3;
  14170. *
  14171. * _.toPairsIn(new Foo);
  14172. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14173. */
  14174. var toPairsIn = createToPairs(keysIn);
  14175. /**
  14176. * An alternative to `_.reduce`; this method transforms `object` to a new
  14177. * `accumulator` object which is the result of running each of its own
  14178. * enumerable string keyed properties thru `iteratee`, with each invocation
  14179. * potentially mutating the `accumulator` object. If `accumulator` is not
  14180. * provided, a new object with the same `[[Prototype]]` will be used. The
  14181. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14182. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14183. *
  14184. * @static
  14185. * @memberOf _
  14186. * @since 1.3.0
  14187. * @category Object
  14188. * @param {Object} object The object to iterate over.
  14189. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14190. * @param {*} [accumulator] The custom accumulator value.
  14191. * @returns {*} Returns the accumulated value.
  14192. * @example
  14193. *
  14194. * _.transform([2, 3, 4], function(result, n) {
  14195. * result.push(n *= n);
  14196. * return n % 2 == 0;
  14197. * }, []);
  14198. * // => [4, 9]
  14199. *
  14200. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14201. * (result[value] || (result[value] = [])).push(key);
  14202. * }, {});
  14203. * // => { '1': ['a', 'c'], '2': ['b'] }
  14204. */
  14205. function transform(object, iteratee, accumulator) {
  14206. var isArr = isArray(object),
  14207. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14208. iteratee = getIteratee(iteratee, 4);
  14209. if (accumulator == null) {
  14210. var Ctor = object && object.constructor;
  14211. if (isArrLike) {
  14212. accumulator = isArr ? new Ctor : [];
  14213. }
  14214. else if (isObject(object)) {
  14215. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14216. }
  14217. else {
  14218. accumulator = {};
  14219. }
  14220. }
  14221. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14222. return iteratee(accumulator, value, index, object);
  14223. });
  14224. return accumulator;
  14225. }
  14226. /**
  14227. * Removes the property at `path` of `object`.
  14228. *
  14229. * **Note:** This method mutates `object`.
  14230. *
  14231. * @static
  14232. * @memberOf _
  14233. * @since 4.0.0
  14234. * @category Object
  14235. * @param {Object} object The object to modify.
  14236. * @param {Array|string} path The path of the property to unset.
  14237. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14238. * @example
  14239. *
  14240. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14241. * _.unset(object, 'a[0].b.c');
  14242. * // => true
  14243. *
  14244. * console.log(object);
  14245. * // => { 'a': [{ 'b': {} }] };
  14246. *
  14247. * _.unset(object, ['a', '0', 'b', 'c']);
  14248. * // => true
  14249. *
  14250. * console.log(object);
  14251. * // => { 'a': [{ 'b': {} }] };
  14252. */
  14253. function unset(object, path) {
  14254. return object == null ? true : baseUnset(object, path);
  14255. }
  14256. /**
  14257. * This method is like `_.set` except that accepts `updater` to produce the
  14258. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14259. * is invoked with one argument: (value).
  14260. *
  14261. * **Note:** This method mutates `object`.
  14262. *
  14263. * @static
  14264. * @memberOf _
  14265. * @since 4.6.0
  14266. * @category Object
  14267. * @param {Object} object The object to modify.
  14268. * @param {Array|string} path The path of the property to set.
  14269. * @param {Function} updater The function to produce the updated value.
  14270. * @returns {Object} Returns `object`.
  14271. * @example
  14272. *
  14273. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14274. *
  14275. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14276. * console.log(object.a[0].b.c);
  14277. * // => 9
  14278. *
  14279. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14280. * console.log(object.x[0].y.z);
  14281. * // => 0
  14282. */
  14283. function update(object, path, updater) {
  14284. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14285. }
  14286. /**
  14287. * This method is like `_.update` except that it accepts `customizer` which is
  14288. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14289. * path creation is handled by the method instead. The `customizer` is invoked
  14290. * with three arguments: (nsValue, key, nsObject).
  14291. *
  14292. * **Note:** This method mutates `object`.
  14293. *
  14294. * @static
  14295. * @memberOf _
  14296. * @since 4.6.0
  14297. * @category Object
  14298. * @param {Object} object The object to modify.
  14299. * @param {Array|string} path The path of the property to set.
  14300. * @param {Function} updater The function to produce the updated value.
  14301. * @param {Function} [customizer] The function to customize assigned values.
  14302. * @returns {Object} Returns `object`.
  14303. * @example
  14304. *
  14305. * var object = {};
  14306. *
  14307. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14308. * // => { '0': { '1': 'a' } }
  14309. */
  14310. function updateWith(object, path, updater, customizer) {
  14311. customizer = typeof customizer == 'function' ? customizer : undefined;
  14312. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14313. }
  14314. /**
  14315. * Creates an array of the own enumerable string keyed property values of `object`.
  14316. *
  14317. * **Note:** Non-object values are coerced to objects.
  14318. *
  14319. * @static
  14320. * @since 0.1.0
  14321. * @memberOf _
  14322. * @category Object
  14323. * @param {Object} object The object to query.
  14324. * @returns {Array} Returns the array of property values.
  14325. * @example
  14326. *
  14327. * function Foo() {
  14328. * this.a = 1;
  14329. * this.b = 2;
  14330. * }
  14331. *
  14332. * Foo.prototype.c = 3;
  14333. *
  14334. * _.values(new Foo);
  14335. * // => [1, 2] (iteration order is not guaranteed)
  14336. *
  14337. * _.values('hi');
  14338. * // => ['h', 'i']
  14339. */
  14340. function values(object) {
  14341. return object == null ? [] : baseValues(object, keys(object));
  14342. }
  14343. /**
  14344. * Creates an array of the own and inherited enumerable string keyed property
  14345. * values of `object`.
  14346. *
  14347. * **Note:** Non-object values are coerced to objects.
  14348. *
  14349. * @static
  14350. * @memberOf _
  14351. * @since 3.0.0
  14352. * @category Object
  14353. * @param {Object} object The object to query.
  14354. * @returns {Array} Returns the array of property values.
  14355. * @example
  14356. *
  14357. * function Foo() {
  14358. * this.a = 1;
  14359. * this.b = 2;
  14360. * }
  14361. *
  14362. * Foo.prototype.c = 3;
  14363. *
  14364. * _.valuesIn(new Foo);
  14365. * // => [1, 2, 3] (iteration order is not guaranteed)
  14366. */
  14367. function valuesIn(object) {
  14368. return object == null ? [] : baseValues(object, keysIn(object));
  14369. }
  14370. /*------------------------------------------------------------------------*/
  14371. /**
  14372. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14373. *
  14374. * @static
  14375. * @memberOf _
  14376. * @since 4.0.0
  14377. * @category Number
  14378. * @param {number} number The number to clamp.
  14379. * @param {number} [lower] The lower bound.
  14380. * @param {number} upper The upper bound.
  14381. * @returns {number} Returns the clamped number.
  14382. * @example
  14383. *
  14384. * _.clamp(-10, -5, 5);
  14385. * // => -5
  14386. *
  14387. * _.clamp(10, -5, 5);
  14388. * // => 5
  14389. */
  14390. function clamp(number, lower, upper) {
  14391. if (upper === undefined) {
  14392. upper = lower;
  14393. lower = undefined;
  14394. }
  14395. if (upper !== undefined) {
  14396. upper = toNumber(upper);
  14397. upper = upper === upper ? upper : 0;
  14398. }
  14399. if (lower !== undefined) {
  14400. lower = toNumber(lower);
  14401. lower = lower === lower ? lower : 0;
  14402. }
  14403. return baseClamp(toNumber(number), lower, upper);
  14404. }
  14405. /**
  14406. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14407. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14408. * If `start` is greater than `end` the params are swapped to support
  14409. * negative ranges.
  14410. *
  14411. * @static
  14412. * @memberOf _
  14413. * @since 3.3.0
  14414. * @category Number
  14415. * @param {number} number The number to check.
  14416. * @param {number} [start=0] The start of the range.
  14417. * @param {number} end The end of the range.
  14418. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14419. * @see _.range, _.rangeRight
  14420. * @example
  14421. *
  14422. * _.inRange(3, 2, 4);
  14423. * // => true
  14424. *
  14425. * _.inRange(4, 8);
  14426. * // => true
  14427. *
  14428. * _.inRange(4, 2);
  14429. * // => false
  14430. *
  14431. * _.inRange(2, 2);
  14432. * // => false
  14433. *
  14434. * _.inRange(1.2, 2);
  14435. * // => true
  14436. *
  14437. * _.inRange(5.2, 4);
  14438. * // => false
  14439. *
  14440. * _.inRange(-3, -2, -6);
  14441. * // => true
  14442. */
  14443. function inRange(number, start, end) {
  14444. start = toFinite(start);
  14445. if (end === undefined) {
  14446. end = start;
  14447. start = 0;
  14448. } else {
  14449. end = toFinite(end);
  14450. }
  14451. number = toNumber(number);
  14452. return baseInRange(number, start, end);
  14453. }
  14454. /**
  14455. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14456. * If only one argument is provided a number between `0` and the given number
  14457. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14458. * floats, a floating-point number is returned instead of an integer.
  14459. *
  14460. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14461. * floating-point values which can produce unexpected results.
  14462. *
  14463. * @static
  14464. * @memberOf _
  14465. * @since 0.7.0
  14466. * @category Number
  14467. * @param {number} [lower=0] The lower bound.
  14468. * @param {number} [upper=1] The upper bound.
  14469. * @param {boolean} [floating] Specify returning a floating-point number.
  14470. * @returns {number} Returns the random number.
  14471. * @example
  14472. *
  14473. * _.random(0, 5);
  14474. * // => an integer between 0 and 5
  14475. *
  14476. * _.random(5);
  14477. * // => also an integer between 0 and 5
  14478. *
  14479. * _.random(5, true);
  14480. * // => a floating-point number between 0 and 5
  14481. *
  14482. * _.random(1.2, 5.2);
  14483. * // => a floating-point number between 1.2 and 5.2
  14484. */
  14485. function random(lower, upper, floating) {
  14486. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14487. upper = floating = undefined;
  14488. }
  14489. if (floating === undefined) {
  14490. if (typeof upper == 'boolean') {
  14491. floating = upper;
  14492. upper = undefined;
  14493. }
  14494. else if (typeof lower == 'boolean') {
  14495. floating = lower;
  14496. lower = undefined;
  14497. }
  14498. }
  14499. if (lower === undefined && upper === undefined) {
  14500. lower = 0;
  14501. upper = 1;
  14502. }
  14503. else {
  14504. lower = toFinite(lower);
  14505. if (upper === undefined) {
  14506. upper = lower;
  14507. lower = 0;
  14508. } else {
  14509. upper = toFinite(upper);
  14510. }
  14511. }
  14512. if (lower > upper) {
  14513. var temp = lower;
  14514. lower = upper;
  14515. upper = temp;
  14516. }
  14517. if (floating || lower % 1 || upper % 1) {
  14518. var rand = nativeRandom();
  14519. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14520. }
  14521. return baseRandom(lower, upper);
  14522. }
  14523. /*------------------------------------------------------------------------*/
  14524. /**
  14525. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14526. *
  14527. * @static
  14528. * @memberOf _
  14529. * @since 3.0.0
  14530. * @category String
  14531. * @param {string} [string=''] The string to convert.
  14532. * @returns {string} Returns the camel cased string.
  14533. * @example
  14534. *
  14535. * _.camelCase('Foo Bar');
  14536. * // => 'fooBar'
  14537. *
  14538. * _.camelCase('--foo-bar--');
  14539. * // => 'fooBar'
  14540. *
  14541. * _.camelCase('__FOO_BAR__');
  14542. * // => 'fooBar'
  14543. */
  14544. var camelCase = createCompounder(function(result, word, index) {
  14545. word = word.toLowerCase();
  14546. return result + (index ? capitalize(word) : word);
  14547. });
  14548. /**
  14549. * Converts the first character of `string` to upper case and the remaining
  14550. * to lower case.
  14551. *
  14552. * @static
  14553. * @memberOf _
  14554. * @since 3.0.0
  14555. * @category String
  14556. * @param {string} [string=''] The string to capitalize.
  14557. * @returns {string} Returns the capitalized string.
  14558. * @example
  14559. *
  14560. * _.capitalize('FRED');
  14561. * // => 'Fred'
  14562. */
  14563. function capitalize(string) {
  14564. return upperFirst(toString(string).toLowerCase());
  14565. }
  14566. /**
  14567. * Deburrs `string` by converting
  14568. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14569. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14570. * letters to basic Latin letters and removing
  14571. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14572. *
  14573. * @static
  14574. * @memberOf _
  14575. * @since 3.0.0
  14576. * @category String
  14577. * @param {string} [string=''] The string to deburr.
  14578. * @returns {string} Returns the deburred string.
  14579. * @example
  14580. *
  14581. * _.deburr('déjà vu');
  14582. * // => 'deja vu'
  14583. */
  14584. function deburr(string) {
  14585. string = toString(string);
  14586. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14587. }
  14588. /**
  14589. * Checks if `string` ends with the given target string.
  14590. *
  14591. * @static
  14592. * @memberOf _
  14593. * @since 3.0.0
  14594. * @category String
  14595. * @param {string} [string=''] The string to inspect.
  14596. * @param {string} [target] The string to search for.
  14597. * @param {number} [position=string.length] The position to search up to.
  14598. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14599. * else `false`.
  14600. * @example
  14601. *
  14602. * _.endsWith('abc', 'c');
  14603. * // => true
  14604. *
  14605. * _.endsWith('abc', 'b');
  14606. * // => false
  14607. *
  14608. * _.endsWith('abc', 'b', 2);
  14609. * // => true
  14610. */
  14611. function endsWith(string, target, position) {
  14612. string = toString(string);
  14613. target = baseToString(target);
  14614. var length = string.length;
  14615. position = position === undefined
  14616. ? length
  14617. : baseClamp(toInteger(position), 0, length);
  14618. var end = position;
  14619. position -= target.length;
  14620. return position >= 0 && string.slice(position, end) == target;
  14621. }
  14622. /**
  14623. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14624. * corresponding HTML entities.
  14625. *
  14626. * **Note:** No other characters are escaped. To escape additional
  14627. * characters use a third-party library like [_he_](https://mths.be/he).
  14628. *
  14629. * Though the ">" character is escaped for symmetry, characters like
  14630. * ">" and "/" don't need escaping in HTML and have no special meaning
  14631. * unless they're part of a tag or unquoted attribute value. See
  14632. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14633. * (under "semi-related fun fact") for more details.
  14634. *
  14635. * When working with HTML you should always
  14636. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14637. * XSS vectors.
  14638. *
  14639. * @static
  14640. * @since 0.1.0
  14641. * @memberOf _
  14642. * @category String
  14643. * @param {string} [string=''] The string to escape.
  14644. * @returns {string} Returns the escaped string.
  14645. * @example
  14646. *
  14647. * _.escape('fred, barney, & pebbles');
  14648. * // => 'fred, barney, &amp; pebbles'
  14649. */
  14650. function escape(string) {
  14651. string = toString(string);
  14652. return (string && reHasUnescapedHtml.test(string))
  14653. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14654. : string;
  14655. }
  14656. /**
  14657. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14658. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14659. *
  14660. * @static
  14661. * @memberOf _
  14662. * @since 3.0.0
  14663. * @category String
  14664. * @param {string} [string=''] The string to escape.
  14665. * @returns {string} Returns the escaped string.
  14666. * @example
  14667. *
  14668. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14669. * // => '\[lodash\]\(https://lodash\.com/\)'
  14670. */
  14671. function escapeRegExp(string) {
  14672. string = toString(string);
  14673. return (string && reHasRegExpChar.test(string))
  14674. ? string.replace(reRegExpChar, '\\$&')
  14675. : string;
  14676. }
  14677. /**
  14678. * Converts `string` to
  14679. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14680. *
  14681. * @static
  14682. * @memberOf _
  14683. * @since 3.0.0
  14684. * @category String
  14685. * @param {string} [string=''] The string to convert.
  14686. * @returns {string} Returns the kebab cased string.
  14687. * @example
  14688. *
  14689. * _.kebabCase('Foo Bar');
  14690. * // => 'foo-bar'
  14691. *
  14692. * _.kebabCase('fooBar');
  14693. * // => 'foo-bar'
  14694. *
  14695. * _.kebabCase('__FOO_BAR__');
  14696. * // => 'foo-bar'
  14697. */
  14698. var kebabCase = createCompounder(function(result, word, index) {
  14699. return result + (index ? '-' : '') + word.toLowerCase();
  14700. });
  14701. /**
  14702. * Converts `string`, as space separated words, to lower case.
  14703. *
  14704. * @static
  14705. * @memberOf _
  14706. * @since 4.0.0
  14707. * @category String
  14708. * @param {string} [string=''] The string to convert.
  14709. * @returns {string} Returns the lower cased string.
  14710. * @example
  14711. *
  14712. * _.lowerCase('--Foo-Bar--');
  14713. * // => 'foo bar'
  14714. *
  14715. * _.lowerCase('fooBar');
  14716. * // => 'foo bar'
  14717. *
  14718. * _.lowerCase('__FOO_BAR__');
  14719. * // => 'foo bar'
  14720. */
  14721. var lowerCase = createCompounder(function(result, word, index) {
  14722. return result + (index ? ' ' : '') + word.toLowerCase();
  14723. });
  14724. /**
  14725. * Converts the first character of `string` to lower case.
  14726. *
  14727. * @static
  14728. * @memberOf _
  14729. * @since 4.0.0
  14730. * @category String
  14731. * @param {string} [string=''] The string to convert.
  14732. * @returns {string} Returns the converted string.
  14733. * @example
  14734. *
  14735. * _.lowerFirst('Fred');
  14736. * // => 'fred'
  14737. *
  14738. * _.lowerFirst('FRED');
  14739. * // => 'fRED'
  14740. */
  14741. var lowerFirst = createCaseFirst('toLowerCase');
  14742. /**
  14743. * Pads `string` on the left and right sides if it's shorter than `length`.
  14744. * Padding characters are truncated if they can't be evenly divided by `length`.
  14745. *
  14746. * @static
  14747. * @memberOf _
  14748. * @since 3.0.0
  14749. * @category String
  14750. * @param {string} [string=''] The string to pad.
  14751. * @param {number} [length=0] The padding length.
  14752. * @param {string} [chars=' '] The string used as padding.
  14753. * @returns {string} Returns the padded string.
  14754. * @example
  14755. *
  14756. * _.pad('abc', 8);
  14757. * // => ' abc '
  14758. *
  14759. * _.pad('abc', 8, '_-');
  14760. * // => '_-abc_-_'
  14761. *
  14762. * _.pad('abc', 3);
  14763. * // => 'abc'
  14764. */
  14765. function pad(string, length, chars) {
  14766. string = toString(string);
  14767. length = toInteger(length);
  14768. var strLength = length ? stringSize(string) : 0;
  14769. if (!length || strLength >= length) {
  14770. return string;
  14771. }
  14772. var mid = (length - strLength) / 2;
  14773. return (
  14774. createPadding(nativeFloor(mid), chars) +
  14775. string +
  14776. createPadding(nativeCeil(mid), chars)
  14777. );
  14778. }
  14779. /**
  14780. * Pads `string` on the right side if it's shorter than `length`. Padding
  14781. * characters are truncated if they exceed `length`.
  14782. *
  14783. * @static
  14784. * @memberOf _
  14785. * @since 4.0.0
  14786. * @category String
  14787. * @param {string} [string=''] The string to pad.
  14788. * @param {number} [length=0] The padding length.
  14789. * @param {string} [chars=' '] The string used as padding.
  14790. * @returns {string} Returns the padded string.
  14791. * @example
  14792. *
  14793. * _.padEnd('abc', 6);
  14794. * // => 'abc '
  14795. *
  14796. * _.padEnd('abc', 6, '_-');
  14797. * // => 'abc_-_'
  14798. *
  14799. * _.padEnd('abc', 3);
  14800. * // => 'abc'
  14801. */
  14802. function padEnd(string, length, chars) {
  14803. string = toString(string);
  14804. length = toInteger(length);
  14805. var strLength = length ? stringSize(string) : 0;
  14806. return (length && strLength < length)
  14807. ? (string + createPadding(length - strLength, chars))
  14808. : string;
  14809. }
  14810. /**
  14811. * Pads `string` on the left side if it's shorter than `length`. Padding
  14812. * characters are truncated if they exceed `length`.
  14813. *
  14814. * @static
  14815. * @memberOf _
  14816. * @since 4.0.0
  14817. * @category String
  14818. * @param {string} [string=''] The string to pad.
  14819. * @param {number} [length=0] The padding length.
  14820. * @param {string} [chars=' '] The string used as padding.
  14821. * @returns {string} Returns the padded string.
  14822. * @example
  14823. *
  14824. * _.padStart('abc', 6);
  14825. * // => ' abc'
  14826. *
  14827. * _.padStart('abc', 6, '_-');
  14828. * // => '_-_abc'
  14829. *
  14830. * _.padStart('abc', 3);
  14831. * // => 'abc'
  14832. */
  14833. function padStart(string, length, chars) {
  14834. string = toString(string);
  14835. length = toInteger(length);
  14836. var strLength = length ? stringSize(string) : 0;
  14837. return (length && strLength < length)
  14838. ? (createPadding(length - strLength, chars) + string)
  14839. : string;
  14840. }
  14841. /**
  14842. * Converts `string` to an integer of the specified radix. If `radix` is
  14843. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14844. * hexadecimal, in which case a `radix` of `16` is used.
  14845. *
  14846. * **Note:** This method aligns with the
  14847. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14848. *
  14849. * @static
  14850. * @memberOf _
  14851. * @since 1.1.0
  14852. * @category String
  14853. * @param {string} string The string to convert.
  14854. * @param {number} [radix=10] The radix to interpret `value` by.
  14855. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14856. * @returns {number} Returns the converted integer.
  14857. * @example
  14858. *
  14859. * _.parseInt('08');
  14860. * // => 8
  14861. *
  14862. * _.map(['6', '08', '10'], _.parseInt);
  14863. * // => [6, 8, 10]
  14864. */
  14865. function parseInt(string, radix, guard) {
  14866. if (guard || radix == null) {
  14867. radix = 0;
  14868. } else if (radix) {
  14869. radix = +radix;
  14870. }
  14871. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14872. }
  14873. /**
  14874. * Repeats the given string `n` times.
  14875. *
  14876. * @static
  14877. * @memberOf _
  14878. * @since 3.0.0
  14879. * @category String
  14880. * @param {string} [string=''] The string to repeat.
  14881. * @param {number} [n=1] The number of times to repeat the string.
  14882. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14883. * @returns {string} Returns the repeated string.
  14884. * @example
  14885. *
  14886. * _.repeat('*', 3);
  14887. * // => '***'
  14888. *
  14889. * _.repeat('abc', 2);
  14890. * // => 'abcabc'
  14891. *
  14892. * _.repeat('abc', 0);
  14893. * // => ''
  14894. */
  14895. function repeat(string, n, guard) {
  14896. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14897. n = 1;
  14898. } else {
  14899. n = toInteger(n);
  14900. }
  14901. return baseRepeat(toString(string), n);
  14902. }
  14903. /**
  14904. * Replaces matches for `pattern` in `string` with `replacement`.
  14905. *
  14906. * **Note:** This method is based on
  14907. * [`String#replace`](https://mdn.io/String/replace).
  14908. *
  14909. * @static
  14910. * @memberOf _
  14911. * @since 4.0.0
  14912. * @category String
  14913. * @param {string} [string=''] The string to modify.
  14914. * @param {RegExp|string} pattern The pattern to replace.
  14915. * @param {Function|string} replacement The match replacement.
  14916. * @returns {string} Returns the modified string.
  14917. * @example
  14918. *
  14919. * _.replace('Hi Fred', 'Fred', 'Barney');
  14920. * // => 'Hi Barney'
  14921. */
  14922. function replace() {
  14923. var args = arguments,
  14924. string = toString(args[0]);
  14925. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14926. }
  14927. /**
  14928. * Converts `string` to
  14929. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14930. *
  14931. * @static
  14932. * @memberOf _
  14933. * @since 3.0.0
  14934. * @category String
  14935. * @param {string} [string=''] The string to convert.
  14936. * @returns {string} Returns the snake cased string.
  14937. * @example
  14938. *
  14939. * _.snakeCase('Foo Bar');
  14940. * // => 'foo_bar'
  14941. *
  14942. * _.snakeCase('fooBar');
  14943. * // => 'foo_bar'
  14944. *
  14945. * _.snakeCase('--FOO-BAR--');
  14946. * // => 'foo_bar'
  14947. */
  14948. var snakeCase = createCompounder(function(result, word, index) {
  14949. return result + (index ? '_' : '') + word.toLowerCase();
  14950. });
  14951. /**
  14952. * Splits `string` by `separator`.
  14953. *
  14954. * **Note:** This method is based on
  14955. * [`String#split`](https://mdn.io/String/split).
  14956. *
  14957. * @static
  14958. * @memberOf _
  14959. * @since 4.0.0
  14960. * @category String
  14961. * @param {string} [string=''] The string to split.
  14962. * @param {RegExp|string} separator The separator pattern to split by.
  14963. * @param {number} [limit] The length to truncate results to.
  14964. * @returns {Array} Returns the string segments.
  14965. * @example
  14966. *
  14967. * _.split('a-b-c', '-', 2);
  14968. * // => ['a', 'b']
  14969. */
  14970. function split(string, separator, limit) {
  14971. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14972. separator = limit = undefined;
  14973. }
  14974. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14975. if (!limit) {
  14976. return [];
  14977. }
  14978. string = toString(string);
  14979. if (string && (
  14980. typeof separator == 'string' ||
  14981. (separator != null && !isRegExp(separator))
  14982. )) {
  14983. separator = baseToString(separator);
  14984. if (!separator && hasUnicode(string)) {
  14985. return castSlice(stringToArray(string), 0, limit);
  14986. }
  14987. }
  14988. return string.split(separator, limit);
  14989. }
  14990. /**
  14991. * Converts `string` to
  14992. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14993. *
  14994. * @static
  14995. * @memberOf _
  14996. * @since 3.1.0
  14997. * @category String
  14998. * @param {string} [string=''] The string to convert.
  14999. * @returns {string} Returns the start cased string.
  15000. * @example
  15001. *
  15002. * _.startCase('--foo-bar--');
  15003. * // => 'Foo Bar'
  15004. *
  15005. * _.startCase('fooBar');
  15006. * // => 'Foo Bar'
  15007. *
  15008. * _.startCase('__FOO_BAR__');
  15009. * // => 'FOO BAR'
  15010. */
  15011. var startCase = createCompounder(function(result, word, index) {
  15012. return result + (index ? ' ' : '') + upperFirst(word);
  15013. });
  15014. /**
  15015. * Checks if `string` starts with the given target string.
  15016. *
  15017. * @static
  15018. * @memberOf _
  15019. * @since 3.0.0
  15020. * @category String
  15021. * @param {string} [string=''] The string to inspect.
  15022. * @param {string} [target] The string to search for.
  15023. * @param {number} [position=0] The position to search from.
  15024. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15025. * else `false`.
  15026. * @example
  15027. *
  15028. * _.startsWith('abc', 'a');
  15029. * // => true
  15030. *
  15031. * _.startsWith('abc', 'b');
  15032. * // => false
  15033. *
  15034. * _.startsWith('abc', 'b', 1);
  15035. * // => true
  15036. */
  15037. function startsWith(string, target, position) {
  15038. string = toString(string);
  15039. position = position == null
  15040. ? 0
  15041. : baseClamp(toInteger(position), 0, string.length);
  15042. target = baseToString(target);
  15043. return string.slice(position, position + target.length) == target;
  15044. }
  15045. /**
  15046. * Creates a compiled template function that can interpolate data properties
  15047. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15048. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15049. * properties may be accessed as free variables in the template. If a setting
  15050. * object is given, it takes precedence over `_.templateSettings` values.
  15051. *
  15052. * **Note:** In the development build `_.template` utilizes
  15053. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15054. * for easier debugging.
  15055. *
  15056. * For more information on precompiling templates see
  15057. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15058. *
  15059. * For more information on Chrome extension sandboxes see
  15060. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15061. *
  15062. * @static
  15063. * @since 0.1.0
  15064. * @memberOf _
  15065. * @category String
  15066. * @param {string} [string=''] The template string.
  15067. * @param {Object} [options={}] The options object.
  15068. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15069. * The HTML "escape" delimiter.
  15070. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15071. * The "evaluate" delimiter.
  15072. * @param {Object} [options.imports=_.templateSettings.imports]
  15073. * An object to import into the template as free variables.
  15074. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15075. * The "interpolate" delimiter.
  15076. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15077. * The sourceURL of the compiled template.
  15078. * @param {string} [options.variable='obj']
  15079. * The data object variable name.
  15080. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15081. * @returns {Function} Returns the compiled template function.
  15082. * @example
  15083. *
  15084. * // Use the "interpolate" delimiter to create a compiled template.
  15085. * var compiled = _.template('hello <%= user %>!');
  15086. * compiled({ 'user': 'fred' });
  15087. * // => 'hello fred!'
  15088. *
  15089. * // Use the HTML "escape" delimiter to escape data property values.
  15090. * var compiled = _.template('<b><%- value %></b>');
  15091. * compiled({ 'value': '<script>' });
  15092. * // => '<b>&lt;script&gt;</b>'
  15093. *
  15094. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15095. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15096. * compiled({ 'users': ['fred', 'barney'] });
  15097. * // => '<li>fred</li><li>barney</li>'
  15098. *
  15099. * // Use the internal `print` function in "evaluate" delimiters.
  15100. * var compiled = _.template('<% print("hello " + user); %>!');
  15101. * compiled({ 'user': 'barney' });
  15102. * // => 'hello barney!'
  15103. *
  15104. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15105. * // Disable support by replacing the "interpolate" delimiter.
  15106. * var compiled = _.template('hello ${ user }!');
  15107. * compiled({ 'user': 'pebbles' });
  15108. * // => 'hello pebbles!'
  15109. *
  15110. * // Use backslashes to treat delimiters as plain text.
  15111. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15112. * compiled({ 'value': 'ignored' });
  15113. * // => '<%- value %>'
  15114. *
  15115. * // Use the `imports` option to import `jQuery` as `jq`.
  15116. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15117. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15118. * compiled({ 'users': ['fred', 'barney'] });
  15119. * // => '<li>fred</li><li>barney</li>'
  15120. *
  15121. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15122. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15123. * compiled(data);
  15124. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15125. *
  15126. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15127. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15128. * compiled.source;
  15129. * // => function(data) {
  15130. * // var __t, __p = '';
  15131. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15132. * // return __p;
  15133. * // }
  15134. *
  15135. * // Use custom template delimiters.
  15136. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15137. * var compiled = _.template('hello {{ user }}!');
  15138. * compiled({ 'user': 'mustache' });
  15139. * // => 'hello mustache!'
  15140. *
  15141. * // Use the `source` property to inline compiled templates for meaningful
  15142. * // line numbers in error messages and stack traces.
  15143. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15144. * var JST = {\
  15145. * "main": ' + _.template(mainText).source + '\
  15146. * };\
  15147. * ');
  15148. */
  15149. function template(string, options, guard) {
  15150. // Based on John Resig's `tmpl` implementation
  15151. // (http://ejohn.org/blog/javascript-micro-templating/)
  15152. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15153. var settings = lodash.templateSettings;
  15154. if (guard && isIterateeCall(string, options, guard)) {
  15155. options = undefined;
  15156. }
  15157. string = toString(string);
  15158. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15159. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15160. importsKeys = keys(imports),
  15161. importsValues = baseValues(imports, importsKeys);
  15162. var isEscaping,
  15163. isEvaluating,
  15164. index = 0,
  15165. interpolate = options.interpolate || reNoMatch,
  15166. source = "__p += '";
  15167. // Compile the regexp to match each delimiter.
  15168. var reDelimiters = RegExp(
  15169. (options.escape || reNoMatch).source + '|' +
  15170. interpolate.source + '|' +
  15171. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15172. (options.evaluate || reNoMatch).source + '|$'
  15173. , 'g');
  15174. // Use a sourceURL for easier debugging.
  15175. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15176. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15177. // and escape the comment, thus injecting code that gets evaled.
  15178. var sourceURL = '//# sourceURL=' +
  15179. (hasOwnProperty.call(options, 'sourceURL')
  15180. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15181. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15182. ) + '\n';
  15183. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15184. interpolateValue || (interpolateValue = esTemplateValue);
  15185. // Escape characters that can't be included in string literals.
  15186. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15187. // Replace delimiters with snippets.
  15188. if (escapeValue) {
  15189. isEscaping = true;
  15190. source += "' +\n__e(" + escapeValue + ") +\n'";
  15191. }
  15192. if (evaluateValue) {
  15193. isEvaluating = true;
  15194. source += "';\n" + evaluateValue + ";\n__p += '";
  15195. }
  15196. if (interpolateValue) {
  15197. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15198. }
  15199. index = offset + match.length;
  15200. // The JS engine embedded in Adobe products needs `match` returned in
  15201. // order to produce the correct `offset` value.
  15202. return match;
  15203. });
  15204. source += "';\n";
  15205. // If `variable` is not specified wrap a with-statement around the generated
  15206. // code to add the data object to the top of the scope chain.
  15207. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15208. if (!variable) {
  15209. source = 'with (obj) {\n' + source + '\n}\n';
  15210. }
  15211. // Throw an error if a forbidden character was found in `variable`, to prevent
  15212. // potential command injection attacks.
  15213. else if (reForbiddenIdentifierChars.test(variable)) {
  15214. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15215. }
  15216. // Cleanup code by stripping empty strings.
  15217. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15218. .replace(reEmptyStringMiddle, '$1')
  15219. .replace(reEmptyStringTrailing, '$1;');
  15220. // Frame code as the function body.
  15221. source = 'function(' + (variable || 'obj') + ') {\n' +
  15222. (variable
  15223. ? ''
  15224. : 'obj || (obj = {});\n'
  15225. ) +
  15226. "var __t, __p = ''" +
  15227. (isEscaping
  15228. ? ', __e = _.escape'
  15229. : ''
  15230. ) +
  15231. (isEvaluating
  15232. ? ', __j = Array.prototype.join;\n' +
  15233. "function print() { __p += __j.call(arguments, '') }\n"
  15234. : ';\n'
  15235. ) +
  15236. source +
  15237. 'return __p\n}';
  15238. var result = attempt(function() {
  15239. return Function(importsKeys, sourceURL + 'return ' + source)
  15240. .apply(undefined, importsValues);
  15241. });
  15242. // Provide the compiled function's source by its `toString` method or
  15243. // the `source` property as a convenience for inlining compiled templates.
  15244. result.source = source;
  15245. if (isError(result)) {
  15246. throw result;
  15247. }
  15248. return result;
  15249. }
  15250. /**
  15251. * Converts `string`, as a whole, to lower case just like
  15252. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15253. *
  15254. * @static
  15255. * @memberOf _
  15256. * @since 4.0.0
  15257. * @category String
  15258. * @param {string} [string=''] The string to convert.
  15259. * @returns {string} Returns the lower cased string.
  15260. * @example
  15261. *
  15262. * _.toLower('--Foo-Bar--');
  15263. * // => '--foo-bar--'
  15264. *
  15265. * _.toLower('fooBar');
  15266. * // => 'foobar'
  15267. *
  15268. * _.toLower('__FOO_BAR__');
  15269. * // => '__foo_bar__'
  15270. */
  15271. function toLower(value) {
  15272. return toString(value).toLowerCase();
  15273. }
  15274. /**
  15275. * Converts `string`, as a whole, to upper case just like
  15276. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15277. *
  15278. * @static
  15279. * @memberOf _
  15280. * @since 4.0.0
  15281. * @category String
  15282. * @param {string} [string=''] The string to convert.
  15283. * @returns {string} Returns the upper cased string.
  15284. * @example
  15285. *
  15286. * _.toUpper('--foo-bar--');
  15287. * // => '--FOO-BAR--'
  15288. *
  15289. * _.toUpper('fooBar');
  15290. * // => 'FOOBAR'
  15291. *
  15292. * _.toUpper('__foo_bar__');
  15293. * // => '__FOO_BAR__'
  15294. */
  15295. function toUpper(value) {
  15296. return toString(value).toUpperCase();
  15297. }
  15298. /**
  15299. * Removes leading and trailing whitespace or specified characters from `string`.
  15300. *
  15301. * @static
  15302. * @memberOf _
  15303. * @since 3.0.0
  15304. * @category String
  15305. * @param {string} [string=''] The string to trim.
  15306. * @param {string} [chars=whitespace] The characters to trim.
  15307. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15308. * @returns {string} Returns the trimmed string.
  15309. * @example
  15310. *
  15311. * _.trim(' abc ');
  15312. * // => 'abc'
  15313. *
  15314. * _.trim('-_-abc-_-', '_-');
  15315. * // => 'abc'
  15316. *
  15317. * _.map([' foo ', ' bar '], _.trim);
  15318. * // => ['foo', 'bar']
  15319. */
  15320. function trim(string, chars, guard) {
  15321. string = toString(string);
  15322. if (string && (guard || chars === undefined)) {
  15323. return baseTrim(string);
  15324. }
  15325. if (!string || !(chars = baseToString(chars))) {
  15326. return string;
  15327. }
  15328. var strSymbols = stringToArray(string),
  15329. chrSymbols = stringToArray(chars),
  15330. start = charsStartIndex(strSymbols, chrSymbols),
  15331. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15332. return castSlice(strSymbols, start, end).join('');
  15333. }
  15334. /**
  15335. * Removes trailing whitespace or specified characters from `string`.
  15336. *
  15337. * @static
  15338. * @memberOf _
  15339. * @since 4.0.0
  15340. * @category String
  15341. * @param {string} [string=''] The string to trim.
  15342. * @param {string} [chars=whitespace] The characters to trim.
  15343. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15344. * @returns {string} Returns the trimmed string.
  15345. * @example
  15346. *
  15347. * _.trimEnd(' abc ');
  15348. * // => ' abc'
  15349. *
  15350. * _.trimEnd('-_-abc-_-', '_-');
  15351. * // => '-_-abc'
  15352. */
  15353. function trimEnd(string, chars, guard) {
  15354. string = toString(string);
  15355. if (string && (guard || chars === undefined)) {
  15356. return string.slice(0, trimmedEndIndex(string) + 1);
  15357. }
  15358. if (!string || !(chars = baseToString(chars))) {
  15359. return string;
  15360. }
  15361. var strSymbols = stringToArray(string),
  15362. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15363. return castSlice(strSymbols, 0, end).join('');
  15364. }
  15365. /**
  15366. * Removes leading whitespace or specified characters from `string`.
  15367. *
  15368. * @static
  15369. * @memberOf _
  15370. * @since 4.0.0
  15371. * @category String
  15372. * @param {string} [string=''] The string to trim.
  15373. * @param {string} [chars=whitespace] The characters to trim.
  15374. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15375. * @returns {string} Returns the trimmed string.
  15376. * @example
  15377. *
  15378. * _.trimStart(' abc ');
  15379. * // => 'abc '
  15380. *
  15381. * _.trimStart('-_-abc-_-', '_-');
  15382. * // => 'abc-_-'
  15383. */
  15384. function trimStart(string, chars, guard) {
  15385. string = toString(string);
  15386. if (string && (guard || chars === undefined)) {
  15387. return string.replace(reTrimStart, '');
  15388. }
  15389. if (!string || !(chars = baseToString(chars))) {
  15390. return string;
  15391. }
  15392. var strSymbols = stringToArray(string),
  15393. start = charsStartIndex(strSymbols, stringToArray(chars));
  15394. return castSlice(strSymbols, start).join('');
  15395. }
  15396. /**
  15397. * Truncates `string` if it's longer than the given maximum string length.
  15398. * The last characters of the truncated string are replaced with the omission
  15399. * string which defaults to "...".
  15400. *
  15401. * @static
  15402. * @memberOf _
  15403. * @since 4.0.0
  15404. * @category String
  15405. * @param {string} [string=''] The string to truncate.
  15406. * @param {Object} [options={}] The options object.
  15407. * @param {number} [options.length=30] The maximum string length.
  15408. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15409. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15410. * @returns {string} Returns the truncated string.
  15411. * @example
  15412. *
  15413. * _.truncate('hi-diddly-ho there, neighborino');
  15414. * // => 'hi-diddly-ho there, neighbo...'
  15415. *
  15416. * _.truncate('hi-diddly-ho there, neighborino', {
  15417. * 'length': 24,
  15418. * 'separator': ' '
  15419. * });
  15420. * // => 'hi-diddly-ho there,...'
  15421. *
  15422. * _.truncate('hi-diddly-ho there, neighborino', {
  15423. * 'length': 24,
  15424. * 'separator': /,? +/
  15425. * });
  15426. * // => 'hi-diddly-ho there...'
  15427. *
  15428. * _.truncate('hi-diddly-ho there, neighborino', {
  15429. * 'omission': ' [...]'
  15430. * });
  15431. * // => 'hi-diddly-ho there, neig [...]'
  15432. */
  15433. function truncate(string, options) {
  15434. var length = DEFAULT_TRUNC_LENGTH,
  15435. omission = DEFAULT_TRUNC_OMISSION;
  15436. if (isObject(options)) {
  15437. var separator = 'separator' in options ? options.separator : separator;
  15438. length = 'length' in options ? toInteger(options.length) : length;
  15439. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15440. }
  15441. string = toString(string);
  15442. var strLength = string.length;
  15443. if (hasUnicode(string)) {
  15444. var strSymbols = stringToArray(string);
  15445. strLength = strSymbols.length;
  15446. }
  15447. if (length >= strLength) {
  15448. return string;
  15449. }
  15450. var end = length - stringSize(omission);
  15451. if (end < 1) {
  15452. return omission;
  15453. }
  15454. var result = strSymbols
  15455. ? castSlice(strSymbols, 0, end).join('')
  15456. : string.slice(0, end);
  15457. if (separator === undefined) {
  15458. return result + omission;
  15459. }
  15460. if (strSymbols) {
  15461. end += (result.length - end);
  15462. }
  15463. if (isRegExp(separator)) {
  15464. if (string.slice(end).search(separator)) {
  15465. var match,
  15466. substring = result;
  15467. if (!separator.global) {
  15468. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15469. }
  15470. separator.lastIndex = 0;
  15471. while ((match = separator.exec(substring))) {
  15472. var newEnd = match.index;
  15473. }
  15474. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15475. }
  15476. } else if (string.indexOf(baseToString(separator), end) != end) {
  15477. var index = result.lastIndexOf(separator);
  15478. if (index > -1) {
  15479. result = result.slice(0, index);
  15480. }
  15481. }
  15482. return result + omission;
  15483. }
  15484. /**
  15485. * The inverse of `_.escape`; this method converts the HTML entities
  15486. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15487. * their corresponding characters.
  15488. *
  15489. * **Note:** No other HTML entities are unescaped. To unescape additional
  15490. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15491. *
  15492. * @static
  15493. * @memberOf _
  15494. * @since 0.6.0
  15495. * @category String
  15496. * @param {string} [string=''] The string to unescape.
  15497. * @returns {string} Returns the unescaped string.
  15498. * @example
  15499. *
  15500. * _.unescape('fred, barney, &amp; pebbles');
  15501. * // => 'fred, barney, & pebbles'
  15502. */
  15503. function unescape(string) {
  15504. string = toString(string);
  15505. return (string && reHasEscapedHtml.test(string))
  15506. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15507. : string;
  15508. }
  15509. /**
  15510. * Converts `string`, as space separated words, to upper case.
  15511. *
  15512. * @static
  15513. * @memberOf _
  15514. * @since 4.0.0
  15515. * @category String
  15516. * @param {string} [string=''] The string to convert.
  15517. * @returns {string} Returns the upper cased string.
  15518. * @example
  15519. *
  15520. * _.upperCase('--foo-bar');
  15521. * // => 'FOO BAR'
  15522. *
  15523. * _.upperCase('fooBar');
  15524. * // => 'FOO BAR'
  15525. *
  15526. * _.upperCase('__foo_bar__');
  15527. * // => 'FOO BAR'
  15528. */
  15529. var upperCase = createCompounder(function(result, word, index) {
  15530. return result + (index ? ' ' : '') + word.toUpperCase();
  15531. });
  15532. /**
  15533. * Converts the first character of `string` to upper case.
  15534. *
  15535. * @static
  15536. * @memberOf _
  15537. * @since 4.0.0
  15538. * @category String
  15539. * @param {string} [string=''] The string to convert.
  15540. * @returns {string} Returns the converted string.
  15541. * @example
  15542. *
  15543. * _.upperFirst('fred');
  15544. * // => 'Fred'
  15545. *
  15546. * _.upperFirst('FRED');
  15547. * // => 'FRED'
  15548. */
  15549. var upperFirst = createCaseFirst('toUpperCase');
  15550. /**
  15551. * Splits `string` into an array of its words.
  15552. *
  15553. * @static
  15554. * @memberOf _
  15555. * @since 3.0.0
  15556. * @category String
  15557. * @param {string} [string=''] The string to inspect.
  15558. * @param {RegExp|string} [pattern] The pattern to match words.
  15559. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15560. * @returns {Array} Returns the words of `string`.
  15561. * @example
  15562. *
  15563. * _.words('fred, barney, & pebbles');
  15564. * // => ['fred', 'barney', 'pebbles']
  15565. *
  15566. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15567. * // => ['fred', 'barney', '&', 'pebbles']
  15568. */
  15569. function words(string, pattern, guard) {
  15570. string = toString(string);
  15571. pattern = guard ? undefined : pattern;
  15572. if (pattern === undefined) {
  15573. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15574. }
  15575. return string.match(pattern) || [];
  15576. }
  15577. /*------------------------------------------------------------------------*/
  15578. /**
  15579. * Attempts to invoke `func`, returning either the result or the caught error
  15580. * object. Any additional arguments are provided to `func` when it's invoked.
  15581. *
  15582. * @static
  15583. * @memberOf _
  15584. * @since 3.0.0
  15585. * @category Util
  15586. * @param {Function} func The function to attempt.
  15587. * @param {...*} [args] The arguments to invoke `func` with.
  15588. * @returns {*} Returns the `func` result or error object.
  15589. * @example
  15590. *
  15591. * // Avoid throwing errors for invalid selectors.
  15592. * var elements = _.attempt(function(selector) {
  15593. * return document.querySelectorAll(selector);
  15594. * }, '>_>');
  15595. *
  15596. * if (_.isError(elements)) {
  15597. * elements = [];
  15598. * }
  15599. */
  15600. var attempt = baseRest(function(func, args) {
  15601. try {
  15602. return apply(func, undefined, args);
  15603. } catch (e) {
  15604. return isError(e) ? e : new Error(e);
  15605. }
  15606. });
  15607. /**
  15608. * Binds methods of an object to the object itself, overwriting the existing
  15609. * method.
  15610. *
  15611. * **Note:** This method doesn't set the "length" property of bound functions.
  15612. *
  15613. * @static
  15614. * @since 0.1.0
  15615. * @memberOf _
  15616. * @category Util
  15617. * @param {Object} object The object to bind and assign the bound methods to.
  15618. * @param {...(string|string[])} methodNames The object method names to bind.
  15619. * @returns {Object} Returns `object`.
  15620. * @example
  15621. *
  15622. * var view = {
  15623. * 'label': 'docs',
  15624. * 'click': function() {
  15625. * console.log('clicked ' + this.label);
  15626. * }
  15627. * };
  15628. *
  15629. * _.bindAll(view, ['click']);
  15630. * jQuery(element).on('click', view.click);
  15631. * // => Logs 'clicked docs' when clicked.
  15632. */
  15633. var bindAll = flatRest(function(object, methodNames) {
  15634. arrayEach(methodNames, function(key) {
  15635. key = toKey(key);
  15636. baseAssignValue(object, key, bind(object[key], object));
  15637. });
  15638. return object;
  15639. });
  15640. /**
  15641. * Creates a function that iterates over `pairs` and invokes the corresponding
  15642. * function of the first predicate to return truthy. The predicate-function
  15643. * pairs are invoked with the `this` binding and arguments of the created
  15644. * function.
  15645. *
  15646. * @static
  15647. * @memberOf _
  15648. * @since 4.0.0
  15649. * @category Util
  15650. * @param {Array} pairs The predicate-function pairs.
  15651. * @returns {Function} Returns the new composite function.
  15652. * @example
  15653. *
  15654. * var func = _.cond([
  15655. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15656. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15657. * [_.stubTrue, _.constant('no match')]
  15658. * ]);
  15659. *
  15660. * func({ 'a': 1, 'b': 2 });
  15661. * // => 'matches A'
  15662. *
  15663. * func({ 'a': 0, 'b': 1 });
  15664. * // => 'matches B'
  15665. *
  15666. * func({ 'a': '1', 'b': '2' });
  15667. * // => 'no match'
  15668. */
  15669. function cond(pairs) {
  15670. var length = pairs == null ? 0 : pairs.length,
  15671. toIteratee = getIteratee();
  15672. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15673. if (typeof pair[1] != 'function') {
  15674. throw new TypeError(FUNC_ERROR_TEXT);
  15675. }
  15676. return [toIteratee(pair[0]), pair[1]];
  15677. });
  15678. return baseRest(function(args) {
  15679. var index = -1;
  15680. while (++index < length) {
  15681. var pair = pairs[index];
  15682. if (apply(pair[0], this, args)) {
  15683. return apply(pair[1], this, args);
  15684. }
  15685. }
  15686. });
  15687. }
  15688. /**
  15689. * Creates a function that invokes the predicate properties of `source` with
  15690. * the corresponding property values of a given object, returning `true` if
  15691. * all predicates return truthy, else `false`.
  15692. *
  15693. * **Note:** The created function is equivalent to `_.conformsTo` with
  15694. * `source` partially applied.
  15695. *
  15696. * @static
  15697. * @memberOf _
  15698. * @since 4.0.0
  15699. * @category Util
  15700. * @param {Object} source The object of property predicates to conform to.
  15701. * @returns {Function} Returns the new spec function.
  15702. * @example
  15703. *
  15704. * var objects = [
  15705. * { 'a': 2, 'b': 1 },
  15706. * { 'a': 1, 'b': 2 }
  15707. * ];
  15708. *
  15709. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15710. * // => [{ 'a': 1, 'b': 2 }]
  15711. */
  15712. function conforms(source) {
  15713. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15714. }
  15715. /**
  15716. * Creates a function that returns `value`.
  15717. *
  15718. * @static
  15719. * @memberOf _
  15720. * @since 2.4.0
  15721. * @category Util
  15722. * @param {*} value The value to return from the new function.
  15723. * @returns {Function} Returns the new constant function.
  15724. * @example
  15725. *
  15726. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15727. *
  15728. * console.log(objects);
  15729. * // => [{ 'a': 1 }, { 'a': 1 }]
  15730. *
  15731. * console.log(objects[0] === objects[1]);
  15732. * // => true
  15733. */
  15734. function constant(value) {
  15735. return function() {
  15736. return value;
  15737. };
  15738. }
  15739. /**
  15740. * Checks `value` to determine whether a default value should be returned in
  15741. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15742. * or `undefined`.
  15743. *
  15744. * @static
  15745. * @memberOf _
  15746. * @since 4.14.0
  15747. * @category Util
  15748. * @param {*} value The value to check.
  15749. * @param {*} defaultValue The default value.
  15750. * @returns {*} Returns the resolved value.
  15751. * @example
  15752. *
  15753. * _.defaultTo(1, 10);
  15754. * // => 1
  15755. *
  15756. * _.defaultTo(undefined, 10);
  15757. * // => 10
  15758. */
  15759. function defaultTo(value, defaultValue) {
  15760. return (value == null || value !== value) ? defaultValue : value;
  15761. }
  15762. /**
  15763. * Creates a function that returns the result of invoking the given functions
  15764. * with the `this` binding of the created function, where each successive
  15765. * invocation is supplied the return value of the previous.
  15766. *
  15767. * @static
  15768. * @memberOf _
  15769. * @since 3.0.0
  15770. * @category Util
  15771. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15772. * @returns {Function} Returns the new composite function.
  15773. * @see _.flowRight
  15774. * @example
  15775. *
  15776. * function square(n) {
  15777. * return n * n;
  15778. * }
  15779. *
  15780. * var addSquare = _.flow([_.add, square]);
  15781. * addSquare(1, 2);
  15782. * // => 9
  15783. */
  15784. var flow = createFlow();
  15785. /**
  15786. * This method is like `_.flow` except that it creates a function that
  15787. * invokes the given functions from right to left.
  15788. *
  15789. * @static
  15790. * @since 3.0.0
  15791. * @memberOf _
  15792. * @category Util
  15793. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15794. * @returns {Function} Returns the new composite function.
  15795. * @see _.flow
  15796. * @example
  15797. *
  15798. * function square(n) {
  15799. * return n * n;
  15800. * }
  15801. *
  15802. * var addSquare = _.flowRight([square, _.add]);
  15803. * addSquare(1, 2);
  15804. * // => 9
  15805. */
  15806. var flowRight = createFlow(true);
  15807. /**
  15808. * This method returns the first argument it receives.
  15809. *
  15810. * @static
  15811. * @since 0.1.0
  15812. * @memberOf _
  15813. * @category Util
  15814. * @param {*} value Any value.
  15815. * @returns {*} Returns `value`.
  15816. * @example
  15817. *
  15818. * var object = { 'a': 1 };
  15819. *
  15820. * console.log(_.identity(object) === object);
  15821. * // => true
  15822. */
  15823. function identity(value) {
  15824. return value;
  15825. }
  15826. /**
  15827. * Creates a function that invokes `func` with the arguments of the created
  15828. * function. If `func` is a property name, the created function returns the
  15829. * property value for a given element. If `func` is an array or object, the
  15830. * created function returns `true` for elements that contain the equivalent
  15831. * source properties, otherwise it returns `false`.
  15832. *
  15833. * @static
  15834. * @since 4.0.0
  15835. * @memberOf _
  15836. * @category Util
  15837. * @param {*} [func=_.identity] The value to convert to a callback.
  15838. * @returns {Function} Returns the callback.
  15839. * @example
  15840. *
  15841. * var users = [
  15842. * { 'user': 'barney', 'age': 36, 'active': true },
  15843. * { 'user': 'fred', 'age': 40, 'active': false }
  15844. * ];
  15845. *
  15846. * // The `_.matches` iteratee shorthand.
  15847. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15848. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15849. *
  15850. * // The `_.matchesProperty` iteratee shorthand.
  15851. * _.filter(users, _.iteratee(['user', 'fred']));
  15852. * // => [{ 'user': 'fred', 'age': 40 }]
  15853. *
  15854. * // The `_.property` iteratee shorthand.
  15855. * _.map(users, _.iteratee('user'));
  15856. * // => ['barney', 'fred']
  15857. *
  15858. * // Create custom iteratee shorthands.
  15859. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15860. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15861. * return func.test(string);
  15862. * };
  15863. * });
  15864. *
  15865. * _.filter(['abc', 'def'], /ef/);
  15866. * // => ['def']
  15867. */
  15868. function iteratee(func) {
  15869. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15870. }
  15871. /**
  15872. * Creates a function that performs a partial deep comparison between a given
  15873. * object and `source`, returning `true` if the given object has equivalent
  15874. * property values, else `false`.
  15875. *
  15876. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15877. * partially applied.
  15878. *
  15879. * Partial comparisons will match empty array and empty object `source`
  15880. * values against any array or object value, respectively. See `_.isEqual`
  15881. * for a list of supported value comparisons.
  15882. *
  15883. * **Note:** Multiple values can be checked by combining several matchers
  15884. * using `_.overSome`
  15885. *
  15886. * @static
  15887. * @memberOf _
  15888. * @since 3.0.0
  15889. * @category Util
  15890. * @param {Object} source The object of property values to match.
  15891. * @returns {Function} Returns the new spec function.
  15892. * @example
  15893. *
  15894. * var objects = [
  15895. * { 'a': 1, 'b': 2, 'c': 3 },
  15896. * { 'a': 4, 'b': 5, 'c': 6 }
  15897. * ];
  15898. *
  15899. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15900. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15901. *
  15902. * // Checking for several possible values
  15903. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15904. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15905. */
  15906. function matches(source) {
  15907. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15908. }
  15909. /**
  15910. * Creates a function that performs a partial deep comparison between the
  15911. * value at `path` of a given object to `srcValue`, returning `true` if the
  15912. * object value is equivalent, else `false`.
  15913. *
  15914. * **Note:** Partial comparisons will match empty array and empty object
  15915. * `srcValue` values against any array or object value, respectively. See
  15916. * `_.isEqual` for a list of supported value comparisons.
  15917. *
  15918. * **Note:** Multiple values can be checked by combining several matchers
  15919. * using `_.overSome`
  15920. *
  15921. * @static
  15922. * @memberOf _
  15923. * @since 3.2.0
  15924. * @category Util
  15925. * @param {Array|string} path The path of the property to get.
  15926. * @param {*} srcValue The value to match.
  15927. * @returns {Function} Returns the new spec function.
  15928. * @example
  15929. *
  15930. * var objects = [
  15931. * { 'a': 1, 'b': 2, 'c': 3 },
  15932. * { 'a': 4, 'b': 5, 'c': 6 }
  15933. * ];
  15934. *
  15935. * _.find(objects, _.matchesProperty('a', 4));
  15936. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15937. *
  15938. * // Checking for several possible values
  15939. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15940. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15941. */
  15942. function matchesProperty(path, srcValue) {
  15943. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15944. }
  15945. /**
  15946. * Creates a function that invokes the method at `path` of a given object.
  15947. * Any additional arguments are provided to the invoked method.
  15948. *
  15949. * @static
  15950. * @memberOf _
  15951. * @since 3.7.0
  15952. * @category Util
  15953. * @param {Array|string} path The path of the method to invoke.
  15954. * @param {...*} [args] The arguments to invoke the method with.
  15955. * @returns {Function} Returns the new invoker function.
  15956. * @example
  15957. *
  15958. * var objects = [
  15959. * { 'a': { 'b': _.constant(2) } },
  15960. * { 'a': { 'b': _.constant(1) } }
  15961. * ];
  15962. *
  15963. * _.map(objects, _.method('a.b'));
  15964. * // => [2, 1]
  15965. *
  15966. * _.map(objects, _.method(['a', 'b']));
  15967. * // => [2, 1]
  15968. */
  15969. var method = baseRest(function(path, args) {
  15970. return function(object) {
  15971. return baseInvoke(object, path, args);
  15972. };
  15973. });
  15974. /**
  15975. * The opposite of `_.method`; this method creates a function that invokes
  15976. * the method at a given path of `object`. Any additional arguments are
  15977. * provided to the invoked method.
  15978. *
  15979. * @static
  15980. * @memberOf _
  15981. * @since 3.7.0
  15982. * @category Util
  15983. * @param {Object} object The object to query.
  15984. * @param {...*} [args] The arguments to invoke the method with.
  15985. * @returns {Function} Returns the new invoker function.
  15986. * @example
  15987. *
  15988. * var array = _.times(3, _.constant),
  15989. * object = { 'a': array, 'b': array, 'c': array };
  15990. *
  15991. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15992. * // => [2, 0]
  15993. *
  15994. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15995. * // => [2, 0]
  15996. */
  15997. var methodOf = baseRest(function(object, args) {
  15998. return function(path) {
  15999. return baseInvoke(object, path, args);
  16000. };
  16001. });
  16002. /**
  16003. * Adds all own enumerable string keyed function properties of a source
  16004. * object to the destination object. If `object` is a function, then methods
  16005. * are added to its prototype as well.
  16006. *
  16007. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16008. * avoid conflicts caused by modifying the original.
  16009. *
  16010. * @static
  16011. * @since 0.1.0
  16012. * @memberOf _
  16013. * @category Util
  16014. * @param {Function|Object} [object=lodash] The destination object.
  16015. * @param {Object} source The object of functions to add.
  16016. * @param {Object} [options={}] The options object.
  16017. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16018. * @returns {Function|Object} Returns `object`.
  16019. * @example
  16020. *
  16021. * function vowels(string) {
  16022. * return _.filter(string, function(v) {
  16023. * return /[aeiou]/i.test(v);
  16024. * });
  16025. * }
  16026. *
  16027. * _.mixin({ 'vowels': vowels });
  16028. * _.vowels('fred');
  16029. * // => ['e']
  16030. *
  16031. * _('fred').vowels().value();
  16032. * // => ['e']
  16033. *
  16034. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16035. * _('fred').vowels();
  16036. * // => ['e']
  16037. */
  16038. function mixin(object, source, options) {
  16039. var props = keys(source),
  16040. methodNames = baseFunctions(source, props);
  16041. if (options == null &&
  16042. !(isObject(source) && (methodNames.length || !props.length))) {
  16043. options = source;
  16044. source = object;
  16045. object = this;
  16046. methodNames = baseFunctions(source, keys(source));
  16047. }
  16048. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16049. isFunc = isFunction(object);
  16050. arrayEach(methodNames, function(methodName) {
  16051. var func = source[methodName];
  16052. object[methodName] = func;
  16053. if (isFunc) {
  16054. object.prototype[methodName] = function() {
  16055. var chainAll = this.__chain__;
  16056. if (chain || chainAll) {
  16057. var result = object(this.__wrapped__),
  16058. actions = result.__actions__ = copyArray(this.__actions__);
  16059. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16060. result.__chain__ = chainAll;
  16061. return result;
  16062. }
  16063. return func.apply(object, arrayPush([this.value()], arguments));
  16064. };
  16065. }
  16066. });
  16067. return object;
  16068. }
  16069. /**
  16070. * Reverts the `_` variable to its previous value and returns a reference to
  16071. * the `lodash` function.
  16072. *
  16073. * @static
  16074. * @since 0.1.0
  16075. * @memberOf _
  16076. * @category Util
  16077. * @returns {Function} Returns the `lodash` function.
  16078. * @example
  16079. *
  16080. * var lodash = _.noConflict();
  16081. */
  16082. function noConflict() {
  16083. if (root._ === this) {
  16084. root._ = oldDash;
  16085. }
  16086. return this;
  16087. }
  16088. /**
  16089. * This method returns `undefined`.
  16090. *
  16091. * @static
  16092. * @memberOf _
  16093. * @since 2.3.0
  16094. * @category Util
  16095. * @example
  16096. *
  16097. * _.times(2, _.noop);
  16098. * // => [undefined, undefined]
  16099. */
  16100. function noop() {
  16101. // No operation performed.
  16102. }
  16103. /**
  16104. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16105. * the nth argument from the end is returned.
  16106. *
  16107. * @static
  16108. * @memberOf _
  16109. * @since 4.0.0
  16110. * @category Util
  16111. * @param {number} [n=0] The index of the argument to return.
  16112. * @returns {Function} Returns the new pass-thru function.
  16113. * @example
  16114. *
  16115. * var func = _.nthArg(1);
  16116. * func('a', 'b', 'c', 'd');
  16117. * // => 'b'
  16118. *
  16119. * var func = _.nthArg(-2);
  16120. * func('a', 'b', 'c', 'd');
  16121. * // => 'c'
  16122. */
  16123. function nthArg(n) {
  16124. n = toInteger(n);
  16125. return baseRest(function(args) {
  16126. return baseNth(args, n);
  16127. });
  16128. }
  16129. /**
  16130. * Creates a function that invokes `iteratees` with the arguments it receives
  16131. * and returns their results.
  16132. *
  16133. * @static
  16134. * @memberOf _
  16135. * @since 4.0.0
  16136. * @category Util
  16137. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16138. * The iteratees to invoke.
  16139. * @returns {Function} Returns the new function.
  16140. * @example
  16141. *
  16142. * var func = _.over([Math.max, Math.min]);
  16143. *
  16144. * func(1, 2, 3, 4);
  16145. * // => [4, 1]
  16146. */
  16147. var over = createOver(arrayMap);
  16148. /**
  16149. * Creates a function that checks if **all** of the `predicates` return
  16150. * truthy when invoked with the arguments it receives.
  16151. *
  16152. * Following shorthands are possible for providing predicates.
  16153. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16154. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16155. *
  16156. * @static
  16157. * @memberOf _
  16158. * @since 4.0.0
  16159. * @category Util
  16160. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16161. * The predicates to check.
  16162. * @returns {Function} Returns the new function.
  16163. * @example
  16164. *
  16165. * var func = _.overEvery([Boolean, isFinite]);
  16166. *
  16167. * func('1');
  16168. * // => true
  16169. *
  16170. * func(null);
  16171. * // => false
  16172. *
  16173. * func(NaN);
  16174. * // => false
  16175. */
  16176. var overEvery = createOver(arrayEvery);
  16177. /**
  16178. * Creates a function that checks if **any** of the `predicates` return
  16179. * truthy when invoked with the arguments it receives.
  16180. *
  16181. * Following shorthands are possible for providing predicates.
  16182. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16183. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16184. *
  16185. * @static
  16186. * @memberOf _
  16187. * @since 4.0.0
  16188. * @category Util
  16189. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16190. * The predicates to check.
  16191. * @returns {Function} Returns the new function.
  16192. * @example
  16193. *
  16194. * var func = _.overSome([Boolean, isFinite]);
  16195. *
  16196. * func('1');
  16197. * // => true
  16198. *
  16199. * func(null);
  16200. * // => true
  16201. *
  16202. * func(NaN);
  16203. * // => false
  16204. *
  16205. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16206. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16207. */
  16208. var overSome = createOver(arraySome);
  16209. /**
  16210. * Creates a function that returns the value at `path` of a given object.
  16211. *
  16212. * @static
  16213. * @memberOf _
  16214. * @since 2.4.0
  16215. * @category Util
  16216. * @param {Array|string} path The path of the property to get.
  16217. * @returns {Function} Returns the new accessor function.
  16218. * @example
  16219. *
  16220. * var objects = [
  16221. * { 'a': { 'b': 2 } },
  16222. * { 'a': { 'b': 1 } }
  16223. * ];
  16224. *
  16225. * _.map(objects, _.property('a.b'));
  16226. * // => [2, 1]
  16227. *
  16228. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16229. * // => [1, 2]
  16230. */
  16231. function property(path) {
  16232. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16233. }
  16234. /**
  16235. * The opposite of `_.property`; this method creates a function that returns
  16236. * the value at a given path of `object`.
  16237. *
  16238. * @static
  16239. * @memberOf _
  16240. * @since 3.0.0
  16241. * @category Util
  16242. * @param {Object} object The object to query.
  16243. * @returns {Function} Returns the new accessor function.
  16244. * @example
  16245. *
  16246. * var array = [0, 1, 2],
  16247. * object = { 'a': array, 'b': array, 'c': array };
  16248. *
  16249. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16250. * // => [2, 0]
  16251. *
  16252. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16253. * // => [2, 0]
  16254. */
  16255. function propertyOf(object) {
  16256. return function(path) {
  16257. return object == null ? undefined : baseGet(object, path);
  16258. };
  16259. }
  16260. /**
  16261. * Creates an array of numbers (positive and/or negative) progressing from
  16262. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16263. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16264. * it's set to `start` with `start` then set to `0`.
  16265. *
  16266. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16267. * floating-point values which can produce unexpected results.
  16268. *
  16269. * @static
  16270. * @since 0.1.0
  16271. * @memberOf _
  16272. * @category Util
  16273. * @param {number} [start=0] The start of the range.
  16274. * @param {number} end The end of the range.
  16275. * @param {number} [step=1] The value to increment or decrement by.
  16276. * @returns {Array} Returns the range of numbers.
  16277. * @see _.inRange, _.rangeRight
  16278. * @example
  16279. *
  16280. * _.range(4);
  16281. * // => [0, 1, 2, 3]
  16282. *
  16283. * _.range(-4);
  16284. * // => [0, -1, -2, -3]
  16285. *
  16286. * _.range(1, 5);
  16287. * // => [1, 2, 3, 4]
  16288. *
  16289. * _.range(0, 20, 5);
  16290. * // => [0, 5, 10, 15]
  16291. *
  16292. * _.range(0, -4, -1);
  16293. * // => [0, -1, -2, -3]
  16294. *
  16295. * _.range(1, 4, 0);
  16296. * // => [1, 1, 1]
  16297. *
  16298. * _.range(0);
  16299. * // => []
  16300. */
  16301. var range = createRange();
  16302. /**
  16303. * This method is like `_.range` except that it populates values in
  16304. * descending order.
  16305. *
  16306. * @static
  16307. * @memberOf _
  16308. * @since 4.0.0
  16309. * @category Util
  16310. * @param {number} [start=0] The start of the range.
  16311. * @param {number} end The end of the range.
  16312. * @param {number} [step=1] The value to increment or decrement by.
  16313. * @returns {Array} Returns the range of numbers.
  16314. * @see _.inRange, _.range
  16315. * @example
  16316. *
  16317. * _.rangeRight(4);
  16318. * // => [3, 2, 1, 0]
  16319. *
  16320. * _.rangeRight(-4);
  16321. * // => [-3, -2, -1, 0]
  16322. *
  16323. * _.rangeRight(1, 5);
  16324. * // => [4, 3, 2, 1]
  16325. *
  16326. * _.rangeRight(0, 20, 5);
  16327. * // => [15, 10, 5, 0]
  16328. *
  16329. * _.rangeRight(0, -4, -1);
  16330. * // => [-3, -2, -1, 0]
  16331. *
  16332. * _.rangeRight(1, 4, 0);
  16333. * // => [1, 1, 1]
  16334. *
  16335. * _.rangeRight(0);
  16336. * // => []
  16337. */
  16338. var rangeRight = createRange(true);
  16339. /**
  16340. * This method returns a new empty array.
  16341. *
  16342. * @static
  16343. * @memberOf _
  16344. * @since 4.13.0
  16345. * @category Util
  16346. * @returns {Array} Returns the new empty array.
  16347. * @example
  16348. *
  16349. * var arrays = _.times(2, _.stubArray);
  16350. *
  16351. * console.log(arrays);
  16352. * // => [[], []]
  16353. *
  16354. * console.log(arrays[0] === arrays[1]);
  16355. * // => false
  16356. */
  16357. function stubArray() {
  16358. return [];
  16359. }
  16360. /**
  16361. * This method returns `false`.
  16362. *
  16363. * @static
  16364. * @memberOf _
  16365. * @since 4.13.0
  16366. * @category Util
  16367. * @returns {boolean} Returns `false`.
  16368. * @example
  16369. *
  16370. * _.times(2, _.stubFalse);
  16371. * // => [false, false]
  16372. */
  16373. function stubFalse() {
  16374. return false;
  16375. }
  16376. /**
  16377. * This method returns a new empty object.
  16378. *
  16379. * @static
  16380. * @memberOf _
  16381. * @since 4.13.0
  16382. * @category Util
  16383. * @returns {Object} Returns the new empty object.
  16384. * @example
  16385. *
  16386. * var objects = _.times(2, _.stubObject);
  16387. *
  16388. * console.log(objects);
  16389. * // => [{}, {}]
  16390. *
  16391. * console.log(objects[0] === objects[1]);
  16392. * // => false
  16393. */
  16394. function stubObject() {
  16395. return {};
  16396. }
  16397. /**
  16398. * This method returns an empty string.
  16399. *
  16400. * @static
  16401. * @memberOf _
  16402. * @since 4.13.0
  16403. * @category Util
  16404. * @returns {string} Returns the empty string.
  16405. * @example
  16406. *
  16407. * _.times(2, _.stubString);
  16408. * // => ['', '']
  16409. */
  16410. function stubString() {
  16411. return '';
  16412. }
  16413. /**
  16414. * This method returns `true`.
  16415. *
  16416. * @static
  16417. * @memberOf _
  16418. * @since 4.13.0
  16419. * @category Util
  16420. * @returns {boolean} Returns `true`.
  16421. * @example
  16422. *
  16423. * _.times(2, _.stubTrue);
  16424. * // => [true, true]
  16425. */
  16426. function stubTrue() {
  16427. return true;
  16428. }
  16429. /**
  16430. * Invokes the iteratee `n` times, returning an array of the results of
  16431. * each invocation. The iteratee is invoked with one argument; (index).
  16432. *
  16433. * @static
  16434. * @since 0.1.0
  16435. * @memberOf _
  16436. * @category Util
  16437. * @param {number} n The number of times to invoke `iteratee`.
  16438. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16439. * @returns {Array} Returns the array of results.
  16440. * @example
  16441. *
  16442. * _.times(3, String);
  16443. * // => ['0', '1', '2']
  16444. *
  16445. * _.times(4, _.constant(0));
  16446. * // => [0, 0, 0, 0]
  16447. */
  16448. function times(n, iteratee) {
  16449. n = toInteger(n);
  16450. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16451. return [];
  16452. }
  16453. var index = MAX_ARRAY_LENGTH,
  16454. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16455. iteratee = getIteratee(iteratee);
  16456. n -= MAX_ARRAY_LENGTH;
  16457. var result = baseTimes(length, iteratee);
  16458. while (++index < n) {
  16459. iteratee(index);
  16460. }
  16461. return result;
  16462. }
  16463. /**
  16464. * Converts `value` to a property path array.
  16465. *
  16466. * @static
  16467. * @memberOf _
  16468. * @since 4.0.0
  16469. * @category Util
  16470. * @param {*} value The value to convert.
  16471. * @returns {Array} Returns the new property path array.
  16472. * @example
  16473. *
  16474. * _.toPath('a.b.c');
  16475. * // => ['a', 'b', 'c']
  16476. *
  16477. * _.toPath('a[0].b.c');
  16478. * // => ['a', '0', 'b', 'c']
  16479. */
  16480. function toPath(value) {
  16481. if (isArray(value)) {
  16482. return arrayMap(value, toKey);
  16483. }
  16484. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16485. }
  16486. /**
  16487. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16488. *
  16489. * @static
  16490. * @since 0.1.0
  16491. * @memberOf _
  16492. * @category Util
  16493. * @param {string} [prefix=''] The value to prefix the ID with.
  16494. * @returns {string} Returns the unique ID.
  16495. * @example
  16496. *
  16497. * _.uniqueId('contact_');
  16498. * // => 'contact_104'
  16499. *
  16500. * _.uniqueId();
  16501. * // => '105'
  16502. */
  16503. function uniqueId(prefix) {
  16504. var id = ++idCounter;
  16505. return toString(prefix) + id;
  16506. }
  16507. /*------------------------------------------------------------------------*/
  16508. /**
  16509. * Adds two numbers.
  16510. *
  16511. * @static
  16512. * @memberOf _
  16513. * @since 3.4.0
  16514. * @category Math
  16515. * @param {number} augend The first number in an addition.
  16516. * @param {number} addend The second number in an addition.
  16517. * @returns {number} Returns the total.
  16518. * @example
  16519. *
  16520. * _.add(6, 4);
  16521. * // => 10
  16522. */
  16523. var add = createMathOperation(function(augend, addend) {
  16524. return augend + addend;
  16525. }, 0);
  16526. /**
  16527. * Computes `number` rounded up to `precision`.
  16528. *
  16529. * @static
  16530. * @memberOf _
  16531. * @since 3.10.0
  16532. * @category Math
  16533. * @param {number} number The number to round up.
  16534. * @param {number} [precision=0] The precision to round up to.
  16535. * @returns {number} Returns the rounded up number.
  16536. * @example
  16537. *
  16538. * _.ceil(4.006);
  16539. * // => 5
  16540. *
  16541. * _.ceil(6.004, 2);
  16542. * // => 6.01
  16543. *
  16544. * _.ceil(6040, -2);
  16545. * // => 6100
  16546. */
  16547. var ceil = createRound('ceil');
  16548. /**
  16549. * Divide two numbers.
  16550. *
  16551. * @static
  16552. * @memberOf _
  16553. * @since 4.7.0
  16554. * @category Math
  16555. * @param {number} dividend The first number in a division.
  16556. * @param {number} divisor The second number in a division.
  16557. * @returns {number} Returns the quotient.
  16558. * @example
  16559. *
  16560. * _.divide(6, 4);
  16561. * // => 1.5
  16562. */
  16563. var divide = createMathOperation(function(dividend, divisor) {
  16564. return dividend / divisor;
  16565. }, 1);
  16566. /**
  16567. * Computes `number` rounded down to `precision`.
  16568. *
  16569. * @static
  16570. * @memberOf _
  16571. * @since 3.10.0
  16572. * @category Math
  16573. * @param {number} number The number to round down.
  16574. * @param {number} [precision=0] The precision to round down to.
  16575. * @returns {number} Returns the rounded down number.
  16576. * @example
  16577. *
  16578. * _.floor(4.006);
  16579. * // => 4
  16580. *
  16581. * _.floor(0.046, 2);
  16582. * // => 0.04
  16583. *
  16584. * _.floor(4060, -2);
  16585. * // => 4000
  16586. */
  16587. var floor = createRound('floor');
  16588. /**
  16589. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16590. * `undefined` is returned.
  16591. *
  16592. * @static
  16593. * @since 0.1.0
  16594. * @memberOf _
  16595. * @category Math
  16596. * @param {Array} array The array to iterate over.
  16597. * @returns {*} Returns the maximum value.
  16598. * @example
  16599. *
  16600. * _.max([4, 2, 8, 6]);
  16601. * // => 8
  16602. *
  16603. * _.max([]);
  16604. * // => undefined
  16605. */
  16606. function max(array) {
  16607. return (array && array.length)
  16608. ? baseExtremum(array, identity, baseGt)
  16609. : undefined;
  16610. }
  16611. /**
  16612. * This method is like `_.max` except that it accepts `iteratee` which is
  16613. * invoked for each element in `array` to generate the criterion by which
  16614. * the value is ranked. The iteratee is invoked with one argument: (value).
  16615. *
  16616. * @static
  16617. * @memberOf _
  16618. * @since 4.0.0
  16619. * @category Math
  16620. * @param {Array} array The array to iterate over.
  16621. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16622. * @returns {*} Returns the maximum value.
  16623. * @example
  16624. *
  16625. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16626. *
  16627. * _.maxBy(objects, function(o) { return o.n; });
  16628. * // => { 'n': 2 }
  16629. *
  16630. * // The `_.property` iteratee shorthand.
  16631. * _.maxBy(objects, 'n');
  16632. * // => { 'n': 2 }
  16633. */
  16634. function maxBy(array, iteratee) {
  16635. return (array && array.length)
  16636. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16637. : undefined;
  16638. }
  16639. /**
  16640. * Computes the mean of the values in `array`.
  16641. *
  16642. * @static
  16643. * @memberOf _
  16644. * @since 4.0.0
  16645. * @category Math
  16646. * @param {Array} array The array to iterate over.
  16647. * @returns {number} Returns the mean.
  16648. * @example
  16649. *
  16650. * _.mean([4, 2, 8, 6]);
  16651. * // => 5
  16652. */
  16653. function mean(array) {
  16654. return baseMean(array, identity);
  16655. }
  16656. /**
  16657. * This method is like `_.mean` except that it accepts `iteratee` which is
  16658. * invoked for each element in `array` to generate the value to be averaged.
  16659. * The iteratee is invoked with one argument: (value).
  16660. *
  16661. * @static
  16662. * @memberOf _
  16663. * @since 4.7.0
  16664. * @category Math
  16665. * @param {Array} array The array to iterate over.
  16666. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16667. * @returns {number} Returns the mean.
  16668. * @example
  16669. *
  16670. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16671. *
  16672. * _.meanBy(objects, function(o) { return o.n; });
  16673. * // => 5
  16674. *
  16675. * // The `_.property` iteratee shorthand.
  16676. * _.meanBy(objects, 'n');
  16677. * // => 5
  16678. */
  16679. function meanBy(array, iteratee) {
  16680. return baseMean(array, getIteratee(iteratee, 2));
  16681. }
  16682. /**
  16683. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16684. * `undefined` is returned.
  16685. *
  16686. * @static
  16687. * @since 0.1.0
  16688. * @memberOf _
  16689. * @category Math
  16690. * @param {Array} array The array to iterate over.
  16691. * @returns {*} Returns the minimum value.
  16692. * @example
  16693. *
  16694. * _.min([4, 2, 8, 6]);
  16695. * // => 2
  16696. *
  16697. * _.min([]);
  16698. * // => undefined
  16699. */
  16700. function min(array) {
  16701. return (array && array.length)
  16702. ? baseExtremum(array, identity, baseLt)
  16703. : undefined;
  16704. }
  16705. /**
  16706. * This method is like `_.min` except that it accepts `iteratee` which is
  16707. * invoked for each element in `array` to generate the criterion by which
  16708. * the value is ranked. The iteratee is invoked with one argument: (value).
  16709. *
  16710. * @static
  16711. * @memberOf _
  16712. * @since 4.0.0
  16713. * @category Math
  16714. * @param {Array} array The array to iterate over.
  16715. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16716. * @returns {*} Returns the minimum value.
  16717. * @example
  16718. *
  16719. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16720. *
  16721. * _.minBy(objects, function(o) { return o.n; });
  16722. * // => { 'n': 1 }
  16723. *
  16724. * // The `_.property` iteratee shorthand.
  16725. * _.minBy(objects, 'n');
  16726. * // => { 'n': 1 }
  16727. */
  16728. function minBy(array, iteratee) {
  16729. return (array && array.length)
  16730. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16731. : undefined;
  16732. }
  16733. /**
  16734. * Multiply two numbers.
  16735. *
  16736. * @static
  16737. * @memberOf _
  16738. * @since 4.7.0
  16739. * @category Math
  16740. * @param {number} multiplier The first number in a multiplication.
  16741. * @param {number} multiplicand The second number in a multiplication.
  16742. * @returns {number} Returns the product.
  16743. * @example
  16744. *
  16745. * _.multiply(6, 4);
  16746. * // => 24
  16747. */
  16748. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16749. return multiplier * multiplicand;
  16750. }, 1);
  16751. /**
  16752. * Computes `number` rounded to `precision`.
  16753. *
  16754. * @static
  16755. * @memberOf _
  16756. * @since 3.10.0
  16757. * @category Math
  16758. * @param {number} number The number to round.
  16759. * @param {number} [precision=0] The precision to round to.
  16760. * @returns {number} Returns the rounded number.
  16761. * @example
  16762. *
  16763. * _.round(4.006);
  16764. * // => 4
  16765. *
  16766. * _.round(4.006, 2);
  16767. * // => 4.01
  16768. *
  16769. * _.round(4060, -2);
  16770. * // => 4100
  16771. */
  16772. var round = createRound('round');
  16773. /**
  16774. * Subtract two numbers.
  16775. *
  16776. * @static
  16777. * @memberOf _
  16778. * @since 4.0.0
  16779. * @category Math
  16780. * @param {number} minuend The first number in a subtraction.
  16781. * @param {number} subtrahend The second number in a subtraction.
  16782. * @returns {number} Returns the difference.
  16783. * @example
  16784. *
  16785. * _.subtract(6, 4);
  16786. * // => 2
  16787. */
  16788. var subtract = createMathOperation(function(minuend, subtrahend) {
  16789. return minuend - subtrahend;
  16790. }, 0);
  16791. /**
  16792. * Computes the sum of the values in `array`.
  16793. *
  16794. * @static
  16795. * @memberOf _
  16796. * @since 3.4.0
  16797. * @category Math
  16798. * @param {Array} array The array to iterate over.
  16799. * @returns {number} Returns the sum.
  16800. * @example
  16801. *
  16802. * _.sum([4, 2, 8, 6]);
  16803. * // => 20
  16804. */
  16805. function sum(array) {
  16806. return (array && array.length)
  16807. ? baseSum(array, identity)
  16808. : 0;
  16809. }
  16810. /**
  16811. * This method is like `_.sum` except that it accepts `iteratee` which is
  16812. * invoked for each element in `array` to generate the value to be summed.
  16813. * The iteratee is invoked with one argument: (value).
  16814. *
  16815. * @static
  16816. * @memberOf _
  16817. * @since 4.0.0
  16818. * @category Math
  16819. * @param {Array} array The array to iterate over.
  16820. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16821. * @returns {number} Returns the sum.
  16822. * @example
  16823. *
  16824. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16825. *
  16826. * _.sumBy(objects, function(o) { return o.n; });
  16827. * // => 20
  16828. *
  16829. * // The `_.property` iteratee shorthand.
  16830. * _.sumBy(objects, 'n');
  16831. * // => 20
  16832. */
  16833. function sumBy(array, iteratee) {
  16834. return (array && array.length)
  16835. ? baseSum(array, getIteratee(iteratee, 2))
  16836. : 0;
  16837. }
  16838. /*------------------------------------------------------------------------*/
  16839. // Add methods that return wrapped values in chain sequences.
  16840. lodash.after = after;
  16841. lodash.ary = ary;
  16842. lodash.assign = assign;
  16843. lodash.assignIn = assignIn;
  16844. lodash.assignInWith = assignInWith;
  16845. lodash.assignWith = assignWith;
  16846. lodash.at = at;
  16847. lodash.before = before;
  16848. lodash.bind = bind;
  16849. lodash.bindAll = bindAll;
  16850. lodash.bindKey = bindKey;
  16851. lodash.castArray = castArray;
  16852. lodash.chain = chain;
  16853. lodash.chunk = chunk;
  16854. lodash.compact = compact;
  16855. lodash.concat = concat;
  16856. lodash.cond = cond;
  16857. lodash.conforms = conforms;
  16858. lodash.constant = constant;
  16859. lodash.countBy = countBy;
  16860. lodash.create = create;
  16861. lodash.curry = curry;
  16862. lodash.curryRight = curryRight;
  16863. lodash.debounce = debounce;
  16864. lodash.defaults = defaults;
  16865. lodash.defaultsDeep = defaultsDeep;
  16866. lodash.defer = defer;
  16867. lodash.delay = delay;
  16868. lodash.difference = difference;
  16869. lodash.differenceBy = differenceBy;
  16870. lodash.differenceWith = differenceWith;
  16871. lodash.drop = drop;
  16872. lodash.dropRight = dropRight;
  16873. lodash.dropRightWhile = dropRightWhile;
  16874. lodash.dropWhile = dropWhile;
  16875. lodash.fill = fill;
  16876. lodash.filter = filter;
  16877. lodash.flatMap = flatMap;
  16878. lodash.flatMapDeep = flatMapDeep;
  16879. lodash.flatMapDepth = flatMapDepth;
  16880. lodash.flatten = flatten;
  16881. lodash.flattenDeep = flattenDeep;
  16882. lodash.flattenDepth = flattenDepth;
  16883. lodash.flip = flip;
  16884. lodash.flow = flow;
  16885. lodash.flowRight = flowRight;
  16886. lodash.fromPairs = fromPairs;
  16887. lodash.functions = functions;
  16888. lodash.functionsIn = functionsIn;
  16889. lodash.groupBy = groupBy;
  16890. lodash.initial = initial;
  16891. lodash.intersection = intersection;
  16892. lodash.intersectionBy = intersectionBy;
  16893. lodash.intersectionWith = intersectionWith;
  16894. lodash.invert = invert;
  16895. lodash.invertBy = invertBy;
  16896. lodash.invokeMap = invokeMap;
  16897. lodash.iteratee = iteratee;
  16898. lodash.keyBy = keyBy;
  16899. lodash.keys = keys;
  16900. lodash.keysIn = keysIn;
  16901. lodash.map = map;
  16902. lodash.mapKeys = mapKeys;
  16903. lodash.mapValues = mapValues;
  16904. lodash.matches = matches;
  16905. lodash.matchesProperty = matchesProperty;
  16906. lodash.memoize = memoize;
  16907. lodash.merge = merge;
  16908. lodash.mergeWith = mergeWith;
  16909. lodash.method = method;
  16910. lodash.methodOf = methodOf;
  16911. lodash.mixin = mixin;
  16912. lodash.negate = negate;
  16913. lodash.nthArg = nthArg;
  16914. lodash.omit = omit;
  16915. lodash.omitBy = omitBy;
  16916. lodash.once = once;
  16917. lodash.orderBy = orderBy;
  16918. lodash.over = over;
  16919. lodash.overArgs = overArgs;
  16920. lodash.overEvery = overEvery;
  16921. lodash.overSome = overSome;
  16922. lodash.partial = partial;
  16923. lodash.partialRight = partialRight;
  16924. lodash.partition = partition;
  16925. lodash.pick = pick;
  16926. lodash.pickBy = pickBy;
  16927. lodash.property = property;
  16928. lodash.propertyOf = propertyOf;
  16929. lodash.pull = pull;
  16930. lodash.pullAll = pullAll;
  16931. lodash.pullAllBy = pullAllBy;
  16932. lodash.pullAllWith = pullAllWith;
  16933. lodash.pullAt = pullAt;
  16934. lodash.range = range;
  16935. lodash.rangeRight = rangeRight;
  16936. lodash.rearg = rearg;
  16937. lodash.reject = reject;
  16938. lodash.remove = remove;
  16939. lodash.rest = rest;
  16940. lodash.reverse = reverse;
  16941. lodash.sampleSize = sampleSize;
  16942. lodash.set = set;
  16943. lodash.setWith = setWith;
  16944. lodash.shuffle = shuffle;
  16945. lodash.slice = slice;
  16946. lodash.sortBy = sortBy;
  16947. lodash.sortedUniq = sortedUniq;
  16948. lodash.sortedUniqBy = sortedUniqBy;
  16949. lodash.split = split;
  16950. lodash.spread = spread;
  16951. lodash.tail = tail;
  16952. lodash.take = take;
  16953. lodash.takeRight = takeRight;
  16954. lodash.takeRightWhile = takeRightWhile;
  16955. lodash.takeWhile = takeWhile;
  16956. lodash.tap = tap;
  16957. lodash.throttle = throttle;
  16958. lodash.thru = thru;
  16959. lodash.toArray = toArray;
  16960. lodash.toPairs = toPairs;
  16961. lodash.toPairsIn = toPairsIn;
  16962. lodash.toPath = toPath;
  16963. lodash.toPlainObject = toPlainObject;
  16964. lodash.transform = transform;
  16965. lodash.unary = unary;
  16966. lodash.union = union;
  16967. lodash.unionBy = unionBy;
  16968. lodash.unionWith = unionWith;
  16969. lodash.uniq = uniq;
  16970. lodash.uniqBy = uniqBy;
  16971. lodash.uniqWith = uniqWith;
  16972. lodash.unset = unset;
  16973. lodash.unzip = unzip;
  16974. lodash.unzipWith = unzipWith;
  16975. lodash.update = update;
  16976. lodash.updateWith = updateWith;
  16977. lodash.values = values;
  16978. lodash.valuesIn = valuesIn;
  16979. lodash.without = without;
  16980. lodash.words = words;
  16981. lodash.wrap = wrap;
  16982. lodash.xor = xor;
  16983. lodash.xorBy = xorBy;
  16984. lodash.xorWith = xorWith;
  16985. lodash.zip = zip;
  16986. lodash.zipObject = zipObject;
  16987. lodash.zipObjectDeep = zipObjectDeep;
  16988. lodash.zipWith = zipWith;
  16989. // Add aliases.
  16990. lodash.entries = toPairs;
  16991. lodash.entriesIn = toPairsIn;
  16992. lodash.extend = assignIn;
  16993. lodash.extendWith = assignInWith;
  16994. // Add methods to `lodash.prototype`.
  16995. mixin(lodash, lodash);
  16996. /*------------------------------------------------------------------------*/
  16997. // Add methods that return unwrapped values in chain sequences.
  16998. lodash.add = add;
  16999. lodash.attempt = attempt;
  17000. lodash.camelCase = camelCase;
  17001. lodash.capitalize = capitalize;
  17002. lodash.ceil = ceil;
  17003. lodash.clamp = clamp;
  17004. lodash.clone = clone;
  17005. lodash.cloneDeep = cloneDeep;
  17006. lodash.cloneDeepWith = cloneDeepWith;
  17007. lodash.cloneWith = cloneWith;
  17008. lodash.conformsTo = conformsTo;
  17009. lodash.deburr = deburr;
  17010. lodash.defaultTo = defaultTo;
  17011. lodash.divide = divide;
  17012. lodash.endsWith = endsWith;
  17013. lodash.eq = eq;
  17014. lodash.escape = escape;
  17015. lodash.escapeRegExp = escapeRegExp;
  17016. lodash.every = every;
  17017. lodash.find = find;
  17018. lodash.findIndex = findIndex;
  17019. lodash.findKey = findKey;
  17020. lodash.findLast = findLast;
  17021. lodash.findLastIndex = findLastIndex;
  17022. lodash.findLastKey = findLastKey;
  17023. lodash.floor = floor;
  17024. lodash.forEach = forEach;
  17025. lodash.forEachRight = forEachRight;
  17026. lodash.forIn = forIn;
  17027. lodash.forInRight = forInRight;
  17028. lodash.forOwn = forOwn;
  17029. lodash.forOwnRight = forOwnRight;
  17030. lodash.get = get;
  17031. lodash.gt = gt;
  17032. lodash.gte = gte;
  17033. lodash.has = has;
  17034. lodash.hasIn = hasIn;
  17035. lodash.head = head;
  17036. lodash.identity = identity;
  17037. lodash.includes = includes;
  17038. lodash.indexOf = indexOf;
  17039. lodash.inRange = inRange;
  17040. lodash.invoke = invoke;
  17041. lodash.isArguments = isArguments;
  17042. lodash.isArray = isArray;
  17043. lodash.isArrayBuffer = isArrayBuffer;
  17044. lodash.isArrayLike = isArrayLike;
  17045. lodash.isArrayLikeObject = isArrayLikeObject;
  17046. lodash.isBoolean = isBoolean;
  17047. lodash.isBuffer = isBuffer;
  17048. lodash.isDate = isDate;
  17049. lodash.isElement = isElement;
  17050. lodash.isEmpty = isEmpty;
  17051. lodash.isEqual = isEqual;
  17052. lodash.isEqualWith = isEqualWith;
  17053. lodash.isError = isError;
  17054. lodash.isFinite = isFinite;
  17055. lodash.isFunction = isFunction;
  17056. lodash.isInteger = isInteger;
  17057. lodash.isLength = isLength;
  17058. lodash.isMap = isMap;
  17059. lodash.isMatch = isMatch;
  17060. lodash.isMatchWith = isMatchWith;
  17061. lodash.isNaN = isNaN;
  17062. lodash.isNative = isNative;
  17063. lodash.isNil = isNil;
  17064. lodash.isNull = isNull;
  17065. lodash.isNumber = isNumber;
  17066. lodash.isObject = isObject;
  17067. lodash.isObjectLike = isObjectLike;
  17068. lodash.isPlainObject = isPlainObject;
  17069. lodash.isRegExp = isRegExp;
  17070. lodash.isSafeInteger = isSafeInteger;
  17071. lodash.isSet = isSet;
  17072. lodash.isString = isString;
  17073. lodash.isSymbol = isSymbol;
  17074. lodash.isTypedArray = isTypedArray;
  17075. lodash.isUndefined = isUndefined;
  17076. lodash.isWeakMap = isWeakMap;
  17077. lodash.isWeakSet = isWeakSet;
  17078. lodash.join = join;
  17079. lodash.kebabCase = kebabCase;
  17080. lodash.last = last;
  17081. lodash.lastIndexOf = lastIndexOf;
  17082. lodash.lowerCase = lowerCase;
  17083. lodash.lowerFirst = lowerFirst;
  17084. lodash.lt = lt;
  17085. lodash.lte = lte;
  17086. lodash.max = max;
  17087. lodash.maxBy = maxBy;
  17088. lodash.mean = mean;
  17089. lodash.meanBy = meanBy;
  17090. lodash.min = min;
  17091. lodash.minBy = minBy;
  17092. lodash.stubArray = stubArray;
  17093. lodash.stubFalse = stubFalse;
  17094. lodash.stubObject = stubObject;
  17095. lodash.stubString = stubString;
  17096. lodash.stubTrue = stubTrue;
  17097. lodash.multiply = multiply;
  17098. lodash.nth = nth;
  17099. lodash.noConflict = noConflict;
  17100. lodash.noop = noop;
  17101. lodash.now = now;
  17102. lodash.pad = pad;
  17103. lodash.padEnd = padEnd;
  17104. lodash.padStart = padStart;
  17105. lodash.parseInt = parseInt;
  17106. lodash.random = random;
  17107. lodash.reduce = reduce;
  17108. lodash.reduceRight = reduceRight;
  17109. lodash.repeat = repeat;
  17110. lodash.replace = replace;
  17111. lodash.result = result;
  17112. lodash.round = round;
  17113. lodash.runInContext = runInContext;
  17114. lodash.sample = sample;
  17115. lodash.size = size;
  17116. lodash.snakeCase = snakeCase;
  17117. lodash.some = some;
  17118. lodash.sortedIndex = sortedIndex;
  17119. lodash.sortedIndexBy = sortedIndexBy;
  17120. lodash.sortedIndexOf = sortedIndexOf;
  17121. lodash.sortedLastIndex = sortedLastIndex;
  17122. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17123. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17124. lodash.startCase = startCase;
  17125. lodash.startsWith = startsWith;
  17126. lodash.subtract = subtract;
  17127. lodash.sum = sum;
  17128. lodash.sumBy = sumBy;
  17129. lodash.template = template;
  17130. lodash.times = times;
  17131. lodash.toFinite = toFinite;
  17132. lodash.toInteger = toInteger;
  17133. lodash.toLength = toLength;
  17134. lodash.toLower = toLower;
  17135. lodash.toNumber = toNumber;
  17136. lodash.toSafeInteger = toSafeInteger;
  17137. lodash.toString = toString;
  17138. lodash.toUpper = toUpper;
  17139. lodash.trim = trim;
  17140. lodash.trimEnd = trimEnd;
  17141. lodash.trimStart = trimStart;
  17142. lodash.truncate = truncate;
  17143. lodash.unescape = unescape;
  17144. lodash.uniqueId = uniqueId;
  17145. lodash.upperCase = upperCase;
  17146. lodash.upperFirst = upperFirst;
  17147. // Add aliases.
  17148. lodash.each = forEach;
  17149. lodash.eachRight = forEachRight;
  17150. lodash.first = head;
  17151. mixin(lodash, (function() {
  17152. var source = {};
  17153. baseForOwn(lodash, function(func, methodName) {
  17154. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17155. source[methodName] = func;
  17156. }
  17157. });
  17158. return source;
  17159. }()), { 'chain': false });
  17160. /*------------------------------------------------------------------------*/
  17161. /**
  17162. * The semantic version number.
  17163. *
  17164. * @static
  17165. * @memberOf _
  17166. * @type {string}
  17167. */
  17168. lodash.VERSION = VERSION;
  17169. // Assign default placeholders.
  17170. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17171. lodash[methodName].placeholder = lodash;
  17172. });
  17173. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17174. arrayEach(['drop', 'take'], function(methodName, index) {
  17175. LazyWrapper.prototype[methodName] = function(n) {
  17176. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17177. var result = (this.__filtered__ && !index)
  17178. ? new LazyWrapper(this)
  17179. : this.clone();
  17180. if (result.__filtered__) {
  17181. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17182. } else {
  17183. result.__views__.push({
  17184. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17185. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17186. });
  17187. }
  17188. return result;
  17189. };
  17190. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17191. return this.reverse()[methodName](n).reverse();
  17192. };
  17193. });
  17194. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17195. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17196. var type = index + 1,
  17197. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17198. LazyWrapper.prototype[methodName] = function(iteratee) {
  17199. var result = this.clone();
  17200. result.__iteratees__.push({
  17201. 'iteratee': getIteratee(iteratee, 3),
  17202. 'type': type
  17203. });
  17204. result.__filtered__ = result.__filtered__ || isFilter;
  17205. return result;
  17206. };
  17207. });
  17208. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17209. arrayEach(['head', 'last'], function(methodName, index) {
  17210. var takeName = 'take' + (index ? 'Right' : '');
  17211. LazyWrapper.prototype[methodName] = function() {
  17212. return this[takeName](1).value()[0];
  17213. };
  17214. });
  17215. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17216. arrayEach(['initial', 'tail'], function(methodName, index) {
  17217. var dropName = 'drop' + (index ? '' : 'Right');
  17218. LazyWrapper.prototype[methodName] = function() {
  17219. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17220. };
  17221. });
  17222. LazyWrapper.prototype.compact = function() {
  17223. return this.filter(identity);
  17224. };
  17225. LazyWrapper.prototype.find = function(predicate) {
  17226. return this.filter(predicate).head();
  17227. };
  17228. LazyWrapper.prototype.findLast = function(predicate) {
  17229. return this.reverse().find(predicate);
  17230. };
  17231. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17232. if (typeof path == 'function') {
  17233. return new LazyWrapper(this);
  17234. }
  17235. return this.map(function(value) {
  17236. return baseInvoke(value, path, args);
  17237. });
  17238. });
  17239. LazyWrapper.prototype.reject = function(predicate) {
  17240. return this.filter(negate(getIteratee(predicate)));
  17241. };
  17242. LazyWrapper.prototype.slice = function(start, end) {
  17243. start = toInteger(start);
  17244. var result = this;
  17245. if (result.__filtered__ && (start > 0 || end < 0)) {
  17246. return new LazyWrapper(result);
  17247. }
  17248. if (start < 0) {
  17249. result = result.takeRight(-start);
  17250. } else if (start) {
  17251. result = result.drop(start);
  17252. }
  17253. if (end !== undefined) {
  17254. end = toInteger(end);
  17255. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17256. }
  17257. return result;
  17258. };
  17259. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17260. return this.reverse().takeWhile(predicate).reverse();
  17261. };
  17262. LazyWrapper.prototype.toArray = function() {
  17263. return this.take(MAX_ARRAY_LENGTH);
  17264. };
  17265. // Add `LazyWrapper` methods to `lodash.prototype`.
  17266. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17267. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17268. isTaker = /^(?:head|last)$/.test(methodName),
  17269. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17270. retUnwrapped = isTaker || /^find/.test(methodName);
  17271. if (!lodashFunc) {
  17272. return;
  17273. }
  17274. lodash.prototype[methodName] = function() {
  17275. var value = this.__wrapped__,
  17276. args = isTaker ? [1] : arguments,
  17277. isLazy = value instanceof LazyWrapper,
  17278. iteratee = args[0],
  17279. useLazy = isLazy || isArray(value);
  17280. var interceptor = function(value) {
  17281. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17282. return (isTaker && chainAll) ? result[0] : result;
  17283. };
  17284. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17285. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17286. isLazy = useLazy = false;
  17287. }
  17288. var chainAll = this.__chain__,
  17289. isHybrid = !!this.__actions__.length,
  17290. isUnwrapped = retUnwrapped && !chainAll,
  17291. onlyLazy = isLazy && !isHybrid;
  17292. if (!retUnwrapped && useLazy) {
  17293. value = onlyLazy ? value : new LazyWrapper(this);
  17294. var result = func.apply(value, args);
  17295. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17296. return new LodashWrapper(result, chainAll);
  17297. }
  17298. if (isUnwrapped && onlyLazy) {
  17299. return func.apply(this, args);
  17300. }
  17301. result = this.thru(interceptor);
  17302. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17303. };
  17304. });
  17305. // Add `Array` methods to `lodash.prototype`.
  17306. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17307. var func = arrayProto[methodName],
  17308. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17309. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17310. lodash.prototype[methodName] = function() {
  17311. var args = arguments;
  17312. if (retUnwrapped && !this.__chain__) {
  17313. var value = this.value();
  17314. return func.apply(isArray(value) ? value : [], args);
  17315. }
  17316. return this[chainName](function(value) {
  17317. return func.apply(isArray(value) ? value : [], args);
  17318. });
  17319. };
  17320. });
  17321. // Map minified method names to their real names.
  17322. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17323. var lodashFunc = lodash[methodName];
  17324. if (lodashFunc) {
  17325. var key = lodashFunc.name + '';
  17326. if (!hasOwnProperty.call(realNames, key)) {
  17327. realNames[key] = [];
  17328. }
  17329. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17330. }
  17331. });
  17332. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17333. 'name': 'wrapper',
  17334. 'func': undefined
  17335. }];
  17336. // Add methods to `LazyWrapper`.
  17337. LazyWrapper.prototype.clone = lazyClone;
  17338. LazyWrapper.prototype.reverse = lazyReverse;
  17339. LazyWrapper.prototype.value = lazyValue;
  17340. // Add chain sequence methods to the `lodash` wrapper.
  17341. lodash.prototype.at = wrapperAt;
  17342. lodash.prototype.chain = wrapperChain;
  17343. lodash.prototype.commit = wrapperCommit;
  17344. lodash.prototype.next = wrapperNext;
  17345. lodash.prototype.plant = wrapperPlant;
  17346. lodash.prototype.reverse = wrapperReverse;
  17347. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17348. // Add lazy aliases.
  17349. lodash.prototype.first = lodash.prototype.head;
  17350. if (symIterator) {
  17351. lodash.prototype[symIterator] = wrapperToIterator;
  17352. }
  17353. return lodash;
  17354. });
  17355. /*--------------------------------------------------------------------------*/
  17356. // Export lodash.
  17357. var _ = runInContext();
  17358. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17359. if (true) {
  17360. // Expose Lodash on the global object to prevent errors when Lodash is
  17361. // loaded by a script tag in the presence of an AMD loader.
  17362. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17363. // Use `_.noConflict` to remove Lodash from the global object.
  17364. root._ = _;
  17365. // Define as an anonymous module so, through path mapping, it can be
  17366. // referenced as the "underscore" module.
  17367. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17368. return _;
  17369. }).call(exports, __webpack_require__, exports, module),
  17370. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17371. }
  17372. // Check for `exports` after `define` in case a build optimizer adds it.
  17373. else {}
  17374. }.call(this));
  17375. /***/ }),
  17376. /***/ "./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":
  17377. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17378. !*** ./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 ***!
  17379. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17380. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17381. "use strict";
  17382. __webpack_require__.r(__webpack_exports__);
  17383. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17384. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17385. /* harmony export */ });
  17386. /* 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");
  17387. /* 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__);
  17388. /* 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");
  17389. var options = {};
  17390. options.insert = "head";
  17391. options.singleton = false;
  17392. 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);
  17393. /* 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 || {});
  17394. /***/ }),
  17395. /***/ "./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":
  17396. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17397. !*** ./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 ***!
  17398. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17399. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17400. "use strict";
  17401. __webpack_require__.r(__webpack_exports__);
  17402. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17403. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17404. /* harmony export */ });
  17405. /* 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");
  17406. /* 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__);
  17407. /* 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");
  17408. var options = {};
  17409. options.insert = "head";
  17410. options.singleton = false;
  17411. 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);
  17412. /* 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 || {});
  17413. /***/ }),
  17414. /***/ "./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":
  17415. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17416. !*** ./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 ***!
  17417. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17418. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17419. "use strict";
  17420. __webpack_require__.r(__webpack_exports__);
  17421. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17422. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17423. /* harmony export */ });
  17424. /* 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");
  17425. /* 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__);
  17426. /* 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");
  17427. var options = {};
  17428. options.insert = "head";
  17429. options.singleton = false;
  17430. 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);
  17431. /* 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 || {});
  17432. /***/ }),
  17433. /***/ "./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":
  17434. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17435. !*** ./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 ***!
  17436. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17437. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17438. "use strict";
  17439. __webpack_require__.r(__webpack_exports__);
  17440. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17441. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17442. /* harmony export */ });
  17443. /* 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");
  17444. /* 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__);
  17445. /* 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");
  17446. var options = {};
  17447. options.insert = "head";
  17448. options.singleton = false;
  17449. 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);
  17450. /* 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 || {});
  17451. /***/ }),
  17452. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17453. /*!******************************************************!*\
  17454. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17455. \******************************************************/
  17456. /***/ ((__unused_webpack_module, exports) => {
  17457. "use strict";
  17458. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17459. // runtime helper for setting properties on components
  17460. // in a tree-shakable way
  17461. exports["default"] = (sfc, props) => {
  17462. const target = sfc.__vccOpts || sfc;
  17463. for (const [key, val] of props) {
  17464. target[key] = val;
  17465. }
  17466. return target;
  17467. };
  17468. /***/ }),
  17469. /***/ "./resources/js/components/AppButtonLink.vue":
  17470. /*!***************************************************!*\
  17471. !*** ./resources/js/components/AppButtonLink.vue ***!
  17472. \***************************************************/
  17473. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17474. "use strict";
  17475. __webpack_require__.r(__webpack_exports__);
  17476. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17477. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17478. /* harmony export */ });
  17479. /* harmony import */ var _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");
  17480. /* 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");
  17481. /* 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");
  17482. ;
  17483. 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"]])
  17484. /* hot reload */
  17485. if (false) {}
  17486. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17487. /***/ }),
  17488. /***/ "./resources/js/components/AppMessage.vue":
  17489. /*!************************************************!*\
  17490. !*** ./resources/js/components/AppMessage.vue ***!
  17491. \************************************************/
  17492. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17493. "use strict";
  17494. __webpack_require__.r(__webpack_exports__);
  17495. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17496. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17497. /* harmony export */ });
  17498. /* harmony import */ var _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");
  17499. /* 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");
  17500. /* 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");
  17501. ;
  17502. 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"]])
  17503. /* hot reload */
  17504. if (false) {}
  17505. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17506. /***/ }),
  17507. /***/ "./resources/js/components/AppPagination.vue":
  17508. /*!***************************************************!*\
  17509. !*** ./resources/js/components/AppPagination.vue ***!
  17510. \***************************************************/
  17511. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17512. "use strict";
  17513. __webpack_require__.r(__webpack_exports__);
  17514. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17515. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17516. /* harmony export */ });
  17517. /* harmony import */ var _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");
  17518. /* 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");
  17519. /* 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");
  17520. ;
  17521. 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"]])
  17522. /* hot reload */
  17523. if (false) {}
  17524. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17525. /***/ }),
  17526. /***/ "./resources/js/components/AppSearch.vue":
  17527. /*!***********************************************!*\
  17528. !*** ./resources/js/components/AppSearch.vue ***!
  17529. \***********************************************/
  17530. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17531. "use strict";
  17532. __webpack_require__.r(__webpack_exports__);
  17533. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17534. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17535. /* harmony export */ });
  17536. /* harmony import */ var _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");
  17537. /* 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");
  17538. /* 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");
  17539. ;
  17540. 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"]])
  17541. /* hot reload */
  17542. if (false) {}
  17543. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17544. /***/ }),
  17545. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17546. /*!**************************************************************!*\
  17547. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17548. \**************************************************************/
  17549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17550. "use strict";
  17551. __webpack_require__.r(__webpack_exports__);
  17552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17553. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17554. /* harmony export */ });
  17555. /* harmony import */ var _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");
  17556. /* 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");
  17557. const script = {}
  17558. ;
  17559. 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"]])
  17560. /* hot reload */
  17561. if (false) {}
  17562. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17563. /***/ }),
  17564. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17565. /*!***************************************************************!*\
  17566. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17567. \***************************************************************/
  17568. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17569. "use strict";
  17570. __webpack_require__.r(__webpack_exports__);
  17571. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17572. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17573. /* harmony export */ });
  17574. /* 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");
  17575. /* 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");
  17576. /* 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");
  17577. /* 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");
  17578. ;
  17579. 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"]])
  17580. /* hot reload */
  17581. if (false) {}
  17582. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17583. /***/ }),
  17584. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17585. /*!******************************************************************!*\
  17586. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17587. \******************************************************************/
  17588. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17589. "use strict";
  17590. __webpack_require__.r(__webpack_exports__);
  17591. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17592. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17593. /* harmony export */ });
  17594. /* 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");
  17595. /* 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");
  17596. /* 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");
  17597. /* 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");
  17598. ;
  17599. 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"]])
  17600. /* hot reload */
  17601. if (false) {}
  17602. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17603. /***/ }),
  17604. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17605. /*!**************************************************************!*\
  17606. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17607. \**************************************************************/
  17608. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17609. "use strict";
  17610. __webpack_require__.r(__webpack_exports__);
  17611. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17612. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17613. /* harmony export */ });
  17614. /* 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");
  17615. /* 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");
  17616. /* 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");
  17617. /* 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");
  17618. ;
  17619. 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"]])
  17620. /* hot reload */
  17621. if (false) {}
  17622. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17623. /***/ }),
  17624. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17625. /*!************************************************************!*\
  17626. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17627. \************************************************************/
  17628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17629. "use strict";
  17630. __webpack_require__.r(__webpack_exports__);
  17631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17632. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17633. /* harmony export */ });
  17634. /* 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");
  17635. /* 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");
  17636. /* 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");
  17637. /* 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");
  17638. ;
  17639. 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"]])
  17640. /* hot reload */
  17641. if (false) {}
  17642. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17643. /***/ }),
  17644. /***/ "./resources/js/pages/Customers/Index.vue":
  17645. /*!************************************************!*\
  17646. !*** ./resources/js/pages/Customers/Index.vue ***!
  17647. \************************************************/
  17648. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17649. "use strict";
  17650. __webpack_require__.r(__webpack_exports__);
  17651. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17652. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17653. /* harmony export */ });
  17654. /* harmony import */ var _Index_vue_vue_type_template_id_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=2f43e3ff */ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17655. /* harmony import */ var _Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17656. /* 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");
  17657. ;
  17658. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Customers/Index.vue"]])
  17659. /* hot reload */
  17660. if (false) {}
  17661. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17662. /***/ }),
  17663. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17664. /*!**************************************************************************************!*\
  17665. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17666. \**************************************************************************************/
  17667. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17668. "use strict";
  17669. __webpack_require__.r(__webpack_exports__);
  17670. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17671. /* harmony export */ "default": () => (/* 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"])
  17672. /* harmony export */ });
  17673. /* 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");
  17674. /***/ }),
  17675. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17676. /*!***********************************************************************************!*\
  17677. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17678. \***********************************************************************************/
  17679. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17680. "use strict";
  17681. __webpack_require__.r(__webpack_exports__);
  17682. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17683. /* harmony export */ "default": () => (/* 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"])
  17684. /* harmony export */ });
  17685. /* 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");
  17686. /***/ }),
  17687. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17688. /*!**************************************************************************************!*\
  17689. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17690. \**************************************************************************************/
  17691. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17692. "use strict";
  17693. __webpack_require__.r(__webpack_exports__);
  17694. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17695. /* 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"])
  17696. /* harmony export */ });
  17697. /* 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");
  17698. /***/ }),
  17699. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17700. /*!**********************************************************************************!*\
  17701. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17702. \**********************************************************************************/
  17703. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17704. "use strict";
  17705. __webpack_require__.r(__webpack_exports__);
  17706. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17707. /* 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"])
  17708. /* harmony export */ });
  17709. /* 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");
  17710. /***/ }),
  17711. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17712. /*!**************************************************************************************************!*\
  17713. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17714. \**************************************************************************************************/
  17715. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17716. "use strict";
  17717. __webpack_require__.r(__webpack_exports__);
  17718. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17719. /* 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"])
  17720. /* harmony export */ });
  17721. /* 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");
  17722. /***/ }),
  17723. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17724. /*!*****************************************************************************************************!*\
  17725. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17726. \*****************************************************************************************************/
  17727. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17728. "use strict";
  17729. __webpack_require__.r(__webpack_exports__);
  17730. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17731. /* harmony export */ "default": () => (/* 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"])
  17732. /* harmony export */ });
  17733. /* 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");
  17734. /***/ }),
  17735. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17736. /*!*************************************************************************************************!*\
  17737. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17738. \*************************************************************************************************/
  17739. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17740. "use strict";
  17741. __webpack_require__.r(__webpack_exports__);
  17742. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17743. /* harmony export */ "default": () => (/* 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"])
  17744. /* harmony export */ });
  17745. /* 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");
  17746. /***/ }),
  17747. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17748. /*!***********************************************************************************************!*\
  17749. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17750. \***********************************************************************************************/
  17751. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17752. "use strict";
  17753. __webpack_require__.r(__webpack_exports__);
  17754. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17755. /* 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"])
  17756. /* harmony export */ });
  17757. /* 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");
  17758. /***/ }),
  17759. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  17760. /*!***********************************************************************************!*\
  17761. !*** ./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17762. \***********************************************************************************/
  17763. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17764. "use strict";
  17765. __webpack_require__.r(__webpack_exports__);
  17766. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17767. /* 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"])
  17768. /* harmony export */ });
  17769. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17770. /***/ }),
  17771. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17772. /*!*********************************************************************************!*\
  17773. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17774. \*********************************************************************************/
  17775. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17776. "use strict";
  17777. __webpack_require__.r(__webpack_exports__);
  17778. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17779. /* 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)
  17780. /* harmony export */ });
  17781. /* 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");
  17782. /***/ }),
  17783. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17784. /*!******************************************************************************!*\
  17785. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17786. \******************************************************************************/
  17787. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17788. "use strict";
  17789. __webpack_require__.r(__webpack_exports__);
  17790. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17791. /* 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)
  17792. /* harmony export */ });
  17793. /* 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");
  17794. /***/ }),
  17795. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17796. /*!*********************************************************************************!*\
  17797. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17798. \*********************************************************************************/
  17799. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17800. "use strict";
  17801. __webpack_require__.r(__webpack_exports__);
  17802. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17803. /* 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)
  17804. /* harmony export */ });
  17805. /* 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");
  17806. /***/ }),
  17807. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17808. /*!*****************************************************************************!*\
  17809. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17810. \*****************************************************************************/
  17811. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17812. "use strict";
  17813. __webpack_require__.r(__webpack_exports__);
  17814. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17815. /* 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)
  17816. /* harmony export */ });
  17817. /* 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");
  17818. /***/ }),
  17819. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17820. /*!********************************************************************************************!*\
  17821. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17822. \********************************************************************************************/
  17823. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17824. "use strict";
  17825. __webpack_require__.r(__webpack_exports__);
  17826. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17827. /* 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)
  17828. /* harmony export */ });
  17829. /* 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");
  17830. /***/ }),
  17831. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17832. /*!*********************************************************************************************************!*\
  17833. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17834. \*********************************************************************************************************/
  17835. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17836. "use strict";
  17837. __webpack_require__.r(__webpack_exports__);
  17838. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17839. /* 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)
  17840. /* harmony export */ });
  17841. /* 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");
  17842. /***/ }),
  17843. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17844. /*!************************************************************************************************************!*\
  17845. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17846. \************************************************************************************************************/
  17847. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17848. "use strict";
  17849. __webpack_require__.r(__webpack_exports__);
  17850. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17851. /* 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)
  17852. /* harmony export */ });
  17853. /* 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");
  17854. /***/ }),
  17855. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17856. /*!********************************************************************************************************!*\
  17857. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17858. \********************************************************************************************************/
  17859. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17860. "use strict";
  17861. __webpack_require__.r(__webpack_exports__);
  17862. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17863. /* 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)
  17864. /* harmony export */ });
  17865. /* 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");
  17866. /***/ }),
  17867. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17868. /*!******************************************************************************************************!*\
  17869. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17870. \******************************************************************************************************/
  17871. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17872. "use strict";
  17873. __webpack_require__.r(__webpack_exports__);
  17874. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17875. /* 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)
  17876. /* harmony export */ });
  17877. /* 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");
  17878. /***/ }),
  17879. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  17880. /*!******************************************************************************!*\
  17881. !*** ./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  17882. \******************************************************************************/
  17883. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17884. "use strict";
  17885. __webpack_require__.r(__webpack_exports__);
  17886. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17887. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render)
  17888. /* harmony export */ });
  17889. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=2f43e3ff */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17890. /***/ }),
  17891. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17892. /*!************************************************************************************************************************!*\
  17893. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17894. \************************************************************************************************************************/
  17895. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17896. "use strict";
  17897. __webpack_require__.r(__webpack_exports__);
  17898. /* 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");
  17899. /***/ }),
  17900. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17901. /*!***************************************************************************************************************************!*\
  17902. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17903. \***************************************************************************************************************************/
  17904. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17905. "use strict";
  17906. __webpack_require__.r(__webpack_exports__);
  17907. /* 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");
  17908. /***/ }),
  17909. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17910. /*!***********************************************************************************************************************!*\
  17911. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17912. \***********************************************************************************************************************/
  17913. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17914. "use strict";
  17915. __webpack_require__.r(__webpack_exports__);
  17916. /* 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");
  17917. /***/ }),
  17918. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17919. /*!*********************************************************************************************************************!*\
  17920. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17921. \*********************************************************************************************************************/
  17922. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17923. "use strict";
  17924. __webpack_require__.r(__webpack_exports__);
  17925. /* 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");
  17926. /***/ })
  17927. }]);