resources_js_pages_transaction_Create_vue.js 701KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_transaction_Create_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/AppDropdown.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/AppDropdown.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 vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. label: {
  16. type: String,
  17. required: true
  18. },
  19. disabled: {
  20. type: Boolean,
  21. "default": false
  22. },
  23. placeholder: {
  24. type: String,
  25. required: true
  26. },
  27. error: {
  28. type: String,
  29. "default": null
  30. },
  31. optionLabel: {
  32. type: String,
  33. "default": 'label'
  34. },
  35. optionValue: {
  36. type: String,
  37. "default": 'value'
  38. },
  39. optionDisabled: {
  40. type: String,
  41. "default": 'disabled'
  42. },
  43. optionGroupChildren: {
  44. type: String,
  45. "default": null
  46. },
  47. optionGroupLabel: {
  48. type: String,
  49. "default": null
  50. },
  51. options: {
  52. type: Array,
  53. required: true
  54. },
  55. modelValue: null
  56. },
  57. emits: ['update:modelValue'],
  58. setup: function setup(__props, _ref) {
  59. var expose = _ref.expose;
  60. expose();
  61. var props = __props;
  62. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  63. return props.error ? true : false;
  64. });
  65. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  66. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') : null;
  67. });
  68. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  69. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') + '-help' : null;
  70. });
  71. var selectedDropdownLabel = function selectedDropdownLabel(value) {
  72. var result = props.options.find(function (option) {
  73. return option[props.optionValue] == value;
  74. });
  75. if (result) {
  76. return result[props.optionLabel];
  77. }
  78. };
  79. var __returned__ = {
  80. props: props,
  81. isError: isError,
  82. forLabel: forLabel,
  83. ariaDescribedbyLabel: ariaDescribedbyLabel,
  84. selectedDropdownLabel: selectedDropdownLabel,
  85. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  86. };
  87. Object.defineProperty(__returned__, '__isScriptSetup', {
  88. enumerable: false,
  89. value: true
  90. });
  91. return __returned__;
  92. }
  93. });
  94. /***/ }),
  95. /***/ "./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/AppInputText.vue?vue&type=script&setup=true&lang=js":
  96. /*!*****************************************************************************************************************************************************************************************************************!*\
  97. !*** ./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/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  98. \*****************************************************************************************************************************************************************************************************************/
  99. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  100. "use strict";
  101. __webpack_require__.r(__webpack_exports__);
  102. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  103. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  104. /* harmony export */ });
  105. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  107. props: {
  108. label: {
  109. type: String,
  110. required: true
  111. },
  112. disabled: {
  113. type: Boolean,
  114. "default": false
  115. },
  116. placeholder: {
  117. type: String,
  118. required: true
  119. },
  120. error: {
  121. type: String,
  122. "default": null
  123. },
  124. modelValue: null
  125. },
  126. emits: ['update:modelValue'],
  127. setup: function setup(__props, _ref) {
  128. var expose = _ref.expose;
  129. expose();
  130. var props = __props;
  131. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  132. return props.error ? true : false;
  133. });
  134. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  135. return props.label.toLowerCase().replace(/\s+/g, '-');
  136. });
  137. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  138. return props.label.toLowerCase().replace(/\s+/g, '-') + '-help';
  139. });
  140. var __returned__ = {
  141. props: props,
  142. isError: isError,
  143. forLabel: forLabel,
  144. ariaDescribedbyLabel: ariaDescribedbyLabel,
  145. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  146. };
  147. Object.defineProperty(__returned__, '__isScriptSetup', {
  148. enumerable: false,
  149. value: true
  150. });
  151. return __returned__;
  152. }
  153. });
  154. /***/ }),
  155. /***/ "./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":
  156. /*!***************************************************************************************************************************************************************************************************************!*\
  157. !*** ./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 ***!
  158. \***************************************************************************************************************************************************************************************************************/
  159. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  160. "use strict";
  161. __webpack_require__.r(__webpack_exports__);
  162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  163. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  164. /* harmony export */ });
  165. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  166. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  167. setup: function setup(__props, _ref) {
  168. var expose = _ref.expose;
  169. expose();
  170. var onClose = function onClose() {
  171. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  172. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  173. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  174. };
  175. var __returned__ = {
  176. onClose: onClose,
  177. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  188. /*!***************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  190. \***************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  198. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  199. props: {
  200. menu: Array
  201. },
  202. setup: function setup(__props, _ref) {
  203. var expose = _ref.expose;
  204. expose();
  205. var __returned__ = {
  206. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  207. };
  208. Object.defineProperty(__returned__, '__isScriptSetup', {
  209. enumerable: false,
  210. value: true
  211. });
  212. return __returned__;
  213. }
  214. });
  215. /***/ }),
  216. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  217. /*!******************************************************************************************************************************************************************************************************************!*\
  218. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  219. \******************************************************************************************************************************************************************************************************************/
  220. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  221. "use strict";
  222. __webpack_require__.r(__webpack_exports__);
  223. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  224. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  225. /* harmony export */ });
  226. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  227. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  228. props: {
  229. items: Array,
  230. root: {
  231. type: Boolean,
  232. "default": false
  233. }
  234. },
  235. setup: function setup(__props, _ref) {
  236. var expose = _ref.expose;
  237. expose();
  238. var __returned__ = {
  239. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  240. };
  241. Object.defineProperty(__returned__, '__isScriptSetup', {
  242. enumerable: false,
  243. value: true
  244. });
  245. return __returned__;
  246. }
  247. });
  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/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  250. /*!**************************************************************************************************************************************************************************************************************!*\
  251. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  252. \**************************************************************************************************************************************************************************************************************/
  253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  254. "use strict";
  255. __webpack_require__.r(__webpack_exports__);
  256. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  257. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  258. /* harmony export */ });
  259. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  260. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  261. emits: ['menu-toggle'],
  262. setup: function setup(__props, _ref) {
  263. var expose = _ref.expose;
  264. expose();
  265. var __returned__ = {
  266. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  267. };
  268. Object.defineProperty(__returned__, '__isScriptSetup', {
  269. enumerable: false,
  270. value: true
  271. });
  272. return __returned__;
  273. }
  274. });
  275. /***/ }),
  276. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  277. /*!*****************************************************************************************************************************************************************************************************************!*\
  278. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  279. \*****************************************************************************************************************************************************************************************************************/
  280. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  281. "use strict";
  282. __webpack_require__.r(__webpack_exports__);
  283. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  284. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  285. /* harmony export */ });
  286. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  287. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  288. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  289. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  290. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  291. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  292. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  293. setup: function setup(__props, _ref) {
  294. var expose = _ref.expose;
  295. expose();
  296. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  297. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  298. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  299. var isDesktop = function isDesktop() {
  300. return window.innerWidth >= 992;
  301. };
  302. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  303. return ['layout-wrapper', {
  304. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  305. 'layout-mobile-sidebar-active': mobileMenuActive.value
  306. }];
  307. });
  308. var onWrapperClick = function onWrapperClick() {
  309. if (!menuClick.value) {
  310. mobileMenuActive.value = false;
  311. }
  312. menuClick.value = false;
  313. };
  314. var onMenuToggle = function onMenuToggle(event) {
  315. menuClick.value = true;
  316. if (isDesktop()) {
  317. staticMenuInactive.value = !staticMenuInactive.value;
  318. } else {
  319. mobileMenuActive.value = !mobileMenuActive.value;
  320. }
  321. event.preventDefault();
  322. };
  323. var __returned__ = {
  324. mobileMenuActive: mobileMenuActive,
  325. staticMenuInactive: staticMenuInactive,
  326. menuClick: menuClick,
  327. isDesktop: isDesktop,
  328. containerClass: containerClass,
  329. onWrapperClick: onWrapperClick,
  330. onMenuToggle: onMenuToggle,
  331. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  332. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  333. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  334. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  335. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  336. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  337. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  338. };
  339. Object.defineProperty(__returned__, '__isScriptSetup', {
  340. enumerable: false,
  341. value: true
  342. });
  343. return __returned__;
  344. }
  345. });
  346. /***/ }),
  347. /***/ "./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/transaction/Create.vue?vue&type=script&setup=true&lang=js":
  348. /*!******************************************************************************************************************************************************************************************************************!*\
  349. !*** ./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/transaction/Create.vue?vue&type=script&setup=true&lang=js ***!
  350. \******************************************************************************************************************************************************************************************************************/
  351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  352. "use strict";
  353. __webpack_require__.r(__webpack_exports__);
  354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  355. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  356. /* harmony export */ });
  357. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  358. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  359. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  360. /* harmony import */ var _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/useFormErrorReset */ "./resources/js/components/useFormErrorReset.js");
  361. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  362. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
  363. /* harmony import */ var _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/AppInputText.vue */ "./resources/js/components/AppInputText.vue");
  364. /* harmony import */ var _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/AppDropdown.vue */ "./resources/js/components/AppDropdown.vue");
  365. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  366. /* harmony import */ var _TableHeader__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TableHeader */ "./resources/js/pages/transaction/TableHeader.js");
  367. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  368. props: {
  369. outTransactions: Object,
  370. typeVehicles: Object
  371. },
  372. setup: function setup(__props, _ref) {
  373. var expose = _ref.expose;
  374. expose();
  375. var form = (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.useForm)({
  376. plat_number: null,
  377. entry_transaction_id: null,
  378. type_vehicle_id: null
  379. });
  380. (0,_components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_3__.useFormErrorReset)(form);
  381. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
  382. return form.plat_number;
  383. }, function () {
  384. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  385. only: ['typeVehicles'],
  386. data: {
  387. plat_number: form.plat_number
  388. }
  389. });
  390. });
  391. var submit = function submit() {
  392. form.post(route('transactions.store'), {
  393. onSuccess: function onSuccess() {
  394. return form.reset();
  395. }
  396. });
  397. };
  398. var __returned__ = {
  399. form: form,
  400. submit: submit,
  401. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  402. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  403. useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.useForm,
  404. useFormErrorReset: _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_3__.useFormErrorReset,
  405. throttle: lodash__WEBPACK_IMPORTED_MODULE_4__.throttle,
  406. AppInputText: _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  407. AppDropdown: _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  408. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  409. IndexTable: _TableHeader__WEBPACK_IMPORTED_MODULE_8__["default"]
  410. };
  411. Object.defineProperty(__returned__, '__isScriptSetup', {
  412. enumerable: false,
  413. value: true
  414. });
  415. return __returned__;
  416. }
  417. });
  418. /***/ }),
  419. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppDropdown.vue?vue&type=template&id=ce0d1992":
  420. /*!*********************************************************************************************************************************************************************************************************************************************************************************!*\
  421. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  422. \*********************************************************************************************************************************************************************************************************************************************************************************/
  423. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  424. "use strict";
  425. __webpack_require__.r(__webpack_exports__);
  426. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  427. /* harmony export */ "render": () => (/* binding */ render)
  428. /* harmony export */ });
  429. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  430. var _hoisted_1 = {
  431. "class": "field"
  432. };
  433. var _hoisted_2 = ["for"];
  434. var _hoisted_3 = {
  435. key: 0
  436. };
  437. var _hoisted_4 = {
  438. key: 1
  439. };
  440. var _hoisted_5 = ["id"];
  441. function render(_ctx, _cache, $props, $setup, $data, $options) {
  442. var _component_Dropdown = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dropdown");
  443. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [$props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("label", {
  444. key: 0,
  445. "for": $setup.forLabel
  446. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  447. /* TEXT, PROPS */
  448. , _hoisted_2)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dropdown, {
  449. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  450. 'p-invalid': $setup.isError
  451. }]),
  452. id: $setup.forLabel,
  453. "aria-describedby": $setup.ariaDescribedbyLabel,
  454. "option-disabled": $props.optionDisabled,
  455. "option-group-children": $props.optionGroupChildren,
  456. "option-group-label": $props.optionGroupLabel,
  457. "option-label": $props.optionLabel,
  458. "option-value": $props.optionValue,
  459. placeholder: $props.placeholder,
  460. options: $props.options,
  461. "model-value": $props.modelValue,
  462. disabled: $props.disabled,
  463. onChange: _cache[0] || (_cache[0] = function ($event) {
  464. return _ctx.$emit('update:modelValue', $event.value);
  465. })
  466. }, {
  467. value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (slotProps) {
  468. return [slotProps.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.selectedDropdownLabel(slotProps.value)), 1
  469. /* TEXT */
  470. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(slotProps.placeholder), 1
  471. /* TEXT */
  472. ))];
  473. }),
  474. option: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  475. var option = _ref.option,
  476. index = _ref.index;
  477. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "option", {
  478. option: option,
  479. index: index
  480. })];
  481. }),
  482. _: 3
  483. /* FORWARDED */
  484. }, 8
  485. /* PROPS */
  486. , ["class", "id", "aria-describedby", "option-disabled", "option-group-children", "option-group-label", "option-label", "option-value", "placeholder", "options", "model-value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  487. key: 1,
  488. id: $setup.ariaDescribedbyLabel,
  489. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  490. 'p-error': $setup.isError
  491. })
  492. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  493. /* TEXT, CLASS, PROPS */
  494. , _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  495. }
  496. /***/ }),
  497. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  498. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  499. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  500. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  501. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  502. "use strict";
  503. __webpack_require__.r(__webpack_exports__);
  504. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  505. /* harmony export */ "render": () => (/* binding */ render)
  506. /* harmony export */ });
  507. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  508. var _withScopeId = function _withScopeId(n) {
  509. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  510. };
  511. var _hoisted_1 = {
  512. "class": "layout-footer"
  513. };
  514. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  515. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  516. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  517. href: "https://dijitalcode.com",
  518. target: "_blank",
  519. "class": "font-medium ml-2"
  520. }, "DijitalCODE", -1
  521. /* HOISTED */
  522. );
  523. });
  524. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  525. function render(_ctx, _cache) {
  526. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  527. }
  528. /***/ }),
  529. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1":
  530. /*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
  531. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  532. \**********************************************************************************************************************************************************************************************************************************************************************************/
  533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  534. "use strict";
  535. __webpack_require__.r(__webpack_exports__);
  536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  537. /* harmony export */ "render": () => (/* binding */ render)
  538. /* harmony export */ });
  539. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  540. var _hoisted_1 = {
  541. "class": "field"
  542. };
  543. var _hoisted_2 = ["for"];
  544. var _hoisted_3 = ["id"];
  545. function render(_ctx, _cache, $props, $setup, $data, $options) {
  546. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  547. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {
  548. "for": $setup.forLabel
  549. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  550. /* TEXT, PROPS */
  551. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  552. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  553. 'p-invalid': $setup.isError
  554. }]),
  555. type: "text",
  556. id: $setup.forLabel,
  557. "aria-describedby": $setup.ariaDescribedbyLabel,
  558. "model-value": $props.modelValue,
  559. placeholder: $props.placeholder,
  560. value: $props.modelValue,
  561. disabled: $props.disabled,
  562. onInput: _cache[0] || (_cache[0] = function ($event) {
  563. return _ctx.$emit('update:modelValue', $event.target.value);
  564. })
  565. }, null, 8
  566. /* PROPS */
  567. , ["class", "id", "aria-describedby", "model-value", "placeholder", "value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  568. key: 0,
  569. id: $setup.ariaDescribedbyLabel,
  570. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  571. 'p-error': $setup.isError
  572. })
  573. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  574. /* TEXT, CLASS, PROPS */
  575. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  576. }
  577. /***/ }),
  578. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  579. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  580. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  581. \********************************************************************************************************************************************************************************************************************************************************************************/
  582. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  583. "use strict";
  584. __webpack_require__.r(__webpack_exports__);
  585. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  586. /* harmony export */ "render": () => (/* binding */ render)
  587. /* harmony export */ });
  588. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  589. var _hoisted_1 = {
  590. key: 0
  591. };
  592. var _hoisted_2 = {
  593. key: 1
  594. };
  595. function render(_ctx, _cache, $props, $setup, $data, $options) {
  596. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  597. 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, {
  598. key: 0,
  599. severity: "success",
  600. onClose: $setup.onClose
  601. }, {
  602. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  603. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  604. /* TEXT */
  605. )];
  606. }),
  607. _: 1
  608. /* STABLE */
  609. })) : (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, {
  610. key: 1,
  611. severity: "error",
  612. onClose: $setup.onClose
  613. }, {
  614. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  615. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  616. /* TEXT */
  617. )];
  618. }),
  619. _: 1
  620. /* STABLE */
  621. })) : (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, {
  622. key: 2,
  623. severity: "error",
  624. onClose: $setup.onClose
  625. }, {
  626. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  627. 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
  628. /* TEXT */
  629. ))];
  630. }),
  631. _: 1
  632. /* STABLE */
  633. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  634. /* STABLE_FRAGMENT */
  635. );
  636. }
  637. /***/ }),
  638. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  639. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  640. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  641. \********************************************************************************************************************************************************************************************************************************************************************************************/
  642. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  643. "use strict";
  644. __webpack_require__.r(__webpack_exports__);
  645. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  646. /* harmony export */ "render": () => (/* binding */ render)
  647. /* harmony export */ });
  648. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  649. function render(_ctx, _cache, $props, $setup, $data, $options) {
  650. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  651. "class": "layout-menu",
  652. items: $props.menu,
  653. root: true
  654. }, null, 8
  655. /* PROPS */
  656. , ["items"])]);
  657. }
  658. /***/ }),
  659. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  660. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  661. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  662. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  663. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  664. "use strict";
  665. __webpack_require__.r(__webpack_exports__);
  666. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  667. /* harmony export */ "render": () => (/* binding */ render)
  668. /* harmony export */ });
  669. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  670. var _withScopeId = function _withScopeId(n) {
  671. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  672. };
  673. var _hoisted_1 = {
  674. key: 0
  675. };
  676. var _hoisted_2 = ["aria-label"];
  677. var _hoisted_3 = ["aria-label"];
  678. function render(_ctx, _cache, $props, $setup, $data, $options) {
  679. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  680. 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) {
  681. 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", {
  682. key: i,
  683. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  684. 'layout-menuitem-category': $props.root
  685. }]),
  686. role: "none"
  687. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  688. key: 0
  689. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  690. "class": "layout-menuitem-root-text",
  691. "aria-label": item.label
  692. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  693. /* TEXT, PROPS */
  694. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  695. items: item.items
  696. }, null, 8
  697. /* PROPS */
  698. , ["items"])], 64
  699. /* STABLE_FRAGMENT */
  700. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  701. key: 1
  702. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  703. key: 0,
  704. role: "menuitem",
  705. href: item.to,
  706. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  707. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  708. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  709. }]),
  710. "aria-label": item.label
  711. }, {
  712. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  713. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  714. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  715. }, null, 2
  716. /* CLASS */
  717. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  718. /* TEXT */
  719. )];
  720. }),
  721. _: 2
  722. /* DYNAMIC */
  723. }, 1032
  724. /* PROPS, DYNAMIC_SLOTS */
  725. , ["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", {
  726. key: 1,
  727. href: "#",
  728. role: "menuitem",
  729. "aria-label": item.label
  730. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  731. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  732. }, null, 2
  733. /* CLASS */
  734. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  735. /* TEXT */
  736. )], 8
  737. /* PROPS */
  738. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  739. items: item.items
  740. }, null, 8
  741. /* PROPS */
  742. , ["items"])], 64
  743. /* STABLE_FRAGMENT */
  744. ))], 2
  745. /* CLASS */
  746. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  747. /* STABLE_FRAGMENT */
  748. );
  749. }), 256
  750. /* UNKEYED_FRAGMENT */
  751. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  752. }
  753. /***/ }),
  754. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  755. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  756. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  757. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  758. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  759. "use strict";
  760. __webpack_require__.r(__webpack_exports__);
  761. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  762. /* harmony export */ "render": () => (/* binding */ render)
  763. /* harmony export */ });
  764. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  765. var _withScopeId = function _withScopeId(n) {
  766. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  767. };
  768. var _hoisted_1 = {
  769. "class": "layout-topbar"
  770. };
  771. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  772. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  773. alt: "Logo",
  774. src: "/images/logo.svg",
  775. "class": "md:mr-3"
  776. }, null, -1
  777. /* HOISTED */
  778. );
  779. });
  780. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  781. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  782. /* HOISTED */
  783. );
  784. });
  785. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  786. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  787. "class": "pi pi-bars"
  788. }, null, -1
  789. /* HOISTED */
  790. );
  791. });
  792. var _hoisted_5 = [_hoisted_4];
  793. var _hoisted_6 = {
  794. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  795. };
  796. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  797. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  798. "class": "pi pi-ellipsis-v"
  799. }, null, -1
  800. /* HOISTED */
  801. );
  802. });
  803. var _hoisted_8 = [_hoisted_7];
  804. var _hoisted_9 = {
  805. "class": "layout-topbar-menu hidden lg:flex origin-top"
  806. };
  807. var _hoisted_10 = {
  808. "class": "align-self-center"
  809. };
  810. var _hoisted_11 = {
  811. "class": "hidden lg:inline"
  812. };
  813. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  814. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  815. "class": "pi pi-user"
  816. }, null, -1
  817. /* HOISTED */
  818. );
  819. });
  820. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  821. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  822. /* HOISTED */
  823. );
  824. });
  825. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  826. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  827. "class": "pi pi-sign-out"
  828. }, null, -1
  829. /* HOISTED */
  830. );
  831. });
  832. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  833. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  834. /* HOISTED */
  835. );
  836. });
  837. function render(_ctx, _cache, $props, $setup, $data, $options) {
  838. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  839. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  840. 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"], {
  841. href: "/",
  842. "class": "layout-topbar-logo"
  843. }, {
  844. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  845. return [_hoisted_2, _hoisted_3];
  846. }),
  847. _: 1
  848. /* STABLE */
  849. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  850. "class": "p-link layout-menu-button layout-topbar-button",
  851. onClick: _cache[0] || (_cache[0] = function ($event) {
  852. return _ctx.$emit('menu-toggle', $event);
  853. })
  854. }, _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, {
  855. selector: '@next',
  856. enterClass: 'hidden',
  857. enterActiveClass: 'scalein',
  858. leaveToClass: 'hidden',
  859. leaveActiveClass: 'fadeout',
  860. hideOnOutsideClick: true
  861. }]]), (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
  862. /* TEXT */
  863. )]), (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"], {
  864. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  865. "class": "p-link layout-topbar-button"
  866. }, {
  867. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  868. return [_hoisted_12, _hoisted_13];
  869. }),
  870. _: 1
  871. /* STABLE */
  872. }, 8
  873. /* PROPS */
  874. , ["href"])), [[_directive_tooltip, {
  875. value: 'Ubah Profil',
  876. "class": 'layout-topbar-menu-tooltip'
  877. }, void 0, {
  878. bottom: true
  879. }]])]), (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"], {
  880. href: _ctx.route('logout'),
  881. as: "button",
  882. method: "post",
  883. "class": "p-link layout-topbar-button"
  884. }, {
  885. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  886. return [_hoisted_14, _hoisted_15];
  887. }),
  888. _: 1
  889. /* STABLE */
  890. }, 8
  891. /* PROPS */
  892. , ["href"])), [[_directive_tooltip, {
  893. value: 'Keluar',
  894. "class": 'layout-topbar-menu-tooltip'
  895. }, void 0, {
  896. bottom: true
  897. }]])])])]);
  898. }
  899. /***/ }),
  900. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  901. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  902. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  903. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  904. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  905. "use strict";
  906. __webpack_require__.r(__webpack_exports__);
  907. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  908. /* harmony export */ "render": () => (/* binding */ render)
  909. /* harmony export */ });
  910. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  911. var _withScopeId = function _withScopeId(n) {
  912. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  913. };
  914. var _hoisted_1 = {
  915. "class": "layout-sidebar"
  916. };
  917. var _hoisted_2 = {
  918. "class": "layout-main-container"
  919. };
  920. var _hoisted_3 = {
  921. "class": "layout-main"
  922. };
  923. var _hoisted_4 = {
  924. key: 0,
  925. "class": "layout-mask p-component-overlay"
  926. };
  927. function render(_ctx, _cache, $props, $setup, $data, $options) {
  928. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  929. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  930. onClick: $setup.onWrapperClick
  931. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  932. onMenuToggle: $setup.onMenuToggle
  933. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  934. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  935. }, null, 8
  936. /* PROPS */
  937. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  938. name: "layout-mask"
  939. }, {
  940. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  941. 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)];
  942. }),
  943. _: 1
  944. /* STABLE */
  945. })], 2
  946. /* CLASS */
  947. );
  948. }
  949. /***/ }),
  950. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/transaction/Create.vue?vue&type=template&id=2717ac16":
  951. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  952. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/transaction/Create.vue?vue&type=template&id=2717ac16 ***!
  953. \***********************************************************************************************************************************************************************************************************************************************************************************/
  954. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  955. "use strict";
  956. __webpack_require__.r(__webpack_exports__);
  957. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  958. /* harmony export */ "render": () => (/* binding */ render)
  959. /* harmony export */ });
  960. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  961. var _hoisted_1 = {
  962. "class": "grid"
  963. };
  964. var _hoisted_2 = {
  965. "class": "col-12"
  966. };
  967. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Tambah Transaksi Keluar ");
  968. var _hoisted_4 = {
  969. "class": "grid"
  970. };
  971. var _hoisted_5 = {
  972. "class": "col-12 md:col-6"
  973. };
  974. var _hoisted_6 = {
  975. "class": "col-12 md:col-6"
  976. };
  977. var _hoisted_7 = {
  978. "class": "col-12 md:col-6"
  979. };
  980. var _hoisted_8 = {
  981. "class": "flex flex-column md:flex-row justify-content-end"
  982. };
  983. var _hoisted_9 = {
  984. "class": "col-12"
  985. };
  986. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Kendaraan Keluar ");
  987. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  988. style: {
  989. "color": "var(--red-600)"
  990. }
  991. }, " Maksimal ditampilkan : ", -1
  992. /* HOISTED */
  993. );
  994. var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" 10 ");
  995. var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
  996. /* HOISTED */
  997. );
  998. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  999. style: {
  1000. "color": "var(--red-600)"
  1001. }
  1002. }, "Ditampilkan :", -1
  1003. /* HOISTED */
  1004. );
  1005. function render(_ctx, _cache, $props, $setup, $data, $options) {
  1006. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  1007. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  1008. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  1009. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  1010. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  1011. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1012. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1013. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1014. return [_hoisted_3];
  1015. }),
  1016. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1017. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1018. modelValue: $setup.form.plat_number,
  1019. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  1020. return $setup.form.plat_number = $event;
  1021. }),
  1022. label: "Plat Kendaraan",
  1023. placeholder: "plat kendaraan",
  1024. error: $setup.form.errors.plat_number
  1025. }, null, 8
  1026. /* PROPS */
  1027. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1028. modelValue: $setup.form.entry_transaction_id,
  1029. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  1030. return $setup.form.entry_transaction_id = $event;
  1031. }),
  1032. label: "Nomor Transaksi",
  1033. placeholder: "nomor transaksi",
  1034. error: $setup.form.errors.entry_transaction_id
  1035. }, null, 8
  1036. /* PROPS */
  1037. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1038. modelValue: $setup.form.type_vehicle_id,
  1039. "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
  1040. return $setup.form.type_vehicle_id = $event;
  1041. }),
  1042. label: "Jenis Kendaraan",
  1043. placeholder: "jenis kendaraan",
  1044. options: $props.typeVehicles,
  1045. error: $setup.form.errors.type_vehicle_id
  1046. }, null, 8
  1047. /* PROPS */
  1048. , ["modelValue", "options", "error"])])])];
  1049. }),
  1050. footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1051. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1052. label: "Simpan",
  1053. icon: "pi pi-check",
  1054. "class": "p-button-outlined",
  1055. disabled: $setup.form.processing,
  1056. onClick: $setup.submit
  1057. }, null, 8
  1058. /* PROPS */
  1059. , ["disabled"])])];
  1060. }),
  1061. _: 1
  1062. /* STABLE */
  1063. })]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1064. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1065. return [_hoisted_10];
  1066. }),
  1067. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1068. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  1069. responsiveLayout: "scroll",
  1070. columnResizeMode: "expand",
  1071. value: $props.outTransactions,
  1072. rowHover: true,
  1073. stripedRows: true
  1074. }, {
  1075. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1076. return [_hoisted_11, _hoisted_12, _hoisted_13, _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys($props.outTransactions).length), 1
  1077. /* TEXT */
  1078. )];
  1079. }),
  1080. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1081. 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) {
  1082. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  1083. field: value.field,
  1084. header: value.header,
  1085. key: value.field
  1086. }, null, 8
  1087. /* PROPS */
  1088. , ["field", "header"]);
  1089. }), 128
  1090. /* KEYED_FRAGMENT */
  1091. ))];
  1092. }),
  1093. _: 1
  1094. /* STABLE */
  1095. }, 8
  1096. /* PROPS */
  1097. , ["value"])];
  1098. }),
  1099. _: 1
  1100. /* STABLE */
  1101. })])])];
  1102. }),
  1103. _: 1
  1104. /* STABLE */
  1105. });
  1106. }
  1107. /***/ }),
  1108. /***/ "./resources/js/components/useFormErrorReset.js":
  1109. /*!******************************************************!*\
  1110. !*** ./resources/js/components/useFormErrorReset.js ***!
  1111. \******************************************************/
  1112. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1113. "use strict";
  1114. __webpack_require__.r(__webpack_exports__);
  1115. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1116. /* harmony export */ "useFormErrorReset": () => (/* binding */ useFormErrorReset)
  1117. /* harmony export */ });
  1118. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1119. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1120. function useFormErrorReset(form) {
  1121. var errors = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  1122. return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.errors;
  1123. });
  1124. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(errors, function () {
  1125. form.clearErrors();
  1126. });
  1127. }
  1128. /***/ }),
  1129. /***/ "./resources/js/pages/transaction/TableHeader.js":
  1130. /*!*******************************************************!*\
  1131. !*** ./resources/js/pages/transaction/TableHeader.js ***!
  1132. \*******************************************************/
  1133. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1134. "use strict";
  1135. __webpack_require__.r(__webpack_exports__);
  1136. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1137. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1138. /* harmony export */ });
  1139. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  1140. field: 'entryCar',
  1141. header: 'Kendaraan Masuk'
  1142. }, {
  1143. field: 'outCar',
  1144. header: 'Kendaraan Keluar'
  1145. }, {
  1146. field: 'totalTimeParking',
  1147. header: 'Lama Parkir'
  1148. }, {
  1149. field: 'totalPriceParking',
  1150. header: 'Biaya Parkir'
  1151. }, {
  1152. field: 'platNumber',
  1153. header: 'Plat Kendaraan'
  1154. }, {
  1155. field: 'entryTransactionId',
  1156. header: 'Nomor Transaksi'
  1157. }]);
  1158. /***/ }),
  1159. /***/ "./resources/js/utils/menu.js":
  1160. /*!************************************!*\
  1161. !*** ./resources/js/utils/menu.js ***!
  1162. \************************************/
  1163. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1164. "use strict";
  1165. __webpack_require__.r(__webpack_exports__);
  1166. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1167. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1168. /* harmony export */ });
  1169. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1170. // Admin
  1171. 1: [{
  1172. label: 'Home',
  1173. items: [{
  1174. label: 'Dashboard',
  1175. icon: 'pi pi-home',
  1176. to: '/dashboards',
  1177. component: 'home/Index'
  1178. }]
  1179. }, {
  1180. label: 'Master',
  1181. items: [{
  1182. label: 'User',
  1183. icon: 'pi pi-user',
  1184. to: '/users',
  1185. component: 'user/Index'
  1186. }]
  1187. }],
  1188. // Supervisor
  1189. 2: [{
  1190. label: 'Home',
  1191. items: [{
  1192. label: 'Dashboard',
  1193. icon: 'pi pi-home',
  1194. to: '/dashboards',
  1195. component: 'home/Index'
  1196. }]
  1197. }, {
  1198. label: 'Menu',
  1199. items: [{
  1200. label: 'Pengeluaran',
  1201. icon: 'pi pi-wallet',
  1202. to: '/expenses',
  1203. component: 'expense/Index'
  1204. }, {
  1205. label: 'Laporan',
  1206. icon: 'pi pi-book',
  1207. items: [{
  1208. label: 'Mutasi',
  1209. icon: 'pi pi-circle',
  1210. to: '/reports/mutations',
  1211. component: 'mutation/Report'
  1212. }]
  1213. }]
  1214. }, {
  1215. label: 'Master',
  1216. items: [{
  1217. label: 'Jenis Kendaraan',
  1218. icon: 'pi pi-car',
  1219. to: '/type-vehicles',
  1220. component: 'typevehicle/Index'
  1221. }, {
  1222. label: 'Jenis Member',
  1223. icon: 'pi pi-id-card',
  1224. to: '/type-members',
  1225. component: 'typemember/Index'
  1226. }]
  1227. }, {
  1228. label: 'Pengaturan',
  1229. items: [{
  1230. label: 'Tarif Parkir',
  1231. icon: 'pi pi-car',
  1232. to: '/parking-fees/create',
  1233. component: 'parkingfee/Create'
  1234. }]
  1235. }],
  1236. // Operator
  1237. 3: [{
  1238. label: 'Home',
  1239. items: [{
  1240. label: 'Dashboard',
  1241. icon: 'pi pi-home',
  1242. to: '/dashboards',
  1243. component: 'home/Index'
  1244. }]
  1245. }, {
  1246. label: 'Transaksi',
  1247. items: [{
  1248. label: 'Transaksi masuk dan keluar',
  1249. icon: 'pi pi-car',
  1250. to: '/transactions/create',
  1251. component: 'transaction/Create'
  1252. }]
  1253. }, {
  1254. label: 'Menu',
  1255. items: [{
  1256. label: 'Pengeluaran',
  1257. icon: 'pi pi-wallet',
  1258. to: '/expenses',
  1259. component: 'expense/Index'
  1260. }, {
  1261. label: 'Member',
  1262. icon: 'pi pi-id-card',
  1263. to: '/members',
  1264. component: 'member/Index'
  1265. }, {
  1266. label: 'Top Up',
  1267. icon: 'pi pi-car',
  1268. to: '/top-ups',
  1269. component: 'topup/Index'
  1270. }]
  1271. }, {
  1272. label: 'Not Production',
  1273. items: [{
  1274. label: 'Test Transactions',
  1275. icon: 'pi pi-car',
  1276. to: '/test-transactions/create',
  1277. component: 'test-transaction/Create'
  1278. }]
  1279. }]
  1280. });
  1281. /***/ }),
  1282. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1283. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1284. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1285. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1286. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1287. "use strict";
  1288. __webpack_require__.r(__webpack_exports__);
  1289. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1290. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1291. /* harmony export */ });
  1292. /* 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");
  1293. /* 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__);
  1294. // Imports
  1295. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1296. // Module
  1297. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1298. // Exports
  1299. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1300. /***/ }),
  1301. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1302. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1303. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1304. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1305. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1306. "use strict";
  1307. __webpack_require__.r(__webpack_exports__);
  1308. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1309. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1310. /* harmony export */ });
  1311. /* 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");
  1312. /* 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__);
  1313. // Imports
  1314. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1315. // Module
  1316. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1317. // Exports
  1318. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1319. /***/ }),
  1320. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1321. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1322. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1323. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1324. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1325. "use strict";
  1326. __webpack_require__.r(__webpack_exports__);
  1327. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1328. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1329. /* harmony export */ });
  1330. /* 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");
  1331. /* 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__);
  1332. // Imports
  1333. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1334. // Module
  1335. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1336. // Exports
  1337. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1338. /***/ }),
  1339. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1340. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1341. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1342. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1343. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1344. "use strict";
  1345. __webpack_require__.r(__webpack_exports__);
  1346. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1347. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1348. /* harmony export */ });
  1349. /* 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");
  1350. /* 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__);
  1351. // Imports
  1352. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1353. // Module
  1354. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1355. // Exports
  1356. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1357. /***/ }),
  1358. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1359. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1360. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1361. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1362. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1363. "use strict";
  1364. __webpack_require__.r(__webpack_exports__);
  1365. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1366. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1367. /* harmony export */ });
  1368. /* 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");
  1369. /* 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__);
  1370. // Imports
  1371. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1372. // Module
  1373. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1374. // Exports
  1375. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1376. /***/ }),
  1377. /***/ "./node_modules/lodash/lodash.js":
  1378. /*!***************************************!*\
  1379. !*** ./node_modules/lodash/lodash.js ***!
  1380. \***************************************/
  1381. /***/ (function(module, exports, __webpack_require__) {
  1382. /* module decorator */ module = __webpack_require__.nmd(module);
  1383. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1384. * @license
  1385. * Lodash <https://lodash.com/>
  1386. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1387. * Released under MIT license <https://lodash.com/license>
  1388. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1389. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1390. */
  1391. ;(function() {
  1392. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1393. var undefined;
  1394. /** Used as the semantic version number. */
  1395. var VERSION = '4.17.21';
  1396. /** Used as the size to enable large array optimizations. */
  1397. var LARGE_ARRAY_SIZE = 200;
  1398. /** Error message constants. */
  1399. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1400. FUNC_ERROR_TEXT = 'Expected a function',
  1401. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1402. /** Used to stand-in for `undefined` hash values. */
  1403. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1404. /** Used as the maximum memoize cache size. */
  1405. var MAX_MEMOIZE_SIZE = 500;
  1406. /** Used as the internal argument placeholder. */
  1407. var PLACEHOLDER = '__lodash_placeholder__';
  1408. /** Used to compose bitmasks for cloning. */
  1409. var CLONE_DEEP_FLAG = 1,
  1410. CLONE_FLAT_FLAG = 2,
  1411. CLONE_SYMBOLS_FLAG = 4;
  1412. /** Used to compose bitmasks for value comparisons. */
  1413. var COMPARE_PARTIAL_FLAG = 1,
  1414. COMPARE_UNORDERED_FLAG = 2;
  1415. /** Used to compose bitmasks for function metadata. */
  1416. var WRAP_BIND_FLAG = 1,
  1417. WRAP_BIND_KEY_FLAG = 2,
  1418. WRAP_CURRY_BOUND_FLAG = 4,
  1419. WRAP_CURRY_FLAG = 8,
  1420. WRAP_CURRY_RIGHT_FLAG = 16,
  1421. WRAP_PARTIAL_FLAG = 32,
  1422. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1423. WRAP_ARY_FLAG = 128,
  1424. WRAP_REARG_FLAG = 256,
  1425. WRAP_FLIP_FLAG = 512;
  1426. /** Used as default options for `_.truncate`. */
  1427. var DEFAULT_TRUNC_LENGTH = 30,
  1428. DEFAULT_TRUNC_OMISSION = '...';
  1429. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1430. var HOT_COUNT = 800,
  1431. HOT_SPAN = 16;
  1432. /** Used to indicate the type of lazy iteratees. */
  1433. var LAZY_FILTER_FLAG = 1,
  1434. LAZY_MAP_FLAG = 2,
  1435. LAZY_WHILE_FLAG = 3;
  1436. /** Used as references for various `Number` constants. */
  1437. var INFINITY = 1 / 0,
  1438. MAX_SAFE_INTEGER = 9007199254740991,
  1439. MAX_INTEGER = 1.7976931348623157e+308,
  1440. NAN = 0 / 0;
  1441. /** Used as references for the maximum length and index of an array. */
  1442. var MAX_ARRAY_LENGTH = 4294967295,
  1443. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1444. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1445. /** Used to associate wrap methods with their bit flags. */
  1446. var wrapFlags = [
  1447. ['ary', WRAP_ARY_FLAG],
  1448. ['bind', WRAP_BIND_FLAG],
  1449. ['bindKey', WRAP_BIND_KEY_FLAG],
  1450. ['curry', WRAP_CURRY_FLAG],
  1451. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1452. ['flip', WRAP_FLIP_FLAG],
  1453. ['partial', WRAP_PARTIAL_FLAG],
  1454. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1455. ['rearg', WRAP_REARG_FLAG]
  1456. ];
  1457. /** `Object#toString` result references. */
  1458. var argsTag = '[object Arguments]',
  1459. arrayTag = '[object Array]',
  1460. asyncTag = '[object AsyncFunction]',
  1461. boolTag = '[object Boolean]',
  1462. dateTag = '[object Date]',
  1463. domExcTag = '[object DOMException]',
  1464. errorTag = '[object Error]',
  1465. funcTag = '[object Function]',
  1466. genTag = '[object GeneratorFunction]',
  1467. mapTag = '[object Map]',
  1468. numberTag = '[object Number]',
  1469. nullTag = '[object Null]',
  1470. objectTag = '[object Object]',
  1471. promiseTag = '[object Promise]',
  1472. proxyTag = '[object Proxy]',
  1473. regexpTag = '[object RegExp]',
  1474. setTag = '[object Set]',
  1475. stringTag = '[object String]',
  1476. symbolTag = '[object Symbol]',
  1477. undefinedTag = '[object Undefined]',
  1478. weakMapTag = '[object WeakMap]',
  1479. weakSetTag = '[object WeakSet]';
  1480. var arrayBufferTag = '[object ArrayBuffer]',
  1481. dataViewTag = '[object DataView]',
  1482. float32Tag = '[object Float32Array]',
  1483. float64Tag = '[object Float64Array]',
  1484. int8Tag = '[object Int8Array]',
  1485. int16Tag = '[object Int16Array]',
  1486. int32Tag = '[object Int32Array]',
  1487. uint8Tag = '[object Uint8Array]',
  1488. uint8ClampedTag = '[object Uint8ClampedArray]',
  1489. uint16Tag = '[object Uint16Array]',
  1490. uint32Tag = '[object Uint32Array]';
  1491. /** Used to match empty string literals in compiled template source. */
  1492. var reEmptyStringLeading = /\b__p \+= '';/g,
  1493. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1494. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1495. /** Used to match HTML entities and HTML characters. */
  1496. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1497. reUnescapedHtml = /[&<>"']/g,
  1498. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1499. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1500. /** Used to match template delimiters. */
  1501. var reEscape = /<%-([\s\S]+?)%>/g,
  1502. reEvaluate = /<%([\s\S]+?)%>/g,
  1503. reInterpolate = /<%=([\s\S]+?)%>/g;
  1504. /** Used to match property names within property paths. */
  1505. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1506. reIsPlainProp = /^\w*$/,
  1507. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1508. /**
  1509. * Used to match `RegExp`
  1510. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1511. */
  1512. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1513. reHasRegExpChar = RegExp(reRegExpChar.source);
  1514. /** Used to match leading whitespace. */
  1515. var reTrimStart = /^\s+/;
  1516. /** Used to match a single whitespace character. */
  1517. var reWhitespace = /\s/;
  1518. /** Used to match wrap detail comments. */
  1519. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1520. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1521. reSplitDetails = /,? & /;
  1522. /** Used to match words composed of alphanumeric characters. */
  1523. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1524. /**
  1525. * Used to validate the `validate` option in `_.template` variable.
  1526. *
  1527. * Forbids characters which could potentially change the meaning of the function argument definition:
  1528. * - "()," (modification of function parameters)
  1529. * - "=" (default value)
  1530. * - "[]{}" (destructuring of function parameters)
  1531. * - "/" (beginning of a comment)
  1532. * - whitespace
  1533. */
  1534. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1535. /** Used to match backslashes in property paths. */
  1536. var reEscapeChar = /\\(\\)?/g;
  1537. /**
  1538. * Used to match
  1539. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1540. */
  1541. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1542. /** Used to match `RegExp` flags from their coerced string values. */
  1543. var reFlags = /\w*$/;
  1544. /** Used to detect bad signed hexadecimal string values. */
  1545. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1546. /** Used to detect binary string values. */
  1547. var reIsBinary = /^0b[01]+$/i;
  1548. /** Used to detect host constructors (Safari). */
  1549. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1550. /** Used to detect octal string values. */
  1551. var reIsOctal = /^0o[0-7]+$/i;
  1552. /** Used to detect unsigned integer values. */
  1553. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1554. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1555. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1556. /** Used to ensure capturing order of template delimiters. */
  1557. var reNoMatch = /($^)/;
  1558. /** Used to match unescaped characters in compiled string literals. */
  1559. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1560. /** Used to compose unicode character classes. */
  1561. var rsAstralRange = '\\ud800-\\udfff',
  1562. rsComboMarksRange = '\\u0300-\\u036f',
  1563. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1564. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1565. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1566. rsDingbatRange = '\\u2700-\\u27bf',
  1567. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1568. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1569. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1570. rsPunctuationRange = '\\u2000-\\u206f',
  1571. 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',
  1572. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1573. rsVarRange = '\\ufe0e\\ufe0f',
  1574. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1575. /** Used to compose unicode capture groups. */
  1576. var rsApos = "['\u2019]",
  1577. rsAstral = '[' + rsAstralRange + ']',
  1578. rsBreak = '[' + rsBreakRange + ']',
  1579. rsCombo = '[' + rsComboRange + ']',
  1580. rsDigits = '\\d+',
  1581. rsDingbat = '[' + rsDingbatRange + ']',
  1582. rsLower = '[' + rsLowerRange + ']',
  1583. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1584. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1585. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1586. rsNonAstral = '[^' + rsAstralRange + ']',
  1587. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1588. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1589. rsUpper = '[' + rsUpperRange + ']',
  1590. rsZWJ = '\\u200d';
  1591. /** Used to compose unicode regexes. */
  1592. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1593. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1594. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1595. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1596. reOptMod = rsModifier + '?',
  1597. rsOptVar = '[' + rsVarRange + ']?',
  1598. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1599. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1600. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1601. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1602. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1603. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1604. /** Used to match apostrophes. */
  1605. var reApos = RegExp(rsApos, 'g');
  1606. /**
  1607. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1608. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1609. */
  1610. var reComboMark = RegExp(rsCombo, 'g');
  1611. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1612. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1613. /** Used to match complex or compound words. */
  1614. var reUnicodeWord = RegExp([
  1615. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1616. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1617. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1618. rsUpper + '+' + rsOptContrUpper,
  1619. rsOrdUpper,
  1620. rsOrdLower,
  1621. rsDigits,
  1622. rsEmoji
  1623. ].join('|'), 'g');
  1624. /** 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/). */
  1625. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1626. /** Used to detect strings that need a more robust regexp to match words. */
  1627. 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 ]/;
  1628. /** Used to assign default `context` object properties. */
  1629. var contextProps = [
  1630. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1631. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1632. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1633. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1634. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1635. ];
  1636. /** Used to make template sourceURLs easier to identify. */
  1637. var templateCounter = -1;
  1638. /** Used to identify `toStringTag` values of typed arrays. */
  1639. var typedArrayTags = {};
  1640. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1641. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1642. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1643. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1644. typedArrayTags[uint32Tag] = true;
  1645. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1646. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1647. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1648. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1649. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1650. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1651. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1652. typedArrayTags[weakMapTag] = false;
  1653. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1654. var cloneableTags = {};
  1655. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1656. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1657. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1658. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1659. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1660. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1661. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1662. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1663. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1664. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1665. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1666. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1667. cloneableTags[weakMapTag] = false;
  1668. /** Used to map Latin Unicode letters to basic Latin letters. */
  1669. var deburredLetters = {
  1670. // Latin-1 Supplement block.
  1671. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1672. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1673. '\xc7': 'C', '\xe7': 'c',
  1674. '\xd0': 'D', '\xf0': 'd',
  1675. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1676. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1677. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1678. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1679. '\xd1': 'N', '\xf1': 'n',
  1680. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1681. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1682. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1683. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1684. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1685. '\xc6': 'Ae', '\xe6': 'ae',
  1686. '\xde': 'Th', '\xfe': 'th',
  1687. '\xdf': 'ss',
  1688. // Latin Extended-A block.
  1689. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1690. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1691. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1692. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1693. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1694. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1695. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1696. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1697. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1698. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1699. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1700. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1701. '\u0134': 'J', '\u0135': 'j',
  1702. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1703. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1704. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1705. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1706. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1707. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1708. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1709. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1710. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1711. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1712. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1713. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1714. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1715. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1716. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1717. '\u0174': 'W', '\u0175': 'w',
  1718. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1719. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1720. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1721. '\u0132': 'IJ', '\u0133': 'ij',
  1722. '\u0152': 'Oe', '\u0153': 'oe',
  1723. '\u0149': "'n", '\u017f': 's'
  1724. };
  1725. /** Used to map characters to HTML entities. */
  1726. var htmlEscapes = {
  1727. '&': '&amp;',
  1728. '<': '&lt;',
  1729. '>': '&gt;',
  1730. '"': '&quot;',
  1731. "'": '&#39;'
  1732. };
  1733. /** Used to map HTML entities to characters. */
  1734. var htmlUnescapes = {
  1735. '&amp;': '&',
  1736. '&lt;': '<',
  1737. '&gt;': '>',
  1738. '&quot;': '"',
  1739. '&#39;': "'"
  1740. };
  1741. /** Used to escape characters for inclusion in compiled string literals. */
  1742. var stringEscapes = {
  1743. '\\': '\\',
  1744. "'": "'",
  1745. '\n': 'n',
  1746. '\r': 'r',
  1747. '\u2028': 'u2028',
  1748. '\u2029': 'u2029'
  1749. };
  1750. /** Built-in method references without a dependency on `root`. */
  1751. var freeParseFloat = parseFloat,
  1752. freeParseInt = parseInt;
  1753. /** Detect free variable `global` from Node.js. */
  1754. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1755. /** Detect free variable `self`. */
  1756. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1757. /** Used as a reference to the global object. */
  1758. var root = freeGlobal || freeSelf || Function('return this')();
  1759. /** Detect free variable `exports`. */
  1760. var freeExports = true && exports && !exports.nodeType && exports;
  1761. /** Detect free variable `module`. */
  1762. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1763. /** Detect the popular CommonJS extension `module.exports`. */
  1764. var moduleExports = freeModule && freeModule.exports === freeExports;
  1765. /** Detect free variable `process` from Node.js. */
  1766. var freeProcess = moduleExports && freeGlobal.process;
  1767. /** Used to access faster Node.js helpers. */
  1768. var nodeUtil = (function() {
  1769. try {
  1770. // Use `util.types` for Node.js 10+.
  1771. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1772. if (types) {
  1773. return types;
  1774. }
  1775. // Legacy `process.binding('util')` for Node.js < 10.
  1776. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1777. } catch (e) {}
  1778. }());
  1779. /* Node.js helper references. */
  1780. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1781. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1782. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1783. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1784. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1785. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1786. /*--------------------------------------------------------------------------*/
  1787. /**
  1788. * A faster alternative to `Function#apply`, this function invokes `func`
  1789. * with the `this` binding of `thisArg` and the arguments of `args`.
  1790. *
  1791. * @private
  1792. * @param {Function} func The function to invoke.
  1793. * @param {*} thisArg The `this` binding of `func`.
  1794. * @param {Array} args The arguments to invoke `func` with.
  1795. * @returns {*} Returns the result of `func`.
  1796. */
  1797. function apply(func, thisArg, args) {
  1798. switch (args.length) {
  1799. case 0: return func.call(thisArg);
  1800. case 1: return func.call(thisArg, args[0]);
  1801. case 2: return func.call(thisArg, args[0], args[1]);
  1802. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1803. }
  1804. return func.apply(thisArg, args);
  1805. }
  1806. /**
  1807. * A specialized version of `baseAggregator` for arrays.
  1808. *
  1809. * @private
  1810. * @param {Array} [array] The array to iterate over.
  1811. * @param {Function} setter The function to set `accumulator` values.
  1812. * @param {Function} iteratee The iteratee to transform keys.
  1813. * @param {Object} accumulator The initial aggregated object.
  1814. * @returns {Function} Returns `accumulator`.
  1815. */
  1816. function arrayAggregator(array, setter, iteratee, accumulator) {
  1817. var index = -1,
  1818. length = array == null ? 0 : array.length;
  1819. while (++index < length) {
  1820. var value = array[index];
  1821. setter(accumulator, value, iteratee(value), array);
  1822. }
  1823. return accumulator;
  1824. }
  1825. /**
  1826. * A specialized version of `_.forEach` for arrays without support for
  1827. * iteratee shorthands.
  1828. *
  1829. * @private
  1830. * @param {Array} [array] The array to iterate over.
  1831. * @param {Function} iteratee The function invoked per iteration.
  1832. * @returns {Array} Returns `array`.
  1833. */
  1834. function arrayEach(array, iteratee) {
  1835. var index = -1,
  1836. length = array == null ? 0 : array.length;
  1837. while (++index < length) {
  1838. if (iteratee(array[index], index, array) === false) {
  1839. break;
  1840. }
  1841. }
  1842. return array;
  1843. }
  1844. /**
  1845. * A specialized version of `_.forEachRight` for arrays without support for
  1846. * iteratee shorthands.
  1847. *
  1848. * @private
  1849. * @param {Array} [array] The array to iterate over.
  1850. * @param {Function} iteratee The function invoked per iteration.
  1851. * @returns {Array} Returns `array`.
  1852. */
  1853. function arrayEachRight(array, iteratee) {
  1854. var length = array == null ? 0 : array.length;
  1855. while (length--) {
  1856. if (iteratee(array[length], length, array) === false) {
  1857. break;
  1858. }
  1859. }
  1860. return array;
  1861. }
  1862. /**
  1863. * A specialized version of `_.every` for arrays without support for
  1864. * iteratee 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 all elements pass the predicate check,
  1870. * else `false`.
  1871. */
  1872. function arrayEvery(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 false;
  1878. }
  1879. }
  1880. return true;
  1881. }
  1882. /**
  1883. * A specialized version of `_.filter` for arrays without support for
  1884. * iteratee shorthands.
  1885. *
  1886. * @private
  1887. * @param {Array} [array] The array to iterate over.
  1888. * @param {Function} predicate The function invoked per iteration.
  1889. * @returns {Array} Returns the new filtered array.
  1890. */
  1891. function arrayFilter(array, predicate) {
  1892. var index = -1,
  1893. length = array == null ? 0 : array.length,
  1894. resIndex = 0,
  1895. result = [];
  1896. while (++index < length) {
  1897. var value = array[index];
  1898. if (predicate(value, index, array)) {
  1899. result[resIndex++] = value;
  1900. }
  1901. }
  1902. return result;
  1903. }
  1904. /**
  1905. * A specialized version of `_.includes` for arrays without support for
  1906. * specifying an index to search from.
  1907. *
  1908. * @private
  1909. * @param {Array} [array] The array to inspect.
  1910. * @param {*} target The value to search for.
  1911. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1912. */
  1913. function arrayIncludes(array, value) {
  1914. var length = array == null ? 0 : array.length;
  1915. return !!length && baseIndexOf(array, value, 0) > -1;
  1916. }
  1917. /**
  1918. * This function is like `arrayIncludes` except that it accepts a comparator.
  1919. *
  1920. * @private
  1921. * @param {Array} [array] The array to inspect.
  1922. * @param {*} target The value to search for.
  1923. * @param {Function} comparator The comparator invoked per element.
  1924. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1925. */
  1926. function arrayIncludesWith(array, value, comparator) {
  1927. var index = -1,
  1928. length = array == null ? 0 : array.length;
  1929. while (++index < length) {
  1930. if (comparator(value, array[index])) {
  1931. return true;
  1932. }
  1933. }
  1934. return false;
  1935. }
  1936. /**
  1937. * A specialized version of `_.map` for arrays without support for iteratee
  1938. * shorthands.
  1939. *
  1940. * @private
  1941. * @param {Array} [array] The array to iterate over.
  1942. * @param {Function} iteratee The function invoked per iteration.
  1943. * @returns {Array} Returns the new mapped array.
  1944. */
  1945. function arrayMap(array, iteratee) {
  1946. var index = -1,
  1947. length = array == null ? 0 : array.length,
  1948. result = Array(length);
  1949. while (++index < length) {
  1950. result[index] = iteratee(array[index], index, array);
  1951. }
  1952. return result;
  1953. }
  1954. /**
  1955. * Appends the elements of `values` to `array`.
  1956. *
  1957. * @private
  1958. * @param {Array} array The array to modify.
  1959. * @param {Array} values The values to append.
  1960. * @returns {Array} Returns `array`.
  1961. */
  1962. function arrayPush(array, values) {
  1963. var index = -1,
  1964. length = values.length,
  1965. offset = array.length;
  1966. while (++index < length) {
  1967. array[offset + index] = values[index];
  1968. }
  1969. return array;
  1970. }
  1971. /**
  1972. * A specialized version of `_.reduce` for arrays without support for
  1973. * iteratee shorthands.
  1974. *
  1975. * @private
  1976. * @param {Array} [array] The array to iterate over.
  1977. * @param {Function} iteratee The function invoked per iteration.
  1978. * @param {*} [accumulator] The initial value.
  1979. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1980. * the initial value.
  1981. * @returns {*} Returns the accumulated value.
  1982. */
  1983. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1984. var index = -1,
  1985. length = array == null ? 0 : array.length;
  1986. if (initAccum && length) {
  1987. accumulator = array[++index];
  1988. }
  1989. while (++index < length) {
  1990. accumulator = iteratee(accumulator, array[index], index, array);
  1991. }
  1992. return accumulator;
  1993. }
  1994. /**
  1995. * A specialized version of `_.reduceRight` for arrays without support for
  1996. * iteratee shorthands.
  1997. *
  1998. * @private
  1999. * @param {Array} [array] The array to iterate over.
  2000. * @param {Function} iteratee The function invoked per iteration.
  2001. * @param {*} [accumulator] The initial value.
  2002. * @param {boolean} [initAccum] Specify using the last element of `array` as
  2003. * the initial value.
  2004. * @returns {*} Returns the accumulated value.
  2005. */
  2006. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  2007. var length = array == null ? 0 : array.length;
  2008. if (initAccum && length) {
  2009. accumulator = array[--length];
  2010. }
  2011. while (length--) {
  2012. accumulator = iteratee(accumulator, array[length], length, array);
  2013. }
  2014. return accumulator;
  2015. }
  2016. /**
  2017. * A specialized version of `_.some` for arrays without support for iteratee
  2018. * shorthands.
  2019. *
  2020. * @private
  2021. * @param {Array} [array] The array to iterate over.
  2022. * @param {Function} predicate The function invoked per iteration.
  2023. * @returns {boolean} Returns `true` if any element passes the predicate check,
  2024. * else `false`.
  2025. */
  2026. function arraySome(array, predicate) {
  2027. var index = -1,
  2028. length = array == null ? 0 : array.length;
  2029. while (++index < length) {
  2030. if (predicate(array[index], index, array)) {
  2031. return true;
  2032. }
  2033. }
  2034. return false;
  2035. }
  2036. /**
  2037. * Gets the size of an ASCII `string`.
  2038. *
  2039. * @private
  2040. * @param {string} string The string inspect.
  2041. * @returns {number} Returns the string size.
  2042. */
  2043. var asciiSize = baseProperty('length');
  2044. /**
  2045. * Converts an ASCII `string` to an array.
  2046. *
  2047. * @private
  2048. * @param {string} string The string to convert.
  2049. * @returns {Array} Returns the converted array.
  2050. */
  2051. function asciiToArray(string) {
  2052. return string.split('');
  2053. }
  2054. /**
  2055. * Splits an ASCII `string` into an array of its words.
  2056. *
  2057. * @private
  2058. * @param {string} The string to inspect.
  2059. * @returns {Array} Returns the words of `string`.
  2060. */
  2061. function asciiWords(string) {
  2062. return string.match(reAsciiWord) || [];
  2063. }
  2064. /**
  2065. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2066. * without support for iteratee shorthands, which iterates over `collection`
  2067. * using `eachFunc`.
  2068. *
  2069. * @private
  2070. * @param {Array|Object} collection The collection to inspect.
  2071. * @param {Function} predicate The function invoked per iteration.
  2072. * @param {Function} eachFunc The function to iterate over `collection`.
  2073. * @returns {*} Returns the found element or its key, else `undefined`.
  2074. */
  2075. function baseFindKey(collection, predicate, eachFunc) {
  2076. var result;
  2077. eachFunc(collection, function(value, key, collection) {
  2078. if (predicate(value, key, collection)) {
  2079. result = key;
  2080. return false;
  2081. }
  2082. });
  2083. return result;
  2084. }
  2085. /**
  2086. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2087. * support for iteratee shorthands.
  2088. *
  2089. * @private
  2090. * @param {Array} array The array to inspect.
  2091. * @param {Function} predicate The function invoked per iteration.
  2092. * @param {number} fromIndex The index to search from.
  2093. * @param {boolean} [fromRight] Specify iterating from right to left.
  2094. * @returns {number} Returns the index of the matched value, else `-1`.
  2095. */
  2096. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2097. var length = array.length,
  2098. index = fromIndex + (fromRight ? 1 : -1);
  2099. while ((fromRight ? index-- : ++index < length)) {
  2100. if (predicate(array[index], index, array)) {
  2101. return index;
  2102. }
  2103. }
  2104. return -1;
  2105. }
  2106. /**
  2107. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2108. *
  2109. * @private
  2110. * @param {Array} array The array to inspect.
  2111. * @param {*} value The value to search for.
  2112. * @param {number} fromIndex The index to search from.
  2113. * @returns {number} Returns the index of the matched value, else `-1`.
  2114. */
  2115. function baseIndexOf(array, value, fromIndex) {
  2116. return value === value
  2117. ? strictIndexOf(array, value, fromIndex)
  2118. : baseFindIndex(array, baseIsNaN, fromIndex);
  2119. }
  2120. /**
  2121. * This function is like `baseIndexOf` except that it accepts a comparator.
  2122. *
  2123. * @private
  2124. * @param {Array} array The array to inspect.
  2125. * @param {*} value The value to search for.
  2126. * @param {number} fromIndex The index to search from.
  2127. * @param {Function} comparator The comparator invoked per element.
  2128. * @returns {number} Returns the index of the matched value, else `-1`.
  2129. */
  2130. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2131. var index = fromIndex - 1,
  2132. length = array.length;
  2133. while (++index < length) {
  2134. if (comparator(array[index], value)) {
  2135. return index;
  2136. }
  2137. }
  2138. return -1;
  2139. }
  2140. /**
  2141. * The base implementation of `_.isNaN` without support for number objects.
  2142. *
  2143. * @private
  2144. * @param {*} value The value to check.
  2145. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2146. */
  2147. function baseIsNaN(value) {
  2148. return value !== value;
  2149. }
  2150. /**
  2151. * The base implementation of `_.mean` and `_.meanBy` without support for
  2152. * iteratee shorthands.
  2153. *
  2154. * @private
  2155. * @param {Array} array The array to iterate over.
  2156. * @param {Function} iteratee The function invoked per iteration.
  2157. * @returns {number} Returns the mean.
  2158. */
  2159. function baseMean(array, iteratee) {
  2160. var length = array == null ? 0 : array.length;
  2161. return length ? (baseSum(array, iteratee) / length) : NAN;
  2162. }
  2163. /**
  2164. * The base implementation of `_.property` without support for deep paths.
  2165. *
  2166. * @private
  2167. * @param {string} key The key of the property to get.
  2168. * @returns {Function} Returns the new accessor function.
  2169. */
  2170. function baseProperty(key) {
  2171. return function(object) {
  2172. return object == null ? undefined : object[key];
  2173. };
  2174. }
  2175. /**
  2176. * The base implementation of `_.propertyOf` without support for deep paths.
  2177. *
  2178. * @private
  2179. * @param {Object} object The object to query.
  2180. * @returns {Function} Returns the new accessor function.
  2181. */
  2182. function basePropertyOf(object) {
  2183. return function(key) {
  2184. return object == null ? undefined : object[key];
  2185. };
  2186. }
  2187. /**
  2188. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2189. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2190. *
  2191. * @private
  2192. * @param {Array|Object} collection The collection to iterate over.
  2193. * @param {Function} iteratee The function invoked per iteration.
  2194. * @param {*} accumulator The initial value.
  2195. * @param {boolean} initAccum Specify using the first or last element of
  2196. * `collection` as the initial value.
  2197. * @param {Function} eachFunc The function to iterate over `collection`.
  2198. * @returns {*} Returns the accumulated value.
  2199. */
  2200. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2201. eachFunc(collection, function(value, index, collection) {
  2202. accumulator = initAccum
  2203. ? (initAccum = false, value)
  2204. : iteratee(accumulator, value, index, collection);
  2205. });
  2206. return accumulator;
  2207. }
  2208. /**
  2209. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2210. * sort order of `array` and replaces criteria objects with their corresponding
  2211. * values.
  2212. *
  2213. * @private
  2214. * @param {Array} array The array to sort.
  2215. * @param {Function} comparer The function to define sort order.
  2216. * @returns {Array} Returns `array`.
  2217. */
  2218. function baseSortBy(array, comparer) {
  2219. var length = array.length;
  2220. array.sort(comparer);
  2221. while (length--) {
  2222. array[length] = array[length].value;
  2223. }
  2224. return array;
  2225. }
  2226. /**
  2227. * The base implementation of `_.sum` and `_.sumBy` without support for
  2228. * iteratee shorthands.
  2229. *
  2230. * @private
  2231. * @param {Array} array The array to iterate over.
  2232. * @param {Function} iteratee The function invoked per iteration.
  2233. * @returns {number} Returns the sum.
  2234. */
  2235. function baseSum(array, iteratee) {
  2236. var result,
  2237. index = -1,
  2238. length = array.length;
  2239. while (++index < length) {
  2240. var current = iteratee(array[index]);
  2241. if (current !== undefined) {
  2242. result = result === undefined ? current : (result + current);
  2243. }
  2244. }
  2245. return result;
  2246. }
  2247. /**
  2248. * The base implementation of `_.times` without support for iteratee shorthands
  2249. * or max array length checks.
  2250. *
  2251. * @private
  2252. * @param {number} n The number of times to invoke `iteratee`.
  2253. * @param {Function} iteratee The function invoked per iteration.
  2254. * @returns {Array} Returns the array of results.
  2255. */
  2256. function baseTimes(n, iteratee) {
  2257. var index = -1,
  2258. result = Array(n);
  2259. while (++index < n) {
  2260. result[index] = iteratee(index);
  2261. }
  2262. return result;
  2263. }
  2264. /**
  2265. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2266. * of key-value pairs for `object` corresponding to the property names of `props`.
  2267. *
  2268. * @private
  2269. * @param {Object} object The object to query.
  2270. * @param {Array} props The property names to get values for.
  2271. * @returns {Object} Returns the key-value pairs.
  2272. */
  2273. function baseToPairs(object, props) {
  2274. return arrayMap(props, function(key) {
  2275. return [key, object[key]];
  2276. });
  2277. }
  2278. /**
  2279. * The base implementation of `_.trim`.
  2280. *
  2281. * @private
  2282. * @param {string} string The string to trim.
  2283. * @returns {string} Returns the trimmed string.
  2284. */
  2285. function baseTrim(string) {
  2286. return string
  2287. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2288. : string;
  2289. }
  2290. /**
  2291. * The base implementation of `_.unary` without support for storing metadata.
  2292. *
  2293. * @private
  2294. * @param {Function} func The function to cap arguments for.
  2295. * @returns {Function} Returns the new capped function.
  2296. */
  2297. function baseUnary(func) {
  2298. return function(value) {
  2299. return func(value);
  2300. };
  2301. }
  2302. /**
  2303. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2304. * array of `object` property values corresponding to the property names
  2305. * of `props`.
  2306. *
  2307. * @private
  2308. * @param {Object} object The object to query.
  2309. * @param {Array} props The property names to get values for.
  2310. * @returns {Object} Returns the array of property values.
  2311. */
  2312. function baseValues(object, props) {
  2313. return arrayMap(props, function(key) {
  2314. return object[key];
  2315. });
  2316. }
  2317. /**
  2318. * Checks if a `cache` value for `key` exists.
  2319. *
  2320. * @private
  2321. * @param {Object} cache The cache to query.
  2322. * @param {string} key The key of the entry to check.
  2323. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2324. */
  2325. function cacheHas(cache, key) {
  2326. return cache.has(key);
  2327. }
  2328. /**
  2329. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2330. * that is not found in the character symbols.
  2331. *
  2332. * @private
  2333. * @param {Array} strSymbols The string symbols to inspect.
  2334. * @param {Array} chrSymbols The character symbols to find.
  2335. * @returns {number} Returns the index of the first unmatched string symbol.
  2336. */
  2337. function charsStartIndex(strSymbols, chrSymbols) {
  2338. var index = -1,
  2339. length = strSymbols.length;
  2340. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2341. return index;
  2342. }
  2343. /**
  2344. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2345. * that is not found in the character symbols.
  2346. *
  2347. * @private
  2348. * @param {Array} strSymbols The string symbols to inspect.
  2349. * @param {Array} chrSymbols The character symbols to find.
  2350. * @returns {number} Returns the index of the last unmatched string symbol.
  2351. */
  2352. function charsEndIndex(strSymbols, chrSymbols) {
  2353. var index = strSymbols.length;
  2354. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2355. return index;
  2356. }
  2357. /**
  2358. * Gets the number of `placeholder` occurrences in `array`.
  2359. *
  2360. * @private
  2361. * @param {Array} array The array to inspect.
  2362. * @param {*} placeholder The placeholder to search for.
  2363. * @returns {number} Returns the placeholder count.
  2364. */
  2365. function countHolders(array, placeholder) {
  2366. var length = array.length,
  2367. result = 0;
  2368. while (length--) {
  2369. if (array[length] === placeholder) {
  2370. ++result;
  2371. }
  2372. }
  2373. return result;
  2374. }
  2375. /**
  2376. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2377. * letters to basic Latin letters.
  2378. *
  2379. * @private
  2380. * @param {string} letter The matched letter to deburr.
  2381. * @returns {string} Returns the deburred letter.
  2382. */
  2383. var deburrLetter = basePropertyOf(deburredLetters);
  2384. /**
  2385. * Used by `_.escape` to convert characters to HTML entities.
  2386. *
  2387. * @private
  2388. * @param {string} chr The matched character to escape.
  2389. * @returns {string} Returns the escaped character.
  2390. */
  2391. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2392. /**
  2393. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2394. *
  2395. * @private
  2396. * @param {string} chr The matched character to escape.
  2397. * @returns {string} Returns the escaped character.
  2398. */
  2399. function escapeStringChar(chr) {
  2400. return '\\' + stringEscapes[chr];
  2401. }
  2402. /**
  2403. * Gets the value at `key` of `object`.
  2404. *
  2405. * @private
  2406. * @param {Object} [object] The object to query.
  2407. * @param {string} key The key of the property to get.
  2408. * @returns {*} Returns the property value.
  2409. */
  2410. function getValue(object, key) {
  2411. return object == null ? undefined : object[key];
  2412. }
  2413. /**
  2414. * Checks if `string` contains Unicode symbols.
  2415. *
  2416. * @private
  2417. * @param {string} string The string to inspect.
  2418. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2419. */
  2420. function hasUnicode(string) {
  2421. return reHasUnicode.test(string);
  2422. }
  2423. /**
  2424. * Checks if `string` contains a word composed of Unicode symbols.
  2425. *
  2426. * @private
  2427. * @param {string} string The string to inspect.
  2428. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2429. */
  2430. function hasUnicodeWord(string) {
  2431. return reHasUnicodeWord.test(string);
  2432. }
  2433. /**
  2434. * Converts `iterator` to an array.
  2435. *
  2436. * @private
  2437. * @param {Object} iterator The iterator to convert.
  2438. * @returns {Array} Returns the converted array.
  2439. */
  2440. function iteratorToArray(iterator) {
  2441. var data,
  2442. result = [];
  2443. while (!(data = iterator.next()).done) {
  2444. result.push(data.value);
  2445. }
  2446. return result;
  2447. }
  2448. /**
  2449. * Converts `map` to its key-value pairs.
  2450. *
  2451. * @private
  2452. * @param {Object} map The map to convert.
  2453. * @returns {Array} Returns the key-value pairs.
  2454. */
  2455. function mapToArray(map) {
  2456. var index = -1,
  2457. result = Array(map.size);
  2458. map.forEach(function(value, key) {
  2459. result[++index] = [key, value];
  2460. });
  2461. return result;
  2462. }
  2463. /**
  2464. * Creates a unary function that invokes `func` with its argument transformed.
  2465. *
  2466. * @private
  2467. * @param {Function} func The function to wrap.
  2468. * @param {Function} transform The argument transform.
  2469. * @returns {Function} Returns the new function.
  2470. */
  2471. function overArg(func, transform) {
  2472. return function(arg) {
  2473. return func(transform(arg));
  2474. };
  2475. }
  2476. /**
  2477. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2478. * and returns an array of their indexes.
  2479. *
  2480. * @private
  2481. * @param {Array} array The array to modify.
  2482. * @param {*} placeholder The placeholder to replace.
  2483. * @returns {Array} Returns the new array of placeholder indexes.
  2484. */
  2485. function replaceHolders(array, placeholder) {
  2486. var index = -1,
  2487. length = array.length,
  2488. resIndex = 0,
  2489. result = [];
  2490. while (++index < length) {
  2491. var value = array[index];
  2492. if (value === placeholder || value === PLACEHOLDER) {
  2493. array[index] = PLACEHOLDER;
  2494. result[resIndex++] = index;
  2495. }
  2496. }
  2497. return result;
  2498. }
  2499. /**
  2500. * Converts `set` to an array of its values.
  2501. *
  2502. * @private
  2503. * @param {Object} set The set to convert.
  2504. * @returns {Array} Returns the values.
  2505. */
  2506. function setToArray(set) {
  2507. var index = -1,
  2508. result = Array(set.size);
  2509. set.forEach(function(value) {
  2510. result[++index] = value;
  2511. });
  2512. return result;
  2513. }
  2514. /**
  2515. * Converts `set` to its value-value pairs.
  2516. *
  2517. * @private
  2518. * @param {Object} set The set to convert.
  2519. * @returns {Array} Returns the value-value pairs.
  2520. */
  2521. function setToPairs(set) {
  2522. var index = -1,
  2523. result = Array(set.size);
  2524. set.forEach(function(value) {
  2525. result[++index] = [value, value];
  2526. });
  2527. return result;
  2528. }
  2529. /**
  2530. * A specialized version of `_.indexOf` which performs strict equality
  2531. * comparisons of values, i.e. `===`.
  2532. *
  2533. * @private
  2534. * @param {Array} array The array to inspect.
  2535. * @param {*} value The value to search for.
  2536. * @param {number} fromIndex The index to search from.
  2537. * @returns {number} Returns the index of the matched value, else `-1`.
  2538. */
  2539. function strictIndexOf(array, value, fromIndex) {
  2540. var index = fromIndex - 1,
  2541. length = array.length;
  2542. while (++index < length) {
  2543. if (array[index] === value) {
  2544. return index;
  2545. }
  2546. }
  2547. return -1;
  2548. }
  2549. /**
  2550. * A specialized version of `_.lastIndexOf` which performs strict equality
  2551. * comparisons of values, i.e. `===`.
  2552. *
  2553. * @private
  2554. * @param {Array} array The array to inspect.
  2555. * @param {*} value The value to search for.
  2556. * @param {number} fromIndex The index to search from.
  2557. * @returns {number} Returns the index of the matched value, else `-1`.
  2558. */
  2559. function strictLastIndexOf(array, value, fromIndex) {
  2560. var index = fromIndex + 1;
  2561. while (index--) {
  2562. if (array[index] === value) {
  2563. return index;
  2564. }
  2565. }
  2566. return index;
  2567. }
  2568. /**
  2569. * Gets the number of symbols in `string`.
  2570. *
  2571. * @private
  2572. * @param {string} string The string to inspect.
  2573. * @returns {number} Returns the string size.
  2574. */
  2575. function stringSize(string) {
  2576. return hasUnicode(string)
  2577. ? unicodeSize(string)
  2578. : asciiSize(string);
  2579. }
  2580. /**
  2581. * Converts `string` to an array.
  2582. *
  2583. * @private
  2584. * @param {string} string The string to convert.
  2585. * @returns {Array} Returns the converted array.
  2586. */
  2587. function stringToArray(string) {
  2588. return hasUnicode(string)
  2589. ? unicodeToArray(string)
  2590. : asciiToArray(string);
  2591. }
  2592. /**
  2593. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2594. * character of `string`.
  2595. *
  2596. * @private
  2597. * @param {string} string The string to inspect.
  2598. * @returns {number} Returns the index of the last non-whitespace character.
  2599. */
  2600. function trimmedEndIndex(string) {
  2601. var index = string.length;
  2602. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2603. return index;
  2604. }
  2605. /**
  2606. * Used by `_.unescape` to convert HTML entities to characters.
  2607. *
  2608. * @private
  2609. * @param {string} chr The matched character to unescape.
  2610. * @returns {string} Returns the unescaped character.
  2611. */
  2612. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2613. /**
  2614. * Gets the size of a Unicode `string`.
  2615. *
  2616. * @private
  2617. * @param {string} string The string inspect.
  2618. * @returns {number} Returns the string size.
  2619. */
  2620. function unicodeSize(string) {
  2621. var result = reUnicode.lastIndex = 0;
  2622. while (reUnicode.test(string)) {
  2623. ++result;
  2624. }
  2625. return result;
  2626. }
  2627. /**
  2628. * Converts a Unicode `string` to an array.
  2629. *
  2630. * @private
  2631. * @param {string} string The string to convert.
  2632. * @returns {Array} Returns the converted array.
  2633. */
  2634. function unicodeToArray(string) {
  2635. return string.match(reUnicode) || [];
  2636. }
  2637. /**
  2638. * Splits a Unicode `string` into an array of its words.
  2639. *
  2640. * @private
  2641. * @param {string} The string to inspect.
  2642. * @returns {Array} Returns the words of `string`.
  2643. */
  2644. function unicodeWords(string) {
  2645. return string.match(reUnicodeWord) || [];
  2646. }
  2647. /*--------------------------------------------------------------------------*/
  2648. /**
  2649. * Create a new pristine `lodash` function using the `context` object.
  2650. *
  2651. * @static
  2652. * @memberOf _
  2653. * @since 1.1.0
  2654. * @category Util
  2655. * @param {Object} [context=root] The context object.
  2656. * @returns {Function} Returns a new `lodash` function.
  2657. * @example
  2658. *
  2659. * _.mixin({ 'foo': _.constant('foo') });
  2660. *
  2661. * var lodash = _.runInContext();
  2662. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2663. *
  2664. * _.isFunction(_.foo);
  2665. * // => true
  2666. * _.isFunction(_.bar);
  2667. * // => false
  2668. *
  2669. * lodash.isFunction(lodash.foo);
  2670. * // => false
  2671. * lodash.isFunction(lodash.bar);
  2672. * // => true
  2673. *
  2674. * // Create a suped-up `defer` in Node.js.
  2675. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2676. */
  2677. var runInContext = (function runInContext(context) {
  2678. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2679. /** Built-in constructor references. */
  2680. var Array = context.Array,
  2681. Date = context.Date,
  2682. Error = context.Error,
  2683. Function = context.Function,
  2684. Math = context.Math,
  2685. Object = context.Object,
  2686. RegExp = context.RegExp,
  2687. String = context.String,
  2688. TypeError = context.TypeError;
  2689. /** Used for built-in method references. */
  2690. var arrayProto = Array.prototype,
  2691. funcProto = Function.prototype,
  2692. objectProto = Object.prototype;
  2693. /** Used to detect overreaching core-js shims. */
  2694. var coreJsData = context['__core-js_shared__'];
  2695. /** Used to resolve the decompiled source of functions. */
  2696. var funcToString = funcProto.toString;
  2697. /** Used to check objects for own properties. */
  2698. var hasOwnProperty = objectProto.hasOwnProperty;
  2699. /** Used to generate unique IDs. */
  2700. var idCounter = 0;
  2701. /** Used to detect methods masquerading as native. */
  2702. var maskSrcKey = (function() {
  2703. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2704. return uid ? ('Symbol(src)_1.' + uid) : '';
  2705. }());
  2706. /**
  2707. * Used to resolve the
  2708. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2709. * of values.
  2710. */
  2711. var nativeObjectToString = objectProto.toString;
  2712. /** Used to infer the `Object` constructor. */
  2713. var objectCtorString = funcToString.call(Object);
  2714. /** Used to restore the original `_` reference in `_.noConflict`. */
  2715. var oldDash = root._;
  2716. /** Used to detect if a method is native. */
  2717. var reIsNative = RegExp('^' +
  2718. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2719. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2720. );
  2721. /** Built-in value references. */
  2722. var Buffer = moduleExports ? context.Buffer : undefined,
  2723. Symbol = context.Symbol,
  2724. Uint8Array = context.Uint8Array,
  2725. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2726. getPrototype = overArg(Object.getPrototypeOf, Object),
  2727. objectCreate = Object.create,
  2728. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2729. splice = arrayProto.splice,
  2730. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2731. symIterator = Symbol ? Symbol.iterator : undefined,
  2732. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2733. var defineProperty = (function() {
  2734. try {
  2735. var func = getNative(Object, 'defineProperty');
  2736. func({}, '', {});
  2737. return func;
  2738. } catch (e) {}
  2739. }());
  2740. /** Mocked built-ins. */
  2741. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2742. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2743. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2744. /* Built-in method references for those with the same name as other `lodash` methods. */
  2745. var nativeCeil = Math.ceil,
  2746. nativeFloor = Math.floor,
  2747. nativeGetSymbols = Object.getOwnPropertySymbols,
  2748. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2749. nativeIsFinite = context.isFinite,
  2750. nativeJoin = arrayProto.join,
  2751. nativeKeys = overArg(Object.keys, Object),
  2752. nativeMax = Math.max,
  2753. nativeMin = Math.min,
  2754. nativeNow = Date.now,
  2755. nativeParseInt = context.parseInt,
  2756. nativeRandom = Math.random,
  2757. nativeReverse = arrayProto.reverse;
  2758. /* Built-in method references that are verified to be native. */
  2759. var DataView = getNative(context, 'DataView'),
  2760. Map = getNative(context, 'Map'),
  2761. Promise = getNative(context, 'Promise'),
  2762. Set = getNative(context, 'Set'),
  2763. WeakMap = getNative(context, 'WeakMap'),
  2764. nativeCreate = getNative(Object, 'create');
  2765. /** Used to store function metadata. */
  2766. var metaMap = WeakMap && new WeakMap;
  2767. /** Used to lookup unminified function names. */
  2768. var realNames = {};
  2769. /** Used to detect maps, sets, and weakmaps. */
  2770. var dataViewCtorString = toSource(DataView),
  2771. mapCtorString = toSource(Map),
  2772. promiseCtorString = toSource(Promise),
  2773. setCtorString = toSource(Set),
  2774. weakMapCtorString = toSource(WeakMap);
  2775. /** Used to convert symbols to primitives and strings. */
  2776. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2777. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2778. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2779. /*------------------------------------------------------------------------*/
  2780. /**
  2781. * Creates a `lodash` object which wraps `value` to enable implicit method
  2782. * chain sequences. Methods that operate on and return arrays, collections,
  2783. * and functions can be chained together. Methods that retrieve a single value
  2784. * or may return a primitive value will automatically end the chain sequence
  2785. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2786. * with `_#value`.
  2787. *
  2788. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2789. * enabled using `_.chain`.
  2790. *
  2791. * The execution of chained methods is lazy, that is, it's deferred until
  2792. * `_#value` is implicitly or explicitly called.
  2793. *
  2794. * Lazy evaluation allows several methods to support shortcut fusion.
  2795. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2796. * the creation of intermediate arrays and can greatly reduce the number of
  2797. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2798. * fusion if the section is applied to an array and iteratees accept only
  2799. * one argument. The heuristic for whether a section qualifies for shortcut
  2800. * fusion is subject to change.
  2801. *
  2802. * Chaining is supported in custom builds as long as the `_#value` method is
  2803. * directly or indirectly included in the build.
  2804. *
  2805. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2806. *
  2807. * The wrapper `Array` methods are:
  2808. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2809. *
  2810. * The wrapper `String` methods are:
  2811. * `replace` and `split`
  2812. *
  2813. * The wrapper methods that support shortcut fusion are:
  2814. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2815. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2816. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2817. *
  2818. * The chainable wrapper methods are:
  2819. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2820. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2821. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2822. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2823. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2824. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2825. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2826. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2827. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2828. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2829. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2830. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2831. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2832. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2833. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2834. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2835. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2836. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2837. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2838. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2839. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2840. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2841. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2842. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2843. *
  2844. * The wrapper methods that are **not** chainable by default are:
  2845. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2846. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2847. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2848. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2849. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2850. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2851. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2852. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2853. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2854. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2855. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2856. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2857. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2858. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2859. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2860. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2861. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2862. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2863. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2864. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2865. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2866. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2867. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2868. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2869. * `upperFirst`, `value`, and `words`
  2870. *
  2871. * @name _
  2872. * @constructor
  2873. * @category Seq
  2874. * @param {*} value The value to wrap in a `lodash` instance.
  2875. * @returns {Object} Returns the new `lodash` wrapper instance.
  2876. * @example
  2877. *
  2878. * function square(n) {
  2879. * return n * n;
  2880. * }
  2881. *
  2882. * var wrapped = _([1, 2, 3]);
  2883. *
  2884. * // Returns an unwrapped value.
  2885. * wrapped.reduce(_.add);
  2886. * // => 6
  2887. *
  2888. * // Returns a wrapped value.
  2889. * var squares = wrapped.map(square);
  2890. *
  2891. * _.isArray(squares);
  2892. * // => false
  2893. *
  2894. * _.isArray(squares.value());
  2895. * // => true
  2896. */
  2897. function lodash(value) {
  2898. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2899. if (value instanceof LodashWrapper) {
  2900. return value;
  2901. }
  2902. if (hasOwnProperty.call(value, '__wrapped__')) {
  2903. return wrapperClone(value);
  2904. }
  2905. }
  2906. return new LodashWrapper(value);
  2907. }
  2908. /**
  2909. * The base implementation of `_.create` without support for assigning
  2910. * properties to the created object.
  2911. *
  2912. * @private
  2913. * @param {Object} proto The object to inherit from.
  2914. * @returns {Object} Returns the new object.
  2915. */
  2916. var baseCreate = (function() {
  2917. function object() {}
  2918. return function(proto) {
  2919. if (!isObject(proto)) {
  2920. return {};
  2921. }
  2922. if (objectCreate) {
  2923. return objectCreate(proto);
  2924. }
  2925. object.prototype = proto;
  2926. var result = new object;
  2927. object.prototype = undefined;
  2928. return result;
  2929. };
  2930. }());
  2931. /**
  2932. * The function whose prototype chain sequence wrappers inherit from.
  2933. *
  2934. * @private
  2935. */
  2936. function baseLodash() {
  2937. // No operation performed.
  2938. }
  2939. /**
  2940. * The base constructor for creating `lodash` wrapper objects.
  2941. *
  2942. * @private
  2943. * @param {*} value The value to wrap.
  2944. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2945. */
  2946. function LodashWrapper(value, chainAll) {
  2947. this.__wrapped__ = value;
  2948. this.__actions__ = [];
  2949. this.__chain__ = !!chainAll;
  2950. this.__index__ = 0;
  2951. this.__values__ = undefined;
  2952. }
  2953. /**
  2954. * By default, the template delimiters used by lodash are like those in
  2955. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2956. * following template settings to use alternative delimiters.
  2957. *
  2958. * @static
  2959. * @memberOf _
  2960. * @type {Object}
  2961. */
  2962. lodash.templateSettings = {
  2963. /**
  2964. * Used to detect `data` property values to be HTML-escaped.
  2965. *
  2966. * @memberOf _.templateSettings
  2967. * @type {RegExp}
  2968. */
  2969. 'escape': reEscape,
  2970. /**
  2971. * Used to detect code to be evaluated.
  2972. *
  2973. * @memberOf _.templateSettings
  2974. * @type {RegExp}
  2975. */
  2976. 'evaluate': reEvaluate,
  2977. /**
  2978. * Used to detect `data` property values to inject.
  2979. *
  2980. * @memberOf _.templateSettings
  2981. * @type {RegExp}
  2982. */
  2983. 'interpolate': reInterpolate,
  2984. /**
  2985. * Used to reference the data object in the template text.
  2986. *
  2987. * @memberOf _.templateSettings
  2988. * @type {string}
  2989. */
  2990. 'variable': '',
  2991. /**
  2992. * Used to import variables into the compiled template.
  2993. *
  2994. * @memberOf _.templateSettings
  2995. * @type {Object}
  2996. */
  2997. 'imports': {
  2998. /**
  2999. * A reference to the `lodash` function.
  3000. *
  3001. * @memberOf _.templateSettings.imports
  3002. * @type {Function}
  3003. */
  3004. '_': lodash
  3005. }
  3006. };
  3007. // Ensure wrappers are instances of `baseLodash`.
  3008. lodash.prototype = baseLodash.prototype;
  3009. lodash.prototype.constructor = lodash;
  3010. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  3011. LodashWrapper.prototype.constructor = LodashWrapper;
  3012. /*------------------------------------------------------------------------*/
  3013. /**
  3014. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  3015. *
  3016. * @private
  3017. * @constructor
  3018. * @param {*} value The value to wrap.
  3019. */
  3020. function LazyWrapper(value) {
  3021. this.__wrapped__ = value;
  3022. this.__actions__ = [];
  3023. this.__dir__ = 1;
  3024. this.__filtered__ = false;
  3025. this.__iteratees__ = [];
  3026. this.__takeCount__ = MAX_ARRAY_LENGTH;
  3027. this.__views__ = [];
  3028. }
  3029. /**
  3030. * Creates a clone of the lazy wrapper object.
  3031. *
  3032. * @private
  3033. * @name clone
  3034. * @memberOf LazyWrapper
  3035. * @returns {Object} Returns the cloned `LazyWrapper` object.
  3036. */
  3037. function lazyClone() {
  3038. var result = new LazyWrapper(this.__wrapped__);
  3039. result.__actions__ = copyArray(this.__actions__);
  3040. result.__dir__ = this.__dir__;
  3041. result.__filtered__ = this.__filtered__;
  3042. result.__iteratees__ = copyArray(this.__iteratees__);
  3043. result.__takeCount__ = this.__takeCount__;
  3044. result.__views__ = copyArray(this.__views__);
  3045. return result;
  3046. }
  3047. /**
  3048. * Reverses the direction of lazy iteration.
  3049. *
  3050. * @private
  3051. * @name reverse
  3052. * @memberOf LazyWrapper
  3053. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  3054. */
  3055. function lazyReverse() {
  3056. if (this.__filtered__) {
  3057. var result = new LazyWrapper(this);
  3058. result.__dir__ = -1;
  3059. result.__filtered__ = true;
  3060. } else {
  3061. result = this.clone();
  3062. result.__dir__ *= -1;
  3063. }
  3064. return result;
  3065. }
  3066. /**
  3067. * Extracts the unwrapped value from its lazy wrapper.
  3068. *
  3069. * @private
  3070. * @name value
  3071. * @memberOf LazyWrapper
  3072. * @returns {*} Returns the unwrapped value.
  3073. */
  3074. function lazyValue() {
  3075. var array = this.__wrapped__.value(),
  3076. dir = this.__dir__,
  3077. isArr = isArray(array),
  3078. isRight = dir < 0,
  3079. arrLength = isArr ? array.length : 0,
  3080. view = getView(0, arrLength, this.__views__),
  3081. start = view.start,
  3082. end = view.end,
  3083. length = end - start,
  3084. index = isRight ? end : (start - 1),
  3085. iteratees = this.__iteratees__,
  3086. iterLength = iteratees.length,
  3087. resIndex = 0,
  3088. takeCount = nativeMin(length, this.__takeCount__);
  3089. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3090. return baseWrapperValue(array, this.__actions__);
  3091. }
  3092. var result = [];
  3093. outer:
  3094. while (length-- && resIndex < takeCount) {
  3095. index += dir;
  3096. var iterIndex = -1,
  3097. value = array[index];
  3098. while (++iterIndex < iterLength) {
  3099. var data = iteratees[iterIndex],
  3100. iteratee = data.iteratee,
  3101. type = data.type,
  3102. computed = iteratee(value);
  3103. if (type == LAZY_MAP_FLAG) {
  3104. value = computed;
  3105. } else if (!computed) {
  3106. if (type == LAZY_FILTER_FLAG) {
  3107. continue outer;
  3108. } else {
  3109. break outer;
  3110. }
  3111. }
  3112. }
  3113. result[resIndex++] = value;
  3114. }
  3115. return result;
  3116. }
  3117. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3118. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3119. LazyWrapper.prototype.constructor = LazyWrapper;
  3120. /*------------------------------------------------------------------------*/
  3121. /**
  3122. * Creates a hash object.
  3123. *
  3124. * @private
  3125. * @constructor
  3126. * @param {Array} [entries] The key-value pairs to cache.
  3127. */
  3128. function Hash(entries) {
  3129. var index = -1,
  3130. length = entries == null ? 0 : entries.length;
  3131. this.clear();
  3132. while (++index < length) {
  3133. var entry = entries[index];
  3134. this.set(entry[0], entry[1]);
  3135. }
  3136. }
  3137. /**
  3138. * Removes all key-value entries from the hash.
  3139. *
  3140. * @private
  3141. * @name clear
  3142. * @memberOf Hash
  3143. */
  3144. function hashClear() {
  3145. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3146. this.size = 0;
  3147. }
  3148. /**
  3149. * Removes `key` and its value from the hash.
  3150. *
  3151. * @private
  3152. * @name delete
  3153. * @memberOf Hash
  3154. * @param {Object} hash The hash to modify.
  3155. * @param {string} key The key of the value to remove.
  3156. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3157. */
  3158. function hashDelete(key) {
  3159. var result = this.has(key) && delete this.__data__[key];
  3160. this.size -= result ? 1 : 0;
  3161. return result;
  3162. }
  3163. /**
  3164. * Gets the hash value for `key`.
  3165. *
  3166. * @private
  3167. * @name get
  3168. * @memberOf Hash
  3169. * @param {string} key The key of the value to get.
  3170. * @returns {*} Returns the entry value.
  3171. */
  3172. function hashGet(key) {
  3173. var data = this.__data__;
  3174. if (nativeCreate) {
  3175. var result = data[key];
  3176. return result === HASH_UNDEFINED ? undefined : result;
  3177. }
  3178. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3179. }
  3180. /**
  3181. * Checks if a hash value for `key` exists.
  3182. *
  3183. * @private
  3184. * @name has
  3185. * @memberOf Hash
  3186. * @param {string} key The key of the entry to check.
  3187. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3188. */
  3189. function hashHas(key) {
  3190. var data = this.__data__;
  3191. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3192. }
  3193. /**
  3194. * Sets the hash `key` to `value`.
  3195. *
  3196. * @private
  3197. * @name set
  3198. * @memberOf Hash
  3199. * @param {string} key The key of the value to set.
  3200. * @param {*} value The value to set.
  3201. * @returns {Object} Returns the hash instance.
  3202. */
  3203. function hashSet(key, value) {
  3204. var data = this.__data__;
  3205. this.size += this.has(key) ? 0 : 1;
  3206. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3207. return this;
  3208. }
  3209. // Add methods to `Hash`.
  3210. Hash.prototype.clear = hashClear;
  3211. Hash.prototype['delete'] = hashDelete;
  3212. Hash.prototype.get = hashGet;
  3213. Hash.prototype.has = hashHas;
  3214. Hash.prototype.set = hashSet;
  3215. /*------------------------------------------------------------------------*/
  3216. /**
  3217. * Creates an list cache object.
  3218. *
  3219. * @private
  3220. * @constructor
  3221. * @param {Array} [entries] The key-value pairs to cache.
  3222. */
  3223. function ListCache(entries) {
  3224. var index = -1,
  3225. length = entries == null ? 0 : entries.length;
  3226. this.clear();
  3227. while (++index < length) {
  3228. var entry = entries[index];
  3229. this.set(entry[0], entry[1]);
  3230. }
  3231. }
  3232. /**
  3233. * Removes all key-value entries from the list cache.
  3234. *
  3235. * @private
  3236. * @name clear
  3237. * @memberOf ListCache
  3238. */
  3239. function listCacheClear() {
  3240. this.__data__ = [];
  3241. this.size = 0;
  3242. }
  3243. /**
  3244. * Removes `key` and its value from the list cache.
  3245. *
  3246. * @private
  3247. * @name delete
  3248. * @memberOf ListCache
  3249. * @param {string} key The key of the value to remove.
  3250. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3251. */
  3252. function listCacheDelete(key) {
  3253. var data = this.__data__,
  3254. index = assocIndexOf(data, key);
  3255. if (index < 0) {
  3256. return false;
  3257. }
  3258. var lastIndex = data.length - 1;
  3259. if (index == lastIndex) {
  3260. data.pop();
  3261. } else {
  3262. splice.call(data, index, 1);
  3263. }
  3264. --this.size;
  3265. return true;
  3266. }
  3267. /**
  3268. * Gets the list cache value for `key`.
  3269. *
  3270. * @private
  3271. * @name get
  3272. * @memberOf ListCache
  3273. * @param {string} key The key of the value to get.
  3274. * @returns {*} Returns the entry value.
  3275. */
  3276. function listCacheGet(key) {
  3277. var data = this.__data__,
  3278. index = assocIndexOf(data, key);
  3279. return index < 0 ? undefined : data[index][1];
  3280. }
  3281. /**
  3282. * Checks if a list cache value for `key` exists.
  3283. *
  3284. * @private
  3285. * @name has
  3286. * @memberOf ListCache
  3287. * @param {string} key The key of the entry to check.
  3288. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3289. */
  3290. function listCacheHas(key) {
  3291. return assocIndexOf(this.__data__, key) > -1;
  3292. }
  3293. /**
  3294. * Sets the list cache `key` to `value`.
  3295. *
  3296. * @private
  3297. * @name set
  3298. * @memberOf ListCache
  3299. * @param {string} key The key of the value to set.
  3300. * @param {*} value The value to set.
  3301. * @returns {Object} Returns the list cache instance.
  3302. */
  3303. function listCacheSet(key, value) {
  3304. var data = this.__data__,
  3305. index = assocIndexOf(data, key);
  3306. if (index < 0) {
  3307. ++this.size;
  3308. data.push([key, value]);
  3309. } else {
  3310. data[index][1] = value;
  3311. }
  3312. return this;
  3313. }
  3314. // Add methods to `ListCache`.
  3315. ListCache.prototype.clear = listCacheClear;
  3316. ListCache.prototype['delete'] = listCacheDelete;
  3317. ListCache.prototype.get = listCacheGet;
  3318. ListCache.prototype.has = listCacheHas;
  3319. ListCache.prototype.set = listCacheSet;
  3320. /*------------------------------------------------------------------------*/
  3321. /**
  3322. * Creates a map cache object to store key-value pairs.
  3323. *
  3324. * @private
  3325. * @constructor
  3326. * @param {Array} [entries] The key-value pairs to cache.
  3327. */
  3328. function MapCache(entries) {
  3329. var index = -1,
  3330. length = entries == null ? 0 : entries.length;
  3331. this.clear();
  3332. while (++index < length) {
  3333. var entry = entries[index];
  3334. this.set(entry[0], entry[1]);
  3335. }
  3336. }
  3337. /**
  3338. * Removes all key-value entries from the map.
  3339. *
  3340. * @private
  3341. * @name clear
  3342. * @memberOf MapCache
  3343. */
  3344. function mapCacheClear() {
  3345. this.size = 0;
  3346. this.__data__ = {
  3347. 'hash': new Hash,
  3348. 'map': new (Map || ListCache),
  3349. 'string': new Hash
  3350. };
  3351. }
  3352. /**
  3353. * Removes `key` and its value from the map.
  3354. *
  3355. * @private
  3356. * @name delete
  3357. * @memberOf MapCache
  3358. * @param {string} key The key of the value to remove.
  3359. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3360. */
  3361. function mapCacheDelete(key) {
  3362. var result = getMapData(this, key)['delete'](key);
  3363. this.size -= result ? 1 : 0;
  3364. return result;
  3365. }
  3366. /**
  3367. * Gets the map value for `key`.
  3368. *
  3369. * @private
  3370. * @name get
  3371. * @memberOf MapCache
  3372. * @param {string} key The key of the value to get.
  3373. * @returns {*} Returns the entry value.
  3374. */
  3375. function mapCacheGet(key) {
  3376. return getMapData(this, key).get(key);
  3377. }
  3378. /**
  3379. * Checks if a map value for `key` exists.
  3380. *
  3381. * @private
  3382. * @name has
  3383. * @memberOf MapCache
  3384. * @param {string} key The key of the entry to check.
  3385. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3386. */
  3387. function mapCacheHas(key) {
  3388. return getMapData(this, key).has(key);
  3389. }
  3390. /**
  3391. * Sets the map `key` to `value`.
  3392. *
  3393. * @private
  3394. * @name set
  3395. * @memberOf MapCache
  3396. * @param {string} key The key of the value to set.
  3397. * @param {*} value The value to set.
  3398. * @returns {Object} Returns the map cache instance.
  3399. */
  3400. function mapCacheSet(key, value) {
  3401. var data = getMapData(this, key),
  3402. size = data.size;
  3403. data.set(key, value);
  3404. this.size += data.size == size ? 0 : 1;
  3405. return this;
  3406. }
  3407. // Add methods to `MapCache`.
  3408. MapCache.prototype.clear = mapCacheClear;
  3409. MapCache.prototype['delete'] = mapCacheDelete;
  3410. MapCache.prototype.get = mapCacheGet;
  3411. MapCache.prototype.has = mapCacheHas;
  3412. MapCache.prototype.set = mapCacheSet;
  3413. /*------------------------------------------------------------------------*/
  3414. /**
  3415. *
  3416. * Creates an array cache object to store unique values.
  3417. *
  3418. * @private
  3419. * @constructor
  3420. * @param {Array} [values] The values to cache.
  3421. */
  3422. function SetCache(values) {
  3423. var index = -1,
  3424. length = values == null ? 0 : values.length;
  3425. this.__data__ = new MapCache;
  3426. while (++index < length) {
  3427. this.add(values[index]);
  3428. }
  3429. }
  3430. /**
  3431. * Adds `value` to the array cache.
  3432. *
  3433. * @private
  3434. * @name add
  3435. * @memberOf SetCache
  3436. * @alias push
  3437. * @param {*} value The value to cache.
  3438. * @returns {Object} Returns the cache instance.
  3439. */
  3440. function setCacheAdd(value) {
  3441. this.__data__.set(value, HASH_UNDEFINED);
  3442. return this;
  3443. }
  3444. /**
  3445. * Checks if `value` is in the array cache.
  3446. *
  3447. * @private
  3448. * @name has
  3449. * @memberOf SetCache
  3450. * @param {*} value The value to search for.
  3451. * @returns {number} Returns `true` if `value` is found, else `false`.
  3452. */
  3453. function setCacheHas(value) {
  3454. return this.__data__.has(value);
  3455. }
  3456. // Add methods to `SetCache`.
  3457. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3458. SetCache.prototype.has = setCacheHas;
  3459. /*------------------------------------------------------------------------*/
  3460. /**
  3461. * Creates a stack cache object to store key-value pairs.
  3462. *
  3463. * @private
  3464. * @constructor
  3465. * @param {Array} [entries] The key-value pairs to cache.
  3466. */
  3467. function Stack(entries) {
  3468. var data = this.__data__ = new ListCache(entries);
  3469. this.size = data.size;
  3470. }
  3471. /**
  3472. * Removes all key-value entries from the stack.
  3473. *
  3474. * @private
  3475. * @name clear
  3476. * @memberOf Stack
  3477. */
  3478. function stackClear() {
  3479. this.__data__ = new ListCache;
  3480. this.size = 0;
  3481. }
  3482. /**
  3483. * Removes `key` and its value from the stack.
  3484. *
  3485. * @private
  3486. * @name delete
  3487. * @memberOf Stack
  3488. * @param {string} key The key of the value to remove.
  3489. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3490. */
  3491. function stackDelete(key) {
  3492. var data = this.__data__,
  3493. result = data['delete'](key);
  3494. this.size = data.size;
  3495. return result;
  3496. }
  3497. /**
  3498. * Gets the stack value for `key`.
  3499. *
  3500. * @private
  3501. * @name get
  3502. * @memberOf Stack
  3503. * @param {string} key The key of the value to get.
  3504. * @returns {*} Returns the entry value.
  3505. */
  3506. function stackGet(key) {
  3507. return this.__data__.get(key);
  3508. }
  3509. /**
  3510. * Checks if a stack value for `key` exists.
  3511. *
  3512. * @private
  3513. * @name has
  3514. * @memberOf Stack
  3515. * @param {string} key The key of the entry to check.
  3516. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3517. */
  3518. function stackHas(key) {
  3519. return this.__data__.has(key);
  3520. }
  3521. /**
  3522. * Sets the stack `key` to `value`.
  3523. *
  3524. * @private
  3525. * @name set
  3526. * @memberOf Stack
  3527. * @param {string} key The key of the value to set.
  3528. * @param {*} value The value to set.
  3529. * @returns {Object} Returns the stack cache instance.
  3530. */
  3531. function stackSet(key, value) {
  3532. var data = this.__data__;
  3533. if (data instanceof ListCache) {
  3534. var pairs = data.__data__;
  3535. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3536. pairs.push([key, value]);
  3537. this.size = ++data.size;
  3538. return this;
  3539. }
  3540. data = this.__data__ = new MapCache(pairs);
  3541. }
  3542. data.set(key, value);
  3543. this.size = data.size;
  3544. return this;
  3545. }
  3546. // Add methods to `Stack`.
  3547. Stack.prototype.clear = stackClear;
  3548. Stack.prototype['delete'] = stackDelete;
  3549. Stack.prototype.get = stackGet;
  3550. Stack.prototype.has = stackHas;
  3551. Stack.prototype.set = stackSet;
  3552. /*------------------------------------------------------------------------*/
  3553. /**
  3554. * Creates an array of the enumerable property names of the array-like `value`.
  3555. *
  3556. * @private
  3557. * @param {*} value The value to query.
  3558. * @param {boolean} inherited Specify returning inherited property names.
  3559. * @returns {Array} Returns the array of property names.
  3560. */
  3561. function arrayLikeKeys(value, inherited) {
  3562. var isArr = isArray(value),
  3563. isArg = !isArr && isArguments(value),
  3564. isBuff = !isArr && !isArg && isBuffer(value),
  3565. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3566. skipIndexes = isArr || isArg || isBuff || isType,
  3567. result = skipIndexes ? baseTimes(value.length, String) : [],
  3568. length = result.length;
  3569. for (var key in value) {
  3570. if ((inherited || hasOwnProperty.call(value, key)) &&
  3571. !(skipIndexes && (
  3572. // Safari 9 has enumerable `arguments.length` in strict mode.
  3573. key == 'length' ||
  3574. // Node.js 0.10 has enumerable non-index properties on buffers.
  3575. (isBuff && (key == 'offset' || key == 'parent')) ||
  3576. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3577. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3578. // Skip index properties.
  3579. isIndex(key, length)
  3580. ))) {
  3581. result.push(key);
  3582. }
  3583. }
  3584. return result;
  3585. }
  3586. /**
  3587. * A specialized version of `_.sample` for arrays.
  3588. *
  3589. * @private
  3590. * @param {Array} array The array to sample.
  3591. * @returns {*} Returns the random element.
  3592. */
  3593. function arraySample(array) {
  3594. var length = array.length;
  3595. return length ? array[baseRandom(0, length - 1)] : undefined;
  3596. }
  3597. /**
  3598. * A specialized version of `_.sampleSize` for arrays.
  3599. *
  3600. * @private
  3601. * @param {Array} array The array to sample.
  3602. * @param {number} n The number of elements to sample.
  3603. * @returns {Array} Returns the random elements.
  3604. */
  3605. function arraySampleSize(array, n) {
  3606. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3607. }
  3608. /**
  3609. * A specialized version of `_.shuffle` for arrays.
  3610. *
  3611. * @private
  3612. * @param {Array} array The array to shuffle.
  3613. * @returns {Array} Returns the new shuffled array.
  3614. */
  3615. function arrayShuffle(array) {
  3616. return shuffleSelf(copyArray(array));
  3617. }
  3618. /**
  3619. * This function is like `assignValue` except that it doesn't assign
  3620. * `undefined` values.
  3621. *
  3622. * @private
  3623. * @param {Object} object The object to modify.
  3624. * @param {string} key The key of the property to assign.
  3625. * @param {*} value The value to assign.
  3626. */
  3627. function assignMergeValue(object, key, value) {
  3628. if ((value !== undefined && !eq(object[key], value)) ||
  3629. (value === undefined && !(key in object))) {
  3630. baseAssignValue(object, key, value);
  3631. }
  3632. }
  3633. /**
  3634. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3635. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3636. * for equality comparisons.
  3637. *
  3638. * @private
  3639. * @param {Object} object The object to modify.
  3640. * @param {string} key The key of the property to assign.
  3641. * @param {*} value The value to assign.
  3642. */
  3643. function assignValue(object, key, value) {
  3644. var objValue = object[key];
  3645. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3646. (value === undefined && !(key in object))) {
  3647. baseAssignValue(object, key, value);
  3648. }
  3649. }
  3650. /**
  3651. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3652. *
  3653. * @private
  3654. * @param {Array} array The array to inspect.
  3655. * @param {*} key The key to search for.
  3656. * @returns {number} Returns the index of the matched value, else `-1`.
  3657. */
  3658. function assocIndexOf(array, key) {
  3659. var length = array.length;
  3660. while (length--) {
  3661. if (eq(array[length][0], key)) {
  3662. return length;
  3663. }
  3664. }
  3665. return -1;
  3666. }
  3667. /**
  3668. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3669. * by `iteratee` and values set by `setter`.
  3670. *
  3671. * @private
  3672. * @param {Array|Object} collection The collection to iterate over.
  3673. * @param {Function} setter The function to set `accumulator` values.
  3674. * @param {Function} iteratee The iteratee to transform keys.
  3675. * @param {Object} accumulator The initial aggregated object.
  3676. * @returns {Function} Returns `accumulator`.
  3677. */
  3678. function baseAggregator(collection, setter, iteratee, accumulator) {
  3679. baseEach(collection, function(value, key, collection) {
  3680. setter(accumulator, value, iteratee(value), collection);
  3681. });
  3682. return accumulator;
  3683. }
  3684. /**
  3685. * The base implementation of `_.assign` without support for multiple sources
  3686. * or `customizer` functions.
  3687. *
  3688. * @private
  3689. * @param {Object} object The destination object.
  3690. * @param {Object} source The source object.
  3691. * @returns {Object} Returns `object`.
  3692. */
  3693. function baseAssign(object, source) {
  3694. return object && copyObject(source, keys(source), object);
  3695. }
  3696. /**
  3697. * The base implementation of `_.assignIn` without support for multiple sources
  3698. * or `customizer` functions.
  3699. *
  3700. * @private
  3701. * @param {Object} object The destination object.
  3702. * @param {Object} source The source object.
  3703. * @returns {Object} Returns `object`.
  3704. */
  3705. function baseAssignIn(object, source) {
  3706. return object && copyObject(source, keysIn(source), object);
  3707. }
  3708. /**
  3709. * The base implementation of `assignValue` and `assignMergeValue` without
  3710. * value checks.
  3711. *
  3712. * @private
  3713. * @param {Object} object The object to modify.
  3714. * @param {string} key The key of the property to assign.
  3715. * @param {*} value The value to assign.
  3716. */
  3717. function baseAssignValue(object, key, value) {
  3718. if (key == '__proto__' && defineProperty) {
  3719. defineProperty(object, key, {
  3720. 'configurable': true,
  3721. 'enumerable': true,
  3722. 'value': value,
  3723. 'writable': true
  3724. });
  3725. } else {
  3726. object[key] = value;
  3727. }
  3728. }
  3729. /**
  3730. * The base implementation of `_.at` without support for individual paths.
  3731. *
  3732. * @private
  3733. * @param {Object} object The object to iterate over.
  3734. * @param {string[]} paths The property paths to pick.
  3735. * @returns {Array} Returns the picked elements.
  3736. */
  3737. function baseAt(object, paths) {
  3738. var index = -1,
  3739. length = paths.length,
  3740. result = Array(length),
  3741. skip = object == null;
  3742. while (++index < length) {
  3743. result[index] = skip ? undefined : get(object, paths[index]);
  3744. }
  3745. return result;
  3746. }
  3747. /**
  3748. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3749. *
  3750. * @private
  3751. * @param {number} number The number to clamp.
  3752. * @param {number} [lower] The lower bound.
  3753. * @param {number} upper The upper bound.
  3754. * @returns {number} Returns the clamped number.
  3755. */
  3756. function baseClamp(number, lower, upper) {
  3757. if (number === number) {
  3758. if (upper !== undefined) {
  3759. number = number <= upper ? number : upper;
  3760. }
  3761. if (lower !== undefined) {
  3762. number = number >= lower ? number : lower;
  3763. }
  3764. }
  3765. return number;
  3766. }
  3767. /**
  3768. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3769. * traversed objects.
  3770. *
  3771. * @private
  3772. * @param {*} value The value to clone.
  3773. * @param {boolean} bitmask The bitmask flags.
  3774. * 1 - Deep clone
  3775. * 2 - Flatten inherited properties
  3776. * 4 - Clone symbols
  3777. * @param {Function} [customizer] The function to customize cloning.
  3778. * @param {string} [key] The key of `value`.
  3779. * @param {Object} [object] The parent object of `value`.
  3780. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3781. * @returns {*} Returns the cloned value.
  3782. */
  3783. function baseClone(value, bitmask, customizer, key, object, stack) {
  3784. var result,
  3785. isDeep = bitmask & CLONE_DEEP_FLAG,
  3786. isFlat = bitmask & CLONE_FLAT_FLAG,
  3787. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3788. if (customizer) {
  3789. result = object ? customizer(value, key, object, stack) : customizer(value);
  3790. }
  3791. if (result !== undefined) {
  3792. return result;
  3793. }
  3794. if (!isObject(value)) {
  3795. return value;
  3796. }
  3797. var isArr = isArray(value);
  3798. if (isArr) {
  3799. result = initCloneArray(value);
  3800. if (!isDeep) {
  3801. return copyArray(value, result);
  3802. }
  3803. } else {
  3804. var tag = getTag(value),
  3805. isFunc = tag == funcTag || tag == genTag;
  3806. if (isBuffer(value)) {
  3807. return cloneBuffer(value, isDeep);
  3808. }
  3809. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3810. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3811. if (!isDeep) {
  3812. return isFlat
  3813. ? copySymbolsIn(value, baseAssignIn(result, value))
  3814. : copySymbols(value, baseAssign(result, value));
  3815. }
  3816. } else {
  3817. if (!cloneableTags[tag]) {
  3818. return object ? value : {};
  3819. }
  3820. result = initCloneByTag(value, tag, isDeep);
  3821. }
  3822. }
  3823. // Check for circular references and return its corresponding clone.
  3824. stack || (stack = new Stack);
  3825. var stacked = stack.get(value);
  3826. if (stacked) {
  3827. return stacked;
  3828. }
  3829. stack.set(value, result);
  3830. if (isSet(value)) {
  3831. value.forEach(function(subValue) {
  3832. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3833. });
  3834. } else if (isMap(value)) {
  3835. value.forEach(function(subValue, key) {
  3836. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3837. });
  3838. }
  3839. var keysFunc = isFull
  3840. ? (isFlat ? getAllKeysIn : getAllKeys)
  3841. : (isFlat ? keysIn : keys);
  3842. var props = isArr ? undefined : keysFunc(value);
  3843. arrayEach(props || value, function(subValue, key) {
  3844. if (props) {
  3845. key = subValue;
  3846. subValue = value[key];
  3847. }
  3848. // Recursively populate clone (susceptible to call stack limits).
  3849. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3850. });
  3851. return result;
  3852. }
  3853. /**
  3854. * The base implementation of `_.conforms` which doesn't clone `source`.
  3855. *
  3856. * @private
  3857. * @param {Object} source The object of property predicates to conform to.
  3858. * @returns {Function} Returns the new spec function.
  3859. */
  3860. function baseConforms(source) {
  3861. var props = keys(source);
  3862. return function(object) {
  3863. return baseConformsTo(object, source, props);
  3864. };
  3865. }
  3866. /**
  3867. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3868. *
  3869. * @private
  3870. * @param {Object} object The object to inspect.
  3871. * @param {Object} source The object of property predicates to conform to.
  3872. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3873. */
  3874. function baseConformsTo(object, source, props) {
  3875. var length = props.length;
  3876. if (object == null) {
  3877. return !length;
  3878. }
  3879. object = Object(object);
  3880. while (length--) {
  3881. var key = props[length],
  3882. predicate = source[key],
  3883. value = object[key];
  3884. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3885. return false;
  3886. }
  3887. }
  3888. return true;
  3889. }
  3890. /**
  3891. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3892. * to provide to `func`.
  3893. *
  3894. * @private
  3895. * @param {Function} func The function to delay.
  3896. * @param {number} wait The number of milliseconds to delay invocation.
  3897. * @param {Array} args The arguments to provide to `func`.
  3898. * @returns {number|Object} Returns the timer id or timeout object.
  3899. */
  3900. function baseDelay(func, wait, args) {
  3901. if (typeof func != 'function') {
  3902. throw new TypeError(FUNC_ERROR_TEXT);
  3903. }
  3904. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3905. }
  3906. /**
  3907. * The base implementation of methods like `_.difference` without support
  3908. * for excluding multiple arrays or iteratee shorthands.
  3909. *
  3910. * @private
  3911. * @param {Array} array The array to inspect.
  3912. * @param {Array} values The values to exclude.
  3913. * @param {Function} [iteratee] The iteratee invoked per element.
  3914. * @param {Function} [comparator] The comparator invoked per element.
  3915. * @returns {Array} Returns the new array of filtered values.
  3916. */
  3917. function baseDifference(array, values, iteratee, comparator) {
  3918. var index = -1,
  3919. includes = arrayIncludes,
  3920. isCommon = true,
  3921. length = array.length,
  3922. result = [],
  3923. valuesLength = values.length;
  3924. if (!length) {
  3925. return result;
  3926. }
  3927. if (iteratee) {
  3928. values = arrayMap(values, baseUnary(iteratee));
  3929. }
  3930. if (comparator) {
  3931. includes = arrayIncludesWith;
  3932. isCommon = false;
  3933. }
  3934. else if (values.length >= LARGE_ARRAY_SIZE) {
  3935. includes = cacheHas;
  3936. isCommon = false;
  3937. values = new SetCache(values);
  3938. }
  3939. outer:
  3940. while (++index < length) {
  3941. var value = array[index],
  3942. computed = iteratee == null ? value : iteratee(value);
  3943. value = (comparator || value !== 0) ? value : 0;
  3944. if (isCommon && computed === computed) {
  3945. var valuesIndex = valuesLength;
  3946. while (valuesIndex--) {
  3947. if (values[valuesIndex] === computed) {
  3948. continue outer;
  3949. }
  3950. }
  3951. result.push(value);
  3952. }
  3953. else if (!includes(values, computed, comparator)) {
  3954. result.push(value);
  3955. }
  3956. }
  3957. return result;
  3958. }
  3959. /**
  3960. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3961. *
  3962. * @private
  3963. * @param {Array|Object} collection The collection to iterate over.
  3964. * @param {Function} iteratee The function invoked per iteration.
  3965. * @returns {Array|Object} Returns `collection`.
  3966. */
  3967. var baseEach = createBaseEach(baseForOwn);
  3968. /**
  3969. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3970. *
  3971. * @private
  3972. * @param {Array|Object} collection The collection to iterate over.
  3973. * @param {Function} iteratee The function invoked per iteration.
  3974. * @returns {Array|Object} Returns `collection`.
  3975. */
  3976. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3977. /**
  3978. * The base implementation of `_.every` without support for iteratee shorthands.
  3979. *
  3980. * @private
  3981. * @param {Array|Object} collection The collection to iterate over.
  3982. * @param {Function} predicate The function invoked per iteration.
  3983. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3984. * else `false`
  3985. */
  3986. function baseEvery(collection, predicate) {
  3987. var result = true;
  3988. baseEach(collection, function(value, index, collection) {
  3989. result = !!predicate(value, index, collection);
  3990. return result;
  3991. });
  3992. return result;
  3993. }
  3994. /**
  3995. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3996. * `comparator` to determine the extremum value.
  3997. *
  3998. * @private
  3999. * @param {Array} array The array to iterate over.
  4000. * @param {Function} iteratee The iteratee invoked per iteration.
  4001. * @param {Function} comparator The comparator used to compare values.
  4002. * @returns {*} Returns the extremum value.
  4003. */
  4004. function baseExtremum(array, iteratee, comparator) {
  4005. var index = -1,
  4006. length = array.length;
  4007. while (++index < length) {
  4008. var value = array[index],
  4009. current = iteratee(value);
  4010. if (current != null && (computed === undefined
  4011. ? (current === current && !isSymbol(current))
  4012. : comparator(current, computed)
  4013. )) {
  4014. var computed = current,
  4015. result = value;
  4016. }
  4017. }
  4018. return result;
  4019. }
  4020. /**
  4021. * The base implementation of `_.fill` without an iteratee call guard.
  4022. *
  4023. * @private
  4024. * @param {Array} array The array to fill.
  4025. * @param {*} value The value to fill `array` with.
  4026. * @param {number} [start=0] The start position.
  4027. * @param {number} [end=array.length] The end position.
  4028. * @returns {Array} Returns `array`.
  4029. */
  4030. function baseFill(array, value, start, end) {
  4031. var length = array.length;
  4032. start = toInteger(start);
  4033. if (start < 0) {
  4034. start = -start > length ? 0 : (length + start);
  4035. }
  4036. end = (end === undefined || end > length) ? length : toInteger(end);
  4037. if (end < 0) {
  4038. end += length;
  4039. }
  4040. end = start > end ? 0 : toLength(end);
  4041. while (start < end) {
  4042. array[start++] = value;
  4043. }
  4044. return array;
  4045. }
  4046. /**
  4047. * The base implementation of `_.filter` without support for iteratee shorthands.
  4048. *
  4049. * @private
  4050. * @param {Array|Object} collection The collection to iterate over.
  4051. * @param {Function} predicate The function invoked per iteration.
  4052. * @returns {Array} Returns the new filtered array.
  4053. */
  4054. function baseFilter(collection, predicate) {
  4055. var result = [];
  4056. baseEach(collection, function(value, index, collection) {
  4057. if (predicate(value, index, collection)) {
  4058. result.push(value);
  4059. }
  4060. });
  4061. return result;
  4062. }
  4063. /**
  4064. * The base implementation of `_.flatten` with support for restricting flattening.
  4065. *
  4066. * @private
  4067. * @param {Array} array The array to flatten.
  4068. * @param {number} depth The maximum recursion depth.
  4069. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4070. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4071. * @param {Array} [result=[]] The initial result value.
  4072. * @returns {Array} Returns the new flattened array.
  4073. */
  4074. function baseFlatten(array, depth, predicate, isStrict, result) {
  4075. var index = -1,
  4076. length = array.length;
  4077. predicate || (predicate = isFlattenable);
  4078. result || (result = []);
  4079. while (++index < length) {
  4080. var value = array[index];
  4081. if (depth > 0 && predicate(value)) {
  4082. if (depth > 1) {
  4083. // Recursively flatten arrays (susceptible to call stack limits).
  4084. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4085. } else {
  4086. arrayPush(result, value);
  4087. }
  4088. } else if (!isStrict) {
  4089. result[result.length] = value;
  4090. }
  4091. }
  4092. return result;
  4093. }
  4094. /**
  4095. * The base implementation of `baseForOwn` which iterates over `object`
  4096. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4097. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4098. *
  4099. * @private
  4100. * @param {Object} object The object to iterate over.
  4101. * @param {Function} iteratee The function invoked per iteration.
  4102. * @param {Function} keysFunc The function to get the keys of `object`.
  4103. * @returns {Object} Returns `object`.
  4104. */
  4105. var baseFor = createBaseFor();
  4106. /**
  4107. * This function is like `baseFor` except that it iterates over properties
  4108. * in the opposite order.
  4109. *
  4110. * @private
  4111. * @param {Object} object The object to iterate over.
  4112. * @param {Function} iteratee The function invoked per iteration.
  4113. * @param {Function} keysFunc The function to get the keys of `object`.
  4114. * @returns {Object} Returns `object`.
  4115. */
  4116. var baseForRight = createBaseFor(true);
  4117. /**
  4118. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4119. *
  4120. * @private
  4121. * @param {Object} object The object to iterate over.
  4122. * @param {Function} iteratee The function invoked per iteration.
  4123. * @returns {Object} Returns `object`.
  4124. */
  4125. function baseForOwn(object, iteratee) {
  4126. return object && baseFor(object, iteratee, keys);
  4127. }
  4128. /**
  4129. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4130. *
  4131. * @private
  4132. * @param {Object} object The object to iterate over.
  4133. * @param {Function} iteratee The function invoked per iteration.
  4134. * @returns {Object} Returns `object`.
  4135. */
  4136. function baseForOwnRight(object, iteratee) {
  4137. return object && baseForRight(object, iteratee, keys);
  4138. }
  4139. /**
  4140. * The base implementation of `_.functions` which creates an array of
  4141. * `object` function property names filtered from `props`.
  4142. *
  4143. * @private
  4144. * @param {Object} object The object to inspect.
  4145. * @param {Array} props The property names to filter.
  4146. * @returns {Array} Returns the function names.
  4147. */
  4148. function baseFunctions(object, props) {
  4149. return arrayFilter(props, function(key) {
  4150. return isFunction(object[key]);
  4151. });
  4152. }
  4153. /**
  4154. * The base implementation of `_.get` without support for default values.
  4155. *
  4156. * @private
  4157. * @param {Object} object The object to query.
  4158. * @param {Array|string} path The path of the property to get.
  4159. * @returns {*} Returns the resolved value.
  4160. */
  4161. function baseGet(object, path) {
  4162. path = castPath(path, object);
  4163. var index = 0,
  4164. length = path.length;
  4165. while (object != null && index < length) {
  4166. object = object[toKey(path[index++])];
  4167. }
  4168. return (index && index == length) ? object : undefined;
  4169. }
  4170. /**
  4171. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4172. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4173. * symbols of `object`.
  4174. *
  4175. * @private
  4176. * @param {Object} object The object to query.
  4177. * @param {Function} keysFunc The function to get the keys of `object`.
  4178. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4179. * @returns {Array} Returns the array of property names and symbols.
  4180. */
  4181. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4182. var result = keysFunc(object);
  4183. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4184. }
  4185. /**
  4186. * The base implementation of `getTag` without fallbacks for buggy environments.
  4187. *
  4188. * @private
  4189. * @param {*} value The value to query.
  4190. * @returns {string} Returns the `toStringTag`.
  4191. */
  4192. function baseGetTag(value) {
  4193. if (value == null) {
  4194. return value === undefined ? undefinedTag : nullTag;
  4195. }
  4196. return (symToStringTag && symToStringTag in Object(value))
  4197. ? getRawTag(value)
  4198. : objectToString(value);
  4199. }
  4200. /**
  4201. * The base implementation of `_.gt` which doesn't coerce arguments.
  4202. *
  4203. * @private
  4204. * @param {*} value The value to compare.
  4205. * @param {*} other The other value to compare.
  4206. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4207. * else `false`.
  4208. */
  4209. function baseGt(value, other) {
  4210. return value > other;
  4211. }
  4212. /**
  4213. * The base implementation of `_.has` without support for deep paths.
  4214. *
  4215. * @private
  4216. * @param {Object} [object] The object to query.
  4217. * @param {Array|string} key The key to check.
  4218. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4219. */
  4220. function baseHas(object, key) {
  4221. return object != null && hasOwnProperty.call(object, key);
  4222. }
  4223. /**
  4224. * The base implementation of `_.hasIn` without support for deep paths.
  4225. *
  4226. * @private
  4227. * @param {Object} [object] The object to query.
  4228. * @param {Array|string} key The key to check.
  4229. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4230. */
  4231. function baseHasIn(object, key) {
  4232. return object != null && key in Object(object);
  4233. }
  4234. /**
  4235. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4236. *
  4237. * @private
  4238. * @param {number} number The number to check.
  4239. * @param {number} start The start of the range.
  4240. * @param {number} end The end of the range.
  4241. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4242. */
  4243. function baseInRange(number, start, end) {
  4244. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4245. }
  4246. /**
  4247. * The base implementation of methods like `_.intersection`, without support
  4248. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4249. *
  4250. * @private
  4251. * @param {Array} arrays The arrays to inspect.
  4252. * @param {Function} [iteratee] The iteratee invoked per element.
  4253. * @param {Function} [comparator] The comparator invoked per element.
  4254. * @returns {Array} Returns the new array of shared values.
  4255. */
  4256. function baseIntersection(arrays, iteratee, comparator) {
  4257. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4258. length = arrays[0].length,
  4259. othLength = arrays.length,
  4260. othIndex = othLength,
  4261. caches = Array(othLength),
  4262. maxLength = Infinity,
  4263. result = [];
  4264. while (othIndex--) {
  4265. var array = arrays[othIndex];
  4266. if (othIndex && iteratee) {
  4267. array = arrayMap(array, baseUnary(iteratee));
  4268. }
  4269. maxLength = nativeMin(array.length, maxLength);
  4270. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4271. ? new SetCache(othIndex && array)
  4272. : undefined;
  4273. }
  4274. array = arrays[0];
  4275. var index = -1,
  4276. seen = caches[0];
  4277. outer:
  4278. while (++index < length && result.length < maxLength) {
  4279. var value = array[index],
  4280. computed = iteratee ? iteratee(value) : value;
  4281. value = (comparator || value !== 0) ? value : 0;
  4282. if (!(seen
  4283. ? cacheHas(seen, computed)
  4284. : includes(result, computed, comparator)
  4285. )) {
  4286. othIndex = othLength;
  4287. while (--othIndex) {
  4288. var cache = caches[othIndex];
  4289. if (!(cache
  4290. ? cacheHas(cache, computed)
  4291. : includes(arrays[othIndex], computed, comparator))
  4292. ) {
  4293. continue outer;
  4294. }
  4295. }
  4296. if (seen) {
  4297. seen.push(computed);
  4298. }
  4299. result.push(value);
  4300. }
  4301. }
  4302. return result;
  4303. }
  4304. /**
  4305. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4306. * `object` with values transformed by `iteratee` and set by `setter`.
  4307. *
  4308. * @private
  4309. * @param {Object} object The object to iterate over.
  4310. * @param {Function} setter The function to set `accumulator` values.
  4311. * @param {Function} iteratee The iteratee to transform values.
  4312. * @param {Object} accumulator The initial inverted object.
  4313. * @returns {Function} Returns `accumulator`.
  4314. */
  4315. function baseInverter(object, setter, iteratee, accumulator) {
  4316. baseForOwn(object, function(value, key, object) {
  4317. setter(accumulator, iteratee(value), key, object);
  4318. });
  4319. return accumulator;
  4320. }
  4321. /**
  4322. * The base implementation of `_.invoke` without support for individual
  4323. * method arguments.
  4324. *
  4325. * @private
  4326. * @param {Object} object The object to query.
  4327. * @param {Array|string} path The path of the method to invoke.
  4328. * @param {Array} args The arguments to invoke the method with.
  4329. * @returns {*} Returns the result of the invoked method.
  4330. */
  4331. function baseInvoke(object, path, args) {
  4332. path = castPath(path, object);
  4333. object = parent(object, path);
  4334. var func = object == null ? object : object[toKey(last(path))];
  4335. return func == null ? undefined : apply(func, object, args);
  4336. }
  4337. /**
  4338. * The base implementation of `_.isArguments`.
  4339. *
  4340. * @private
  4341. * @param {*} value The value to check.
  4342. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4343. */
  4344. function baseIsArguments(value) {
  4345. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4346. }
  4347. /**
  4348. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4349. *
  4350. * @private
  4351. * @param {*} value The value to check.
  4352. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4353. */
  4354. function baseIsArrayBuffer(value) {
  4355. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4356. }
  4357. /**
  4358. * The base implementation of `_.isDate` without Node.js optimizations.
  4359. *
  4360. * @private
  4361. * @param {*} value The value to check.
  4362. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4363. */
  4364. function baseIsDate(value) {
  4365. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4366. }
  4367. /**
  4368. * The base implementation of `_.isEqual` which supports partial comparisons
  4369. * and tracks traversed objects.
  4370. *
  4371. * @private
  4372. * @param {*} value The value to compare.
  4373. * @param {*} other The other value to compare.
  4374. * @param {boolean} bitmask The bitmask flags.
  4375. * 1 - Unordered comparison
  4376. * 2 - Partial comparison
  4377. * @param {Function} [customizer] The function to customize comparisons.
  4378. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4379. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4380. */
  4381. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4382. if (value === other) {
  4383. return true;
  4384. }
  4385. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4386. return value !== value && other !== other;
  4387. }
  4388. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4389. }
  4390. /**
  4391. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4392. * deep comparisons and tracks traversed objects enabling objects with circular
  4393. * references to be compared.
  4394. *
  4395. * @private
  4396. * @param {Object} object The object to compare.
  4397. * @param {Object} other The other object to compare.
  4398. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4399. * @param {Function} customizer The function to customize comparisons.
  4400. * @param {Function} equalFunc The function to determine equivalents of values.
  4401. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4402. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4403. */
  4404. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4405. var objIsArr = isArray(object),
  4406. othIsArr = isArray(other),
  4407. objTag = objIsArr ? arrayTag : getTag(object),
  4408. othTag = othIsArr ? arrayTag : getTag(other);
  4409. objTag = objTag == argsTag ? objectTag : objTag;
  4410. othTag = othTag == argsTag ? objectTag : othTag;
  4411. var objIsObj = objTag == objectTag,
  4412. othIsObj = othTag == objectTag,
  4413. isSameTag = objTag == othTag;
  4414. if (isSameTag && isBuffer(object)) {
  4415. if (!isBuffer(other)) {
  4416. return false;
  4417. }
  4418. objIsArr = true;
  4419. objIsObj = false;
  4420. }
  4421. if (isSameTag && !objIsObj) {
  4422. stack || (stack = new Stack);
  4423. return (objIsArr || isTypedArray(object))
  4424. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4425. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4426. }
  4427. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4428. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4429. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4430. if (objIsWrapped || othIsWrapped) {
  4431. var objUnwrapped = objIsWrapped ? object.value() : object,
  4432. othUnwrapped = othIsWrapped ? other.value() : other;
  4433. stack || (stack = new Stack);
  4434. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4435. }
  4436. }
  4437. if (!isSameTag) {
  4438. return false;
  4439. }
  4440. stack || (stack = new Stack);
  4441. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4442. }
  4443. /**
  4444. * The base implementation of `_.isMap` without Node.js optimizations.
  4445. *
  4446. * @private
  4447. * @param {*} value The value to check.
  4448. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4449. */
  4450. function baseIsMap(value) {
  4451. return isObjectLike(value) && getTag(value) == mapTag;
  4452. }
  4453. /**
  4454. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4455. *
  4456. * @private
  4457. * @param {Object} object The object to inspect.
  4458. * @param {Object} source The object of property values to match.
  4459. * @param {Array} matchData The property names, values, and compare flags to match.
  4460. * @param {Function} [customizer] The function to customize comparisons.
  4461. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4462. */
  4463. function baseIsMatch(object, source, matchData, customizer) {
  4464. var index = matchData.length,
  4465. length = index,
  4466. noCustomizer = !customizer;
  4467. if (object == null) {
  4468. return !length;
  4469. }
  4470. object = Object(object);
  4471. while (index--) {
  4472. var data = matchData[index];
  4473. if ((noCustomizer && data[2])
  4474. ? data[1] !== object[data[0]]
  4475. : !(data[0] in object)
  4476. ) {
  4477. return false;
  4478. }
  4479. }
  4480. while (++index < length) {
  4481. data = matchData[index];
  4482. var key = data[0],
  4483. objValue = object[key],
  4484. srcValue = data[1];
  4485. if (noCustomizer && data[2]) {
  4486. if (objValue === undefined && !(key in object)) {
  4487. return false;
  4488. }
  4489. } else {
  4490. var stack = new Stack;
  4491. if (customizer) {
  4492. var result = customizer(objValue, srcValue, key, object, source, stack);
  4493. }
  4494. if (!(result === undefined
  4495. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4496. : result
  4497. )) {
  4498. return false;
  4499. }
  4500. }
  4501. }
  4502. return true;
  4503. }
  4504. /**
  4505. * The base implementation of `_.isNative` without bad shim checks.
  4506. *
  4507. * @private
  4508. * @param {*} value The value to check.
  4509. * @returns {boolean} Returns `true` if `value` is a native function,
  4510. * else `false`.
  4511. */
  4512. function baseIsNative(value) {
  4513. if (!isObject(value) || isMasked(value)) {
  4514. return false;
  4515. }
  4516. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4517. return pattern.test(toSource(value));
  4518. }
  4519. /**
  4520. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4521. *
  4522. * @private
  4523. * @param {*} value The value to check.
  4524. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4525. */
  4526. function baseIsRegExp(value) {
  4527. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4528. }
  4529. /**
  4530. * The base implementation of `_.isSet` without Node.js optimizations.
  4531. *
  4532. * @private
  4533. * @param {*} value The value to check.
  4534. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4535. */
  4536. function baseIsSet(value) {
  4537. return isObjectLike(value) && getTag(value) == setTag;
  4538. }
  4539. /**
  4540. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4541. *
  4542. * @private
  4543. * @param {*} value The value to check.
  4544. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4545. */
  4546. function baseIsTypedArray(value) {
  4547. return isObjectLike(value) &&
  4548. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4549. }
  4550. /**
  4551. * The base implementation of `_.iteratee`.
  4552. *
  4553. * @private
  4554. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4555. * @returns {Function} Returns the iteratee.
  4556. */
  4557. function baseIteratee(value) {
  4558. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4559. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4560. if (typeof value == 'function') {
  4561. return value;
  4562. }
  4563. if (value == null) {
  4564. return identity;
  4565. }
  4566. if (typeof value == 'object') {
  4567. return isArray(value)
  4568. ? baseMatchesProperty(value[0], value[1])
  4569. : baseMatches(value);
  4570. }
  4571. return property(value);
  4572. }
  4573. /**
  4574. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4575. *
  4576. * @private
  4577. * @param {Object} object The object to query.
  4578. * @returns {Array} Returns the array of property names.
  4579. */
  4580. function baseKeys(object) {
  4581. if (!isPrototype(object)) {
  4582. return nativeKeys(object);
  4583. }
  4584. var result = [];
  4585. for (var key in Object(object)) {
  4586. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4587. result.push(key);
  4588. }
  4589. }
  4590. return result;
  4591. }
  4592. /**
  4593. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4594. *
  4595. * @private
  4596. * @param {Object} object The object to query.
  4597. * @returns {Array} Returns the array of property names.
  4598. */
  4599. function baseKeysIn(object) {
  4600. if (!isObject(object)) {
  4601. return nativeKeysIn(object);
  4602. }
  4603. var isProto = isPrototype(object),
  4604. result = [];
  4605. for (var key in object) {
  4606. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4607. result.push(key);
  4608. }
  4609. }
  4610. return result;
  4611. }
  4612. /**
  4613. * The base implementation of `_.lt` which doesn't coerce arguments.
  4614. *
  4615. * @private
  4616. * @param {*} value The value to compare.
  4617. * @param {*} other The other value to compare.
  4618. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4619. * else `false`.
  4620. */
  4621. function baseLt(value, other) {
  4622. return value < other;
  4623. }
  4624. /**
  4625. * The base implementation of `_.map` without support for iteratee shorthands.
  4626. *
  4627. * @private
  4628. * @param {Array|Object} collection The collection to iterate over.
  4629. * @param {Function} iteratee The function invoked per iteration.
  4630. * @returns {Array} Returns the new mapped array.
  4631. */
  4632. function baseMap(collection, iteratee) {
  4633. var index = -1,
  4634. result = isArrayLike(collection) ? Array(collection.length) : [];
  4635. baseEach(collection, function(value, key, collection) {
  4636. result[++index] = iteratee(value, key, collection);
  4637. });
  4638. return result;
  4639. }
  4640. /**
  4641. * The base implementation of `_.matches` which doesn't clone `source`.
  4642. *
  4643. * @private
  4644. * @param {Object} source The object of property values to match.
  4645. * @returns {Function} Returns the new spec function.
  4646. */
  4647. function baseMatches(source) {
  4648. var matchData = getMatchData(source);
  4649. if (matchData.length == 1 && matchData[0][2]) {
  4650. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4651. }
  4652. return function(object) {
  4653. return object === source || baseIsMatch(object, source, matchData);
  4654. };
  4655. }
  4656. /**
  4657. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4658. *
  4659. * @private
  4660. * @param {string} path The path of the property to get.
  4661. * @param {*} srcValue The value to match.
  4662. * @returns {Function} Returns the new spec function.
  4663. */
  4664. function baseMatchesProperty(path, srcValue) {
  4665. if (isKey(path) && isStrictComparable(srcValue)) {
  4666. return matchesStrictComparable(toKey(path), srcValue);
  4667. }
  4668. return function(object) {
  4669. var objValue = get(object, path);
  4670. return (objValue === undefined && objValue === srcValue)
  4671. ? hasIn(object, path)
  4672. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4673. };
  4674. }
  4675. /**
  4676. * The base implementation of `_.merge` without support for multiple sources.
  4677. *
  4678. * @private
  4679. * @param {Object} object The destination object.
  4680. * @param {Object} source The source object.
  4681. * @param {number} srcIndex The index of `source`.
  4682. * @param {Function} [customizer] The function to customize merged values.
  4683. * @param {Object} [stack] Tracks traversed source values and their merged
  4684. * counterparts.
  4685. */
  4686. function baseMerge(object, source, srcIndex, customizer, stack) {
  4687. if (object === source) {
  4688. return;
  4689. }
  4690. baseFor(source, function(srcValue, key) {
  4691. stack || (stack = new Stack);
  4692. if (isObject(srcValue)) {
  4693. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4694. }
  4695. else {
  4696. var newValue = customizer
  4697. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4698. : undefined;
  4699. if (newValue === undefined) {
  4700. newValue = srcValue;
  4701. }
  4702. assignMergeValue(object, key, newValue);
  4703. }
  4704. }, keysIn);
  4705. }
  4706. /**
  4707. * A specialized version of `baseMerge` for arrays and objects which performs
  4708. * deep merges and tracks traversed objects enabling objects with circular
  4709. * references to be merged.
  4710. *
  4711. * @private
  4712. * @param {Object} object The destination object.
  4713. * @param {Object} source The source object.
  4714. * @param {string} key The key of the value to merge.
  4715. * @param {number} srcIndex The index of `source`.
  4716. * @param {Function} mergeFunc The function to merge values.
  4717. * @param {Function} [customizer] The function to customize assigned values.
  4718. * @param {Object} [stack] Tracks traversed source values and their merged
  4719. * counterparts.
  4720. */
  4721. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4722. var objValue = safeGet(object, key),
  4723. srcValue = safeGet(source, key),
  4724. stacked = stack.get(srcValue);
  4725. if (stacked) {
  4726. assignMergeValue(object, key, stacked);
  4727. return;
  4728. }
  4729. var newValue = customizer
  4730. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4731. : undefined;
  4732. var isCommon = newValue === undefined;
  4733. if (isCommon) {
  4734. var isArr = isArray(srcValue),
  4735. isBuff = !isArr && isBuffer(srcValue),
  4736. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4737. newValue = srcValue;
  4738. if (isArr || isBuff || isTyped) {
  4739. if (isArray(objValue)) {
  4740. newValue = objValue;
  4741. }
  4742. else if (isArrayLikeObject(objValue)) {
  4743. newValue = copyArray(objValue);
  4744. }
  4745. else if (isBuff) {
  4746. isCommon = false;
  4747. newValue = cloneBuffer(srcValue, true);
  4748. }
  4749. else if (isTyped) {
  4750. isCommon = false;
  4751. newValue = cloneTypedArray(srcValue, true);
  4752. }
  4753. else {
  4754. newValue = [];
  4755. }
  4756. }
  4757. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4758. newValue = objValue;
  4759. if (isArguments(objValue)) {
  4760. newValue = toPlainObject(objValue);
  4761. }
  4762. else if (!isObject(objValue) || isFunction(objValue)) {
  4763. newValue = initCloneObject(srcValue);
  4764. }
  4765. }
  4766. else {
  4767. isCommon = false;
  4768. }
  4769. }
  4770. if (isCommon) {
  4771. // Recursively merge objects and arrays (susceptible to call stack limits).
  4772. stack.set(srcValue, newValue);
  4773. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4774. stack['delete'](srcValue);
  4775. }
  4776. assignMergeValue(object, key, newValue);
  4777. }
  4778. /**
  4779. * The base implementation of `_.nth` which doesn't coerce arguments.
  4780. *
  4781. * @private
  4782. * @param {Array} array The array to query.
  4783. * @param {number} n The index of the element to return.
  4784. * @returns {*} Returns the nth element of `array`.
  4785. */
  4786. function baseNth(array, n) {
  4787. var length = array.length;
  4788. if (!length) {
  4789. return;
  4790. }
  4791. n += n < 0 ? length : 0;
  4792. return isIndex(n, length) ? array[n] : undefined;
  4793. }
  4794. /**
  4795. * The base implementation of `_.orderBy` without param guards.
  4796. *
  4797. * @private
  4798. * @param {Array|Object} collection The collection to iterate over.
  4799. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4800. * @param {string[]} orders The sort orders of `iteratees`.
  4801. * @returns {Array} Returns the new sorted array.
  4802. */
  4803. function baseOrderBy(collection, iteratees, orders) {
  4804. if (iteratees.length) {
  4805. iteratees = arrayMap(iteratees, function(iteratee) {
  4806. if (isArray(iteratee)) {
  4807. return function(value) {
  4808. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4809. }
  4810. }
  4811. return iteratee;
  4812. });
  4813. } else {
  4814. iteratees = [identity];
  4815. }
  4816. var index = -1;
  4817. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4818. var result = baseMap(collection, function(value, key, collection) {
  4819. var criteria = arrayMap(iteratees, function(iteratee) {
  4820. return iteratee(value);
  4821. });
  4822. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4823. });
  4824. return baseSortBy(result, function(object, other) {
  4825. return compareMultiple(object, other, orders);
  4826. });
  4827. }
  4828. /**
  4829. * The base implementation of `_.pick` without support for individual
  4830. * property identifiers.
  4831. *
  4832. * @private
  4833. * @param {Object} object The source object.
  4834. * @param {string[]} paths The property paths to pick.
  4835. * @returns {Object} Returns the new object.
  4836. */
  4837. function basePick(object, paths) {
  4838. return basePickBy(object, paths, function(value, path) {
  4839. return hasIn(object, path);
  4840. });
  4841. }
  4842. /**
  4843. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4844. *
  4845. * @private
  4846. * @param {Object} object The source object.
  4847. * @param {string[]} paths The property paths to pick.
  4848. * @param {Function} predicate The function invoked per property.
  4849. * @returns {Object} Returns the new object.
  4850. */
  4851. function basePickBy(object, paths, predicate) {
  4852. var index = -1,
  4853. length = paths.length,
  4854. result = {};
  4855. while (++index < length) {
  4856. var path = paths[index],
  4857. value = baseGet(object, path);
  4858. if (predicate(value, path)) {
  4859. baseSet(result, castPath(path, object), value);
  4860. }
  4861. }
  4862. return result;
  4863. }
  4864. /**
  4865. * A specialized version of `baseProperty` which supports deep paths.
  4866. *
  4867. * @private
  4868. * @param {Array|string} path The path of the property to get.
  4869. * @returns {Function} Returns the new accessor function.
  4870. */
  4871. function basePropertyDeep(path) {
  4872. return function(object) {
  4873. return baseGet(object, path);
  4874. };
  4875. }
  4876. /**
  4877. * The base implementation of `_.pullAllBy` without support for iteratee
  4878. * shorthands.
  4879. *
  4880. * @private
  4881. * @param {Array} array The array to modify.
  4882. * @param {Array} values The values to remove.
  4883. * @param {Function} [iteratee] The iteratee invoked per element.
  4884. * @param {Function} [comparator] The comparator invoked per element.
  4885. * @returns {Array} Returns `array`.
  4886. */
  4887. function basePullAll(array, values, iteratee, comparator) {
  4888. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4889. index = -1,
  4890. length = values.length,
  4891. seen = array;
  4892. if (array === values) {
  4893. values = copyArray(values);
  4894. }
  4895. if (iteratee) {
  4896. seen = arrayMap(array, baseUnary(iteratee));
  4897. }
  4898. while (++index < length) {
  4899. var fromIndex = 0,
  4900. value = values[index],
  4901. computed = iteratee ? iteratee(value) : value;
  4902. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4903. if (seen !== array) {
  4904. splice.call(seen, fromIndex, 1);
  4905. }
  4906. splice.call(array, fromIndex, 1);
  4907. }
  4908. }
  4909. return array;
  4910. }
  4911. /**
  4912. * The base implementation of `_.pullAt` without support for individual
  4913. * indexes or capturing the removed elements.
  4914. *
  4915. * @private
  4916. * @param {Array} array The array to modify.
  4917. * @param {number[]} indexes The indexes of elements to remove.
  4918. * @returns {Array} Returns `array`.
  4919. */
  4920. function basePullAt(array, indexes) {
  4921. var length = array ? indexes.length : 0,
  4922. lastIndex = length - 1;
  4923. while (length--) {
  4924. var index = indexes[length];
  4925. if (length == lastIndex || index !== previous) {
  4926. var previous = index;
  4927. if (isIndex(index)) {
  4928. splice.call(array, index, 1);
  4929. } else {
  4930. baseUnset(array, index);
  4931. }
  4932. }
  4933. }
  4934. return array;
  4935. }
  4936. /**
  4937. * The base implementation of `_.random` without support for returning
  4938. * floating-point numbers.
  4939. *
  4940. * @private
  4941. * @param {number} lower The lower bound.
  4942. * @param {number} upper The upper bound.
  4943. * @returns {number} Returns the random number.
  4944. */
  4945. function baseRandom(lower, upper) {
  4946. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4947. }
  4948. /**
  4949. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4950. * coerce arguments.
  4951. *
  4952. * @private
  4953. * @param {number} start The start of the range.
  4954. * @param {number} end The end of the range.
  4955. * @param {number} step The value to increment or decrement by.
  4956. * @param {boolean} [fromRight] Specify iterating from right to left.
  4957. * @returns {Array} Returns the range of numbers.
  4958. */
  4959. function baseRange(start, end, step, fromRight) {
  4960. var index = -1,
  4961. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4962. result = Array(length);
  4963. while (length--) {
  4964. result[fromRight ? length : ++index] = start;
  4965. start += step;
  4966. }
  4967. return result;
  4968. }
  4969. /**
  4970. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4971. *
  4972. * @private
  4973. * @param {string} string The string to repeat.
  4974. * @param {number} n The number of times to repeat the string.
  4975. * @returns {string} Returns the repeated string.
  4976. */
  4977. function baseRepeat(string, n) {
  4978. var result = '';
  4979. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4980. return result;
  4981. }
  4982. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4983. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4984. do {
  4985. if (n % 2) {
  4986. result += string;
  4987. }
  4988. n = nativeFloor(n / 2);
  4989. if (n) {
  4990. string += string;
  4991. }
  4992. } while (n);
  4993. return result;
  4994. }
  4995. /**
  4996. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4997. *
  4998. * @private
  4999. * @param {Function} func The function to apply a rest parameter to.
  5000. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5001. * @returns {Function} Returns the new function.
  5002. */
  5003. function baseRest(func, start) {
  5004. return setToString(overRest(func, start, identity), func + '');
  5005. }
  5006. /**
  5007. * The base implementation of `_.sample`.
  5008. *
  5009. * @private
  5010. * @param {Array|Object} collection The collection to sample.
  5011. * @returns {*} Returns the random element.
  5012. */
  5013. function baseSample(collection) {
  5014. return arraySample(values(collection));
  5015. }
  5016. /**
  5017. * The base implementation of `_.sampleSize` without param guards.
  5018. *
  5019. * @private
  5020. * @param {Array|Object} collection The collection to sample.
  5021. * @param {number} n The number of elements to sample.
  5022. * @returns {Array} Returns the random elements.
  5023. */
  5024. function baseSampleSize(collection, n) {
  5025. var array = values(collection);
  5026. return shuffleSelf(array, baseClamp(n, 0, array.length));
  5027. }
  5028. /**
  5029. * The base implementation of `_.set`.
  5030. *
  5031. * @private
  5032. * @param {Object} object The object to modify.
  5033. * @param {Array|string} path The path of the property to set.
  5034. * @param {*} value The value to set.
  5035. * @param {Function} [customizer] The function to customize path creation.
  5036. * @returns {Object} Returns `object`.
  5037. */
  5038. function baseSet(object, path, value, customizer) {
  5039. if (!isObject(object)) {
  5040. return object;
  5041. }
  5042. path = castPath(path, object);
  5043. var index = -1,
  5044. length = path.length,
  5045. lastIndex = length - 1,
  5046. nested = object;
  5047. while (nested != null && ++index < length) {
  5048. var key = toKey(path[index]),
  5049. newValue = value;
  5050. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  5051. return object;
  5052. }
  5053. if (index != lastIndex) {
  5054. var objValue = nested[key];
  5055. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5056. if (newValue === undefined) {
  5057. newValue = isObject(objValue)
  5058. ? objValue
  5059. : (isIndex(path[index + 1]) ? [] : {});
  5060. }
  5061. }
  5062. assignValue(nested, key, newValue);
  5063. nested = nested[key];
  5064. }
  5065. return object;
  5066. }
  5067. /**
  5068. * The base implementation of `setData` without support for hot loop shorting.
  5069. *
  5070. * @private
  5071. * @param {Function} func The function to associate metadata with.
  5072. * @param {*} data The metadata.
  5073. * @returns {Function} Returns `func`.
  5074. */
  5075. var baseSetData = !metaMap ? identity : function(func, data) {
  5076. metaMap.set(func, data);
  5077. return func;
  5078. };
  5079. /**
  5080. * The base implementation of `setToString` without support for hot loop shorting.
  5081. *
  5082. * @private
  5083. * @param {Function} func The function to modify.
  5084. * @param {Function} string The `toString` result.
  5085. * @returns {Function} Returns `func`.
  5086. */
  5087. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5088. return defineProperty(func, 'toString', {
  5089. 'configurable': true,
  5090. 'enumerable': false,
  5091. 'value': constant(string),
  5092. 'writable': true
  5093. });
  5094. };
  5095. /**
  5096. * The base implementation of `_.shuffle`.
  5097. *
  5098. * @private
  5099. * @param {Array|Object} collection The collection to shuffle.
  5100. * @returns {Array} Returns the new shuffled array.
  5101. */
  5102. function baseShuffle(collection) {
  5103. return shuffleSelf(values(collection));
  5104. }
  5105. /**
  5106. * The base implementation of `_.slice` without an iteratee call guard.
  5107. *
  5108. * @private
  5109. * @param {Array} array The array to slice.
  5110. * @param {number} [start=0] The start position.
  5111. * @param {number} [end=array.length] The end position.
  5112. * @returns {Array} Returns the slice of `array`.
  5113. */
  5114. function baseSlice(array, start, end) {
  5115. var index = -1,
  5116. length = array.length;
  5117. if (start < 0) {
  5118. start = -start > length ? 0 : (length + start);
  5119. }
  5120. end = end > length ? length : end;
  5121. if (end < 0) {
  5122. end += length;
  5123. }
  5124. length = start > end ? 0 : ((end - start) >>> 0);
  5125. start >>>= 0;
  5126. var result = Array(length);
  5127. while (++index < length) {
  5128. result[index] = array[index + start];
  5129. }
  5130. return result;
  5131. }
  5132. /**
  5133. * The base implementation of `_.some` without support for iteratee shorthands.
  5134. *
  5135. * @private
  5136. * @param {Array|Object} collection The collection to iterate over.
  5137. * @param {Function} predicate The function invoked per iteration.
  5138. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5139. * else `false`.
  5140. */
  5141. function baseSome(collection, predicate) {
  5142. var result;
  5143. baseEach(collection, function(value, index, collection) {
  5144. result = predicate(value, index, collection);
  5145. return !result;
  5146. });
  5147. return !!result;
  5148. }
  5149. /**
  5150. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5151. * performs a binary search of `array` to determine the index at which `value`
  5152. * should be inserted into `array` in order to maintain its sort order.
  5153. *
  5154. * @private
  5155. * @param {Array} array The sorted array to inspect.
  5156. * @param {*} value The value to evaluate.
  5157. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5158. * @returns {number} Returns the index at which `value` should be inserted
  5159. * into `array`.
  5160. */
  5161. function baseSortedIndex(array, value, retHighest) {
  5162. var low = 0,
  5163. high = array == null ? low : array.length;
  5164. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5165. while (low < high) {
  5166. var mid = (low + high) >>> 1,
  5167. computed = array[mid];
  5168. if (computed !== null && !isSymbol(computed) &&
  5169. (retHighest ? (computed <= value) : (computed < value))) {
  5170. low = mid + 1;
  5171. } else {
  5172. high = mid;
  5173. }
  5174. }
  5175. return high;
  5176. }
  5177. return baseSortedIndexBy(array, value, identity, retHighest);
  5178. }
  5179. /**
  5180. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5181. * which invokes `iteratee` for `value` and each element of `array` to compute
  5182. * their sort ranking. The iteratee is invoked with one argument; (value).
  5183. *
  5184. * @private
  5185. * @param {Array} array The sorted array to inspect.
  5186. * @param {*} value The value to evaluate.
  5187. * @param {Function} iteratee The iteratee invoked per element.
  5188. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5189. * @returns {number} Returns the index at which `value` should be inserted
  5190. * into `array`.
  5191. */
  5192. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5193. var low = 0,
  5194. high = array == null ? 0 : array.length;
  5195. if (high === 0) {
  5196. return 0;
  5197. }
  5198. value = iteratee(value);
  5199. var valIsNaN = value !== value,
  5200. valIsNull = value === null,
  5201. valIsSymbol = isSymbol(value),
  5202. valIsUndefined = value === undefined;
  5203. while (low < high) {
  5204. var mid = nativeFloor((low + high) / 2),
  5205. computed = iteratee(array[mid]),
  5206. othIsDefined = computed !== undefined,
  5207. othIsNull = computed === null,
  5208. othIsReflexive = computed === computed,
  5209. othIsSymbol = isSymbol(computed);
  5210. if (valIsNaN) {
  5211. var setLow = retHighest || othIsReflexive;
  5212. } else if (valIsUndefined) {
  5213. setLow = othIsReflexive && (retHighest || othIsDefined);
  5214. } else if (valIsNull) {
  5215. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5216. } else if (valIsSymbol) {
  5217. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5218. } else if (othIsNull || othIsSymbol) {
  5219. setLow = false;
  5220. } else {
  5221. setLow = retHighest ? (computed <= value) : (computed < value);
  5222. }
  5223. if (setLow) {
  5224. low = mid + 1;
  5225. } else {
  5226. high = mid;
  5227. }
  5228. }
  5229. return nativeMin(high, MAX_ARRAY_INDEX);
  5230. }
  5231. /**
  5232. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5233. * support for iteratee shorthands.
  5234. *
  5235. * @private
  5236. * @param {Array} array The array to inspect.
  5237. * @param {Function} [iteratee] The iteratee invoked per element.
  5238. * @returns {Array} Returns the new duplicate free array.
  5239. */
  5240. function baseSortedUniq(array, iteratee) {
  5241. var index = -1,
  5242. length = array.length,
  5243. resIndex = 0,
  5244. result = [];
  5245. while (++index < length) {
  5246. var value = array[index],
  5247. computed = iteratee ? iteratee(value) : value;
  5248. if (!index || !eq(computed, seen)) {
  5249. var seen = computed;
  5250. result[resIndex++] = value === 0 ? 0 : value;
  5251. }
  5252. }
  5253. return result;
  5254. }
  5255. /**
  5256. * The base implementation of `_.toNumber` which doesn't ensure correct
  5257. * conversions of binary, hexadecimal, or octal string values.
  5258. *
  5259. * @private
  5260. * @param {*} value The value to process.
  5261. * @returns {number} Returns the number.
  5262. */
  5263. function baseToNumber(value) {
  5264. if (typeof value == 'number') {
  5265. return value;
  5266. }
  5267. if (isSymbol(value)) {
  5268. return NAN;
  5269. }
  5270. return +value;
  5271. }
  5272. /**
  5273. * The base implementation of `_.toString` which doesn't convert nullish
  5274. * values to empty strings.
  5275. *
  5276. * @private
  5277. * @param {*} value The value to process.
  5278. * @returns {string} Returns the string.
  5279. */
  5280. function baseToString(value) {
  5281. // Exit early for strings to avoid a performance hit in some environments.
  5282. if (typeof value == 'string') {
  5283. return value;
  5284. }
  5285. if (isArray(value)) {
  5286. // Recursively convert values (susceptible to call stack limits).
  5287. return arrayMap(value, baseToString) + '';
  5288. }
  5289. if (isSymbol(value)) {
  5290. return symbolToString ? symbolToString.call(value) : '';
  5291. }
  5292. var result = (value + '');
  5293. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5294. }
  5295. /**
  5296. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5297. *
  5298. * @private
  5299. * @param {Array} array The array to inspect.
  5300. * @param {Function} [iteratee] The iteratee invoked per element.
  5301. * @param {Function} [comparator] The comparator invoked per element.
  5302. * @returns {Array} Returns the new duplicate free array.
  5303. */
  5304. function baseUniq(array, iteratee, comparator) {
  5305. var index = -1,
  5306. includes = arrayIncludes,
  5307. length = array.length,
  5308. isCommon = true,
  5309. result = [],
  5310. seen = result;
  5311. if (comparator) {
  5312. isCommon = false;
  5313. includes = arrayIncludesWith;
  5314. }
  5315. else if (length >= LARGE_ARRAY_SIZE) {
  5316. var set = iteratee ? null : createSet(array);
  5317. if (set) {
  5318. return setToArray(set);
  5319. }
  5320. isCommon = false;
  5321. includes = cacheHas;
  5322. seen = new SetCache;
  5323. }
  5324. else {
  5325. seen = iteratee ? [] : result;
  5326. }
  5327. outer:
  5328. while (++index < length) {
  5329. var value = array[index],
  5330. computed = iteratee ? iteratee(value) : value;
  5331. value = (comparator || value !== 0) ? value : 0;
  5332. if (isCommon && computed === computed) {
  5333. var seenIndex = seen.length;
  5334. while (seenIndex--) {
  5335. if (seen[seenIndex] === computed) {
  5336. continue outer;
  5337. }
  5338. }
  5339. if (iteratee) {
  5340. seen.push(computed);
  5341. }
  5342. result.push(value);
  5343. }
  5344. else if (!includes(seen, computed, comparator)) {
  5345. if (seen !== result) {
  5346. seen.push(computed);
  5347. }
  5348. result.push(value);
  5349. }
  5350. }
  5351. return result;
  5352. }
  5353. /**
  5354. * The base implementation of `_.unset`.
  5355. *
  5356. * @private
  5357. * @param {Object} object The object to modify.
  5358. * @param {Array|string} path The property path to unset.
  5359. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5360. */
  5361. function baseUnset(object, path) {
  5362. path = castPath(path, object);
  5363. object = parent(object, path);
  5364. return object == null || delete object[toKey(last(path))];
  5365. }
  5366. /**
  5367. * The base implementation of `_.update`.
  5368. *
  5369. * @private
  5370. * @param {Object} object The object to modify.
  5371. * @param {Array|string} path The path of the property to update.
  5372. * @param {Function} updater The function to produce the updated value.
  5373. * @param {Function} [customizer] The function to customize path creation.
  5374. * @returns {Object} Returns `object`.
  5375. */
  5376. function baseUpdate(object, path, updater, customizer) {
  5377. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5378. }
  5379. /**
  5380. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5381. * without support for iteratee shorthands.
  5382. *
  5383. * @private
  5384. * @param {Array} array The array to query.
  5385. * @param {Function} predicate The function invoked per iteration.
  5386. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5387. * @param {boolean} [fromRight] Specify iterating from right to left.
  5388. * @returns {Array} Returns the slice of `array`.
  5389. */
  5390. function baseWhile(array, predicate, isDrop, fromRight) {
  5391. var length = array.length,
  5392. index = fromRight ? length : -1;
  5393. while ((fromRight ? index-- : ++index < length) &&
  5394. predicate(array[index], index, array)) {}
  5395. return isDrop
  5396. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5397. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5398. }
  5399. /**
  5400. * The base implementation of `wrapperValue` which returns the result of
  5401. * performing a sequence of actions on the unwrapped `value`, where each
  5402. * successive action is supplied the return value of the previous.
  5403. *
  5404. * @private
  5405. * @param {*} value The unwrapped value.
  5406. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5407. * @returns {*} Returns the resolved value.
  5408. */
  5409. function baseWrapperValue(value, actions) {
  5410. var result = value;
  5411. if (result instanceof LazyWrapper) {
  5412. result = result.value();
  5413. }
  5414. return arrayReduce(actions, function(result, action) {
  5415. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5416. }, result);
  5417. }
  5418. /**
  5419. * The base implementation of methods like `_.xor`, without support for
  5420. * iteratee shorthands, that accepts an array of arrays to inspect.
  5421. *
  5422. * @private
  5423. * @param {Array} arrays The arrays to inspect.
  5424. * @param {Function} [iteratee] The iteratee invoked per element.
  5425. * @param {Function} [comparator] The comparator invoked per element.
  5426. * @returns {Array} Returns the new array of values.
  5427. */
  5428. function baseXor(arrays, iteratee, comparator) {
  5429. var length = arrays.length;
  5430. if (length < 2) {
  5431. return length ? baseUniq(arrays[0]) : [];
  5432. }
  5433. var index = -1,
  5434. result = Array(length);
  5435. while (++index < length) {
  5436. var array = arrays[index],
  5437. othIndex = -1;
  5438. while (++othIndex < length) {
  5439. if (othIndex != index) {
  5440. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5441. }
  5442. }
  5443. }
  5444. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5445. }
  5446. /**
  5447. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5448. *
  5449. * @private
  5450. * @param {Array} props The property identifiers.
  5451. * @param {Array} values The property values.
  5452. * @param {Function} assignFunc The function to assign values.
  5453. * @returns {Object} Returns the new object.
  5454. */
  5455. function baseZipObject(props, values, assignFunc) {
  5456. var index = -1,
  5457. length = props.length,
  5458. valsLength = values.length,
  5459. result = {};
  5460. while (++index < length) {
  5461. var value = index < valsLength ? values[index] : undefined;
  5462. assignFunc(result, props[index], value);
  5463. }
  5464. return result;
  5465. }
  5466. /**
  5467. * Casts `value` to an empty array if it's not an array like object.
  5468. *
  5469. * @private
  5470. * @param {*} value The value to inspect.
  5471. * @returns {Array|Object} Returns the cast array-like object.
  5472. */
  5473. function castArrayLikeObject(value) {
  5474. return isArrayLikeObject(value) ? value : [];
  5475. }
  5476. /**
  5477. * Casts `value` to `identity` if it's not a function.
  5478. *
  5479. * @private
  5480. * @param {*} value The value to inspect.
  5481. * @returns {Function} Returns cast function.
  5482. */
  5483. function castFunction(value) {
  5484. return typeof value == 'function' ? value : identity;
  5485. }
  5486. /**
  5487. * Casts `value` to a path array if it's not one.
  5488. *
  5489. * @private
  5490. * @param {*} value The value to inspect.
  5491. * @param {Object} [object] The object to query keys on.
  5492. * @returns {Array} Returns the cast property path array.
  5493. */
  5494. function castPath(value, object) {
  5495. if (isArray(value)) {
  5496. return value;
  5497. }
  5498. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5499. }
  5500. /**
  5501. * A `baseRest` alias which can be replaced with `identity` by module
  5502. * replacement plugins.
  5503. *
  5504. * @private
  5505. * @type {Function}
  5506. * @param {Function} func The function to apply a rest parameter to.
  5507. * @returns {Function} Returns the new function.
  5508. */
  5509. var castRest = baseRest;
  5510. /**
  5511. * Casts `array` to a slice if it's needed.
  5512. *
  5513. * @private
  5514. * @param {Array} array The array to inspect.
  5515. * @param {number} start The start position.
  5516. * @param {number} [end=array.length] The end position.
  5517. * @returns {Array} Returns the cast slice.
  5518. */
  5519. function castSlice(array, start, end) {
  5520. var length = array.length;
  5521. end = end === undefined ? length : end;
  5522. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5523. }
  5524. /**
  5525. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5526. *
  5527. * @private
  5528. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5529. */
  5530. var clearTimeout = ctxClearTimeout || function(id) {
  5531. return root.clearTimeout(id);
  5532. };
  5533. /**
  5534. * Creates a clone of `buffer`.
  5535. *
  5536. * @private
  5537. * @param {Buffer} buffer The buffer to clone.
  5538. * @param {boolean} [isDeep] Specify a deep clone.
  5539. * @returns {Buffer} Returns the cloned buffer.
  5540. */
  5541. function cloneBuffer(buffer, isDeep) {
  5542. if (isDeep) {
  5543. return buffer.slice();
  5544. }
  5545. var length = buffer.length,
  5546. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5547. buffer.copy(result);
  5548. return result;
  5549. }
  5550. /**
  5551. * Creates a clone of `arrayBuffer`.
  5552. *
  5553. * @private
  5554. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5555. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5556. */
  5557. function cloneArrayBuffer(arrayBuffer) {
  5558. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5559. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5560. return result;
  5561. }
  5562. /**
  5563. * Creates a clone of `dataView`.
  5564. *
  5565. * @private
  5566. * @param {Object} dataView The data view to clone.
  5567. * @param {boolean} [isDeep] Specify a deep clone.
  5568. * @returns {Object} Returns the cloned data view.
  5569. */
  5570. function cloneDataView(dataView, isDeep) {
  5571. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5572. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5573. }
  5574. /**
  5575. * Creates a clone of `regexp`.
  5576. *
  5577. * @private
  5578. * @param {Object} regexp The regexp to clone.
  5579. * @returns {Object} Returns the cloned regexp.
  5580. */
  5581. function cloneRegExp(regexp) {
  5582. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5583. result.lastIndex = regexp.lastIndex;
  5584. return result;
  5585. }
  5586. /**
  5587. * Creates a clone of the `symbol` object.
  5588. *
  5589. * @private
  5590. * @param {Object} symbol The symbol object to clone.
  5591. * @returns {Object} Returns the cloned symbol object.
  5592. */
  5593. function cloneSymbol(symbol) {
  5594. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5595. }
  5596. /**
  5597. * Creates a clone of `typedArray`.
  5598. *
  5599. * @private
  5600. * @param {Object} typedArray The typed array to clone.
  5601. * @param {boolean} [isDeep] Specify a deep clone.
  5602. * @returns {Object} Returns the cloned typed array.
  5603. */
  5604. function cloneTypedArray(typedArray, isDeep) {
  5605. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5606. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5607. }
  5608. /**
  5609. * Compares values to sort them in ascending order.
  5610. *
  5611. * @private
  5612. * @param {*} value The value to compare.
  5613. * @param {*} other The other value to compare.
  5614. * @returns {number} Returns the sort order indicator for `value`.
  5615. */
  5616. function compareAscending(value, other) {
  5617. if (value !== other) {
  5618. var valIsDefined = value !== undefined,
  5619. valIsNull = value === null,
  5620. valIsReflexive = value === value,
  5621. valIsSymbol = isSymbol(value);
  5622. var othIsDefined = other !== undefined,
  5623. othIsNull = other === null,
  5624. othIsReflexive = other === other,
  5625. othIsSymbol = isSymbol(other);
  5626. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5627. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5628. (valIsNull && othIsDefined && othIsReflexive) ||
  5629. (!valIsDefined && othIsReflexive) ||
  5630. !valIsReflexive) {
  5631. return 1;
  5632. }
  5633. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5634. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5635. (othIsNull && valIsDefined && valIsReflexive) ||
  5636. (!othIsDefined && valIsReflexive) ||
  5637. !othIsReflexive) {
  5638. return -1;
  5639. }
  5640. }
  5641. return 0;
  5642. }
  5643. /**
  5644. * Used by `_.orderBy` to compare multiple properties of a value to another
  5645. * and stable sort them.
  5646. *
  5647. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5648. * specify an order of "desc" for descending or "asc" for ascending sort order
  5649. * of corresponding values.
  5650. *
  5651. * @private
  5652. * @param {Object} object The object to compare.
  5653. * @param {Object} other The other object to compare.
  5654. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5655. * @returns {number} Returns the sort order indicator for `object`.
  5656. */
  5657. function compareMultiple(object, other, orders) {
  5658. var index = -1,
  5659. objCriteria = object.criteria,
  5660. othCriteria = other.criteria,
  5661. length = objCriteria.length,
  5662. ordersLength = orders.length;
  5663. while (++index < length) {
  5664. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5665. if (result) {
  5666. if (index >= ordersLength) {
  5667. return result;
  5668. }
  5669. var order = orders[index];
  5670. return result * (order == 'desc' ? -1 : 1);
  5671. }
  5672. }
  5673. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5674. // that causes it, under certain circumstances, to provide the same value for
  5675. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5676. // for more details.
  5677. //
  5678. // This also ensures a stable sort in V8 and other engines.
  5679. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5680. return object.index - other.index;
  5681. }
  5682. /**
  5683. * Creates an array that is the composition of partially applied arguments,
  5684. * placeholders, and provided arguments into a single array of arguments.
  5685. *
  5686. * @private
  5687. * @param {Array} args The provided arguments.
  5688. * @param {Array} partials The arguments to prepend to those provided.
  5689. * @param {Array} holders The `partials` placeholder indexes.
  5690. * @params {boolean} [isCurried] Specify composing for a curried function.
  5691. * @returns {Array} Returns the new array of composed arguments.
  5692. */
  5693. function composeArgs(args, partials, holders, isCurried) {
  5694. var argsIndex = -1,
  5695. argsLength = args.length,
  5696. holdersLength = holders.length,
  5697. leftIndex = -1,
  5698. leftLength = partials.length,
  5699. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5700. result = Array(leftLength + rangeLength),
  5701. isUncurried = !isCurried;
  5702. while (++leftIndex < leftLength) {
  5703. result[leftIndex] = partials[leftIndex];
  5704. }
  5705. while (++argsIndex < holdersLength) {
  5706. if (isUncurried || argsIndex < argsLength) {
  5707. result[holders[argsIndex]] = args[argsIndex];
  5708. }
  5709. }
  5710. while (rangeLength--) {
  5711. result[leftIndex++] = args[argsIndex++];
  5712. }
  5713. return result;
  5714. }
  5715. /**
  5716. * This function is like `composeArgs` except that the arguments composition
  5717. * is tailored for `_.partialRight`.
  5718. *
  5719. * @private
  5720. * @param {Array} args The provided arguments.
  5721. * @param {Array} partials The arguments to append to those provided.
  5722. * @param {Array} holders The `partials` placeholder indexes.
  5723. * @params {boolean} [isCurried] Specify composing for a curried function.
  5724. * @returns {Array} Returns the new array of composed arguments.
  5725. */
  5726. function composeArgsRight(args, partials, holders, isCurried) {
  5727. var argsIndex = -1,
  5728. argsLength = args.length,
  5729. holdersIndex = -1,
  5730. holdersLength = holders.length,
  5731. rightIndex = -1,
  5732. rightLength = partials.length,
  5733. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5734. result = Array(rangeLength + rightLength),
  5735. isUncurried = !isCurried;
  5736. while (++argsIndex < rangeLength) {
  5737. result[argsIndex] = args[argsIndex];
  5738. }
  5739. var offset = argsIndex;
  5740. while (++rightIndex < rightLength) {
  5741. result[offset + rightIndex] = partials[rightIndex];
  5742. }
  5743. while (++holdersIndex < holdersLength) {
  5744. if (isUncurried || argsIndex < argsLength) {
  5745. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5746. }
  5747. }
  5748. return result;
  5749. }
  5750. /**
  5751. * Copies the values of `source` to `array`.
  5752. *
  5753. * @private
  5754. * @param {Array} source The array to copy values from.
  5755. * @param {Array} [array=[]] The array to copy values to.
  5756. * @returns {Array} Returns `array`.
  5757. */
  5758. function copyArray(source, array) {
  5759. var index = -1,
  5760. length = source.length;
  5761. array || (array = Array(length));
  5762. while (++index < length) {
  5763. array[index] = source[index];
  5764. }
  5765. return array;
  5766. }
  5767. /**
  5768. * Copies properties of `source` to `object`.
  5769. *
  5770. * @private
  5771. * @param {Object} source The object to copy properties from.
  5772. * @param {Array} props The property identifiers to copy.
  5773. * @param {Object} [object={}] The object to copy properties to.
  5774. * @param {Function} [customizer] The function to customize copied values.
  5775. * @returns {Object} Returns `object`.
  5776. */
  5777. function copyObject(source, props, object, customizer) {
  5778. var isNew = !object;
  5779. object || (object = {});
  5780. var index = -1,
  5781. length = props.length;
  5782. while (++index < length) {
  5783. var key = props[index];
  5784. var newValue = customizer
  5785. ? customizer(object[key], source[key], key, object, source)
  5786. : undefined;
  5787. if (newValue === undefined) {
  5788. newValue = source[key];
  5789. }
  5790. if (isNew) {
  5791. baseAssignValue(object, key, newValue);
  5792. } else {
  5793. assignValue(object, key, newValue);
  5794. }
  5795. }
  5796. return object;
  5797. }
  5798. /**
  5799. * Copies own symbols of `source` to `object`.
  5800. *
  5801. * @private
  5802. * @param {Object} source The object to copy symbols from.
  5803. * @param {Object} [object={}] The object to copy symbols to.
  5804. * @returns {Object} Returns `object`.
  5805. */
  5806. function copySymbols(source, object) {
  5807. return copyObject(source, getSymbols(source), object);
  5808. }
  5809. /**
  5810. * Copies own and inherited symbols of `source` to `object`.
  5811. *
  5812. * @private
  5813. * @param {Object} source The object to copy symbols from.
  5814. * @param {Object} [object={}] The object to copy symbols to.
  5815. * @returns {Object} Returns `object`.
  5816. */
  5817. function copySymbolsIn(source, object) {
  5818. return copyObject(source, getSymbolsIn(source), object);
  5819. }
  5820. /**
  5821. * Creates a function like `_.groupBy`.
  5822. *
  5823. * @private
  5824. * @param {Function} setter The function to set accumulator values.
  5825. * @param {Function} [initializer] The accumulator object initializer.
  5826. * @returns {Function} Returns the new aggregator function.
  5827. */
  5828. function createAggregator(setter, initializer) {
  5829. return function(collection, iteratee) {
  5830. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5831. accumulator = initializer ? initializer() : {};
  5832. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5833. };
  5834. }
  5835. /**
  5836. * Creates a function like `_.assign`.
  5837. *
  5838. * @private
  5839. * @param {Function} assigner The function to assign values.
  5840. * @returns {Function} Returns the new assigner function.
  5841. */
  5842. function createAssigner(assigner) {
  5843. return baseRest(function(object, sources) {
  5844. var index = -1,
  5845. length = sources.length,
  5846. customizer = length > 1 ? sources[length - 1] : undefined,
  5847. guard = length > 2 ? sources[2] : undefined;
  5848. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5849. ? (length--, customizer)
  5850. : undefined;
  5851. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5852. customizer = length < 3 ? undefined : customizer;
  5853. length = 1;
  5854. }
  5855. object = Object(object);
  5856. while (++index < length) {
  5857. var source = sources[index];
  5858. if (source) {
  5859. assigner(object, source, index, customizer);
  5860. }
  5861. }
  5862. return object;
  5863. });
  5864. }
  5865. /**
  5866. * Creates a `baseEach` or `baseEachRight` function.
  5867. *
  5868. * @private
  5869. * @param {Function} eachFunc The function to iterate over a collection.
  5870. * @param {boolean} [fromRight] Specify iterating from right to left.
  5871. * @returns {Function} Returns the new base function.
  5872. */
  5873. function createBaseEach(eachFunc, fromRight) {
  5874. return function(collection, iteratee) {
  5875. if (collection == null) {
  5876. return collection;
  5877. }
  5878. if (!isArrayLike(collection)) {
  5879. return eachFunc(collection, iteratee);
  5880. }
  5881. var length = collection.length,
  5882. index = fromRight ? length : -1,
  5883. iterable = Object(collection);
  5884. while ((fromRight ? index-- : ++index < length)) {
  5885. if (iteratee(iterable[index], index, iterable) === false) {
  5886. break;
  5887. }
  5888. }
  5889. return collection;
  5890. };
  5891. }
  5892. /**
  5893. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5894. *
  5895. * @private
  5896. * @param {boolean} [fromRight] Specify iterating from right to left.
  5897. * @returns {Function} Returns the new base function.
  5898. */
  5899. function createBaseFor(fromRight) {
  5900. return function(object, iteratee, keysFunc) {
  5901. var index = -1,
  5902. iterable = Object(object),
  5903. props = keysFunc(object),
  5904. length = props.length;
  5905. while (length--) {
  5906. var key = props[fromRight ? length : ++index];
  5907. if (iteratee(iterable[key], key, iterable) === false) {
  5908. break;
  5909. }
  5910. }
  5911. return object;
  5912. };
  5913. }
  5914. /**
  5915. * Creates a function that wraps `func` to invoke it with the optional `this`
  5916. * binding of `thisArg`.
  5917. *
  5918. * @private
  5919. * @param {Function} func The function to wrap.
  5920. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5921. * @param {*} [thisArg] The `this` binding of `func`.
  5922. * @returns {Function} Returns the new wrapped function.
  5923. */
  5924. function createBind(func, bitmask, thisArg) {
  5925. var isBind = bitmask & WRAP_BIND_FLAG,
  5926. Ctor = createCtor(func);
  5927. function wrapper() {
  5928. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5929. return fn.apply(isBind ? thisArg : this, arguments);
  5930. }
  5931. return wrapper;
  5932. }
  5933. /**
  5934. * Creates a function like `_.lowerFirst`.
  5935. *
  5936. * @private
  5937. * @param {string} methodName The name of the `String` case method to use.
  5938. * @returns {Function} Returns the new case function.
  5939. */
  5940. function createCaseFirst(methodName) {
  5941. return function(string) {
  5942. string = toString(string);
  5943. var strSymbols = hasUnicode(string)
  5944. ? stringToArray(string)
  5945. : undefined;
  5946. var chr = strSymbols
  5947. ? strSymbols[0]
  5948. : string.charAt(0);
  5949. var trailing = strSymbols
  5950. ? castSlice(strSymbols, 1).join('')
  5951. : string.slice(1);
  5952. return chr[methodName]() + trailing;
  5953. };
  5954. }
  5955. /**
  5956. * Creates a function like `_.camelCase`.
  5957. *
  5958. * @private
  5959. * @param {Function} callback The function to combine each word.
  5960. * @returns {Function} Returns the new compounder function.
  5961. */
  5962. function createCompounder(callback) {
  5963. return function(string) {
  5964. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5965. };
  5966. }
  5967. /**
  5968. * Creates a function that produces an instance of `Ctor` regardless of
  5969. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5970. *
  5971. * @private
  5972. * @param {Function} Ctor The constructor to wrap.
  5973. * @returns {Function} Returns the new wrapped function.
  5974. */
  5975. function createCtor(Ctor) {
  5976. return function() {
  5977. // Use a `switch` statement to work with class constructors. See
  5978. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5979. // for more details.
  5980. var args = arguments;
  5981. switch (args.length) {
  5982. case 0: return new Ctor;
  5983. case 1: return new Ctor(args[0]);
  5984. case 2: return new Ctor(args[0], args[1]);
  5985. case 3: return new Ctor(args[0], args[1], args[2]);
  5986. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5987. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5988. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5989. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5990. }
  5991. var thisBinding = baseCreate(Ctor.prototype),
  5992. result = Ctor.apply(thisBinding, args);
  5993. // Mimic the constructor's `return` behavior.
  5994. // See https://es5.github.io/#x13.2.2 for more details.
  5995. return isObject(result) ? result : thisBinding;
  5996. };
  5997. }
  5998. /**
  5999. * Creates a function that wraps `func` to enable currying.
  6000. *
  6001. * @private
  6002. * @param {Function} func The function to wrap.
  6003. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6004. * @param {number} arity The arity of `func`.
  6005. * @returns {Function} Returns the new wrapped function.
  6006. */
  6007. function createCurry(func, bitmask, arity) {
  6008. var Ctor = createCtor(func);
  6009. function wrapper() {
  6010. var length = arguments.length,
  6011. args = Array(length),
  6012. index = length,
  6013. placeholder = getHolder(wrapper);
  6014. while (index--) {
  6015. args[index] = arguments[index];
  6016. }
  6017. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  6018. ? []
  6019. : replaceHolders(args, placeholder);
  6020. length -= holders.length;
  6021. if (length < arity) {
  6022. return createRecurry(
  6023. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  6024. args, holders, undefined, undefined, arity - length);
  6025. }
  6026. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6027. return apply(fn, this, args);
  6028. }
  6029. return wrapper;
  6030. }
  6031. /**
  6032. * Creates a `_.find` or `_.findLast` function.
  6033. *
  6034. * @private
  6035. * @param {Function} findIndexFunc The function to find the collection index.
  6036. * @returns {Function} Returns the new find function.
  6037. */
  6038. function createFind(findIndexFunc) {
  6039. return function(collection, predicate, fromIndex) {
  6040. var iterable = Object(collection);
  6041. if (!isArrayLike(collection)) {
  6042. var iteratee = getIteratee(predicate, 3);
  6043. collection = keys(collection);
  6044. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  6045. }
  6046. var index = findIndexFunc(collection, predicate, fromIndex);
  6047. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  6048. };
  6049. }
  6050. /**
  6051. * Creates a `_.flow` or `_.flowRight` function.
  6052. *
  6053. * @private
  6054. * @param {boolean} [fromRight] Specify iterating from right to left.
  6055. * @returns {Function} Returns the new flow function.
  6056. */
  6057. function createFlow(fromRight) {
  6058. return flatRest(function(funcs) {
  6059. var length = funcs.length,
  6060. index = length,
  6061. prereq = LodashWrapper.prototype.thru;
  6062. if (fromRight) {
  6063. funcs.reverse();
  6064. }
  6065. while (index--) {
  6066. var func = funcs[index];
  6067. if (typeof func != 'function') {
  6068. throw new TypeError(FUNC_ERROR_TEXT);
  6069. }
  6070. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6071. var wrapper = new LodashWrapper([], true);
  6072. }
  6073. }
  6074. index = wrapper ? index : length;
  6075. while (++index < length) {
  6076. func = funcs[index];
  6077. var funcName = getFuncName(func),
  6078. data = funcName == 'wrapper' ? getData(func) : undefined;
  6079. if (data && isLaziable(data[0]) &&
  6080. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6081. !data[4].length && data[9] == 1
  6082. ) {
  6083. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6084. } else {
  6085. wrapper = (func.length == 1 && isLaziable(func))
  6086. ? wrapper[funcName]()
  6087. : wrapper.thru(func);
  6088. }
  6089. }
  6090. return function() {
  6091. var args = arguments,
  6092. value = args[0];
  6093. if (wrapper && args.length == 1 && isArray(value)) {
  6094. return wrapper.plant(value).value();
  6095. }
  6096. var index = 0,
  6097. result = length ? funcs[index].apply(this, args) : value;
  6098. while (++index < length) {
  6099. result = funcs[index].call(this, result);
  6100. }
  6101. return result;
  6102. };
  6103. });
  6104. }
  6105. /**
  6106. * Creates a function that wraps `func` to invoke it with optional `this`
  6107. * binding of `thisArg`, partial application, and currying.
  6108. *
  6109. * @private
  6110. * @param {Function|string} func The function or method name to wrap.
  6111. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6112. * @param {*} [thisArg] The `this` binding of `func`.
  6113. * @param {Array} [partials] The arguments to prepend to those provided to
  6114. * the new function.
  6115. * @param {Array} [holders] The `partials` placeholder indexes.
  6116. * @param {Array} [partialsRight] The arguments to append to those provided
  6117. * to the new function.
  6118. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6119. * @param {Array} [argPos] The argument positions of the new function.
  6120. * @param {number} [ary] The arity cap of `func`.
  6121. * @param {number} [arity] The arity of `func`.
  6122. * @returns {Function} Returns the new wrapped function.
  6123. */
  6124. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6125. var isAry = bitmask & WRAP_ARY_FLAG,
  6126. isBind = bitmask & WRAP_BIND_FLAG,
  6127. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6128. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6129. isFlip = bitmask & WRAP_FLIP_FLAG,
  6130. Ctor = isBindKey ? undefined : createCtor(func);
  6131. function wrapper() {
  6132. var length = arguments.length,
  6133. args = Array(length),
  6134. index = length;
  6135. while (index--) {
  6136. args[index] = arguments[index];
  6137. }
  6138. if (isCurried) {
  6139. var placeholder = getHolder(wrapper),
  6140. holdersCount = countHolders(args, placeholder);
  6141. }
  6142. if (partials) {
  6143. args = composeArgs(args, partials, holders, isCurried);
  6144. }
  6145. if (partialsRight) {
  6146. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6147. }
  6148. length -= holdersCount;
  6149. if (isCurried && length < arity) {
  6150. var newHolders = replaceHolders(args, placeholder);
  6151. return createRecurry(
  6152. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6153. args, newHolders, argPos, ary, arity - length
  6154. );
  6155. }
  6156. var thisBinding = isBind ? thisArg : this,
  6157. fn = isBindKey ? thisBinding[func] : func;
  6158. length = args.length;
  6159. if (argPos) {
  6160. args = reorder(args, argPos);
  6161. } else if (isFlip && length > 1) {
  6162. args.reverse();
  6163. }
  6164. if (isAry && ary < length) {
  6165. args.length = ary;
  6166. }
  6167. if (this && this !== root && this instanceof wrapper) {
  6168. fn = Ctor || createCtor(fn);
  6169. }
  6170. return fn.apply(thisBinding, args);
  6171. }
  6172. return wrapper;
  6173. }
  6174. /**
  6175. * Creates a function like `_.invertBy`.
  6176. *
  6177. * @private
  6178. * @param {Function} setter The function to set accumulator values.
  6179. * @param {Function} toIteratee The function to resolve iteratees.
  6180. * @returns {Function} Returns the new inverter function.
  6181. */
  6182. function createInverter(setter, toIteratee) {
  6183. return function(object, iteratee) {
  6184. return baseInverter(object, setter, toIteratee(iteratee), {});
  6185. };
  6186. }
  6187. /**
  6188. * Creates a function that performs a mathematical operation on two values.
  6189. *
  6190. * @private
  6191. * @param {Function} operator The function to perform the operation.
  6192. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6193. * @returns {Function} Returns the new mathematical operation function.
  6194. */
  6195. function createMathOperation(operator, defaultValue) {
  6196. return function(value, other) {
  6197. var result;
  6198. if (value === undefined && other === undefined) {
  6199. return defaultValue;
  6200. }
  6201. if (value !== undefined) {
  6202. result = value;
  6203. }
  6204. if (other !== undefined) {
  6205. if (result === undefined) {
  6206. return other;
  6207. }
  6208. if (typeof value == 'string' || typeof other == 'string') {
  6209. value = baseToString(value);
  6210. other = baseToString(other);
  6211. } else {
  6212. value = baseToNumber(value);
  6213. other = baseToNumber(other);
  6214. }
  6215. result = operator(value, other);
  6216. }
  6217. return result;
  6218. };
  6219. }
  6220. /**
  6221. * Creates a function like `_.over`.
  6222. *
  6223. * @private
  6224. * @param {Function} arrayFunc The function to iterate over iteratees.
  6225. * @returns {Function} Returns the new over function.
  6226. */
  6227. function createOver(arrayFunc) {
  6228. return flatRest(function(iteratees) {
  6229. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6230. return baseRest(function(args) {
  6231. var thisArg = this;
  6232. return arrayFunc(iteratees, function(iteratee) {
  6233. return apply(iteratee, thisArg, args);
  6234. });
  6235. });
  6236. });
  6237. }
  6238. /**
  6239. * Creates the padding for `string` based on `length`. The `chars` string
  6240. * is truncated if the number of characters exceeds `length`.
  6241. *
  6242. * @private
  6243. * @param {number} length The padding length.
  6244. * @param {string} [chars=' '] The string used as padding.
  6245. * @returns {string} Returns the padding for `string`.
  6246. */
  6247. function createPadding(length, chars) {
  6248. chars = chars === undefined ? ' ' : baseToString(chars);
  6249. var charsLength = chars.length;
  6250. if (charsLength < 2) {
  6251. return charsLength ? baseRepeat(chars, length) : chars;
  6252. }
  6253. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6254. return hasUnicode(chars)
  6255. ? castSlice(stringToArray(result), 0, length).join('')
  6256. : result.slice(0, length);
  6257. }
  6258. /**
  6259. * Creates a function that wraps `func` to invoke it with the `this` binding
  6260. * of `thisArg` and `partials` prepended to the arguments it receives.
  6261. *
  6262. * @private
  6263. * @param {Function} func The function to wrap.
  6264. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6265. * @param {*} thisArg The `this` binding of `func`.
  6266. * @param {Array} partials The arguments to prepend to those provided to
  6267. * the new function.
  6268. * @returns {Function} Returns the new wrapped function.
  6269. */
  6270. function createPartial(func, bitmask, thisArg, partials) {
  6271. var isBind = bitmask & WRAP_BIND_FLAG,
  6272. Ctor = createCtor(func);
  6273. function wrapper() {
  6274. var argsIndex = -1,
  6275. argsLength = arguments.length,
  6276. leftIndex = -1,
  6277. leftLength = partials.length,
  6278. args = Array(leftLength + argsLength),
  6279. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6280. while (++leftIndex < leftLength) {
  6281. args[leftIndex] = partials[leftIndex];
  6282. }
  6283. while (argsLength--) {
  6284. args[leftIndex++] = arguments[++argsIndex];
  6285. }
  6286. return apply(fn, isBind ? thisArg : this, args);
  6287. }
  6288. return wrapper;
  6289. }
  6290. /**
  6291. * Creates a `_.range` or `_.rangeRight` function.
  6292. *
  6293. * @private
  6294. * @param {boolean} [fromRight] Specify iterating from right to left.
  6295. * @returns {Function} Returns the new range function.
  6296. */
  6297. function createRange(fromRight) {
  6298. return function(start, end, step) {
  6299. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6300. end = step = undefined;
  6301. }
  6302. // Ensure the sign of `-0` is preserved.
  6303. start = toFinite(start);
  6304. if (end === undefined) {
  6305. end = start;
  6306. start = 0;
  6307. } else {
  6308. end = toFinite(end);
  6309. }
  6310. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6311. return baseRange(start, end, step, fromRight);
  6312. };
  6313. }
  6314. /**
  6315. * Creates a function that performs a relational operation on two values.
  6316. *
  6317. * @private
  6318. * @param {Function} operator The function to perform the operation.
  6319. * @returns {Function} Returns the new relational operation function.
  6320. */
  6321. function createRelationalOperation(operator) {
  6322. return function(value, other) {
  6323. if (!(typeof value == 'string' && typeof other == 'string')) {
  6324. value = toNumber(value);
  6325. other = toNumber(other);
  6326. }
  6327. return operator(value, other);
  6328. };
  6329. }
  6330. /**
  6331. * Creates a function that wraps `func` to continue currying.
  6332. *
  6333. * @private
  6334. * @param {Function} func The function to wrap.
  6335. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6336. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6337. * @param {*} placeholder The placeholder value.
  6338. * @param {*} [thisArg] The `this` binding of `func`.
  6339. * @param {Array} [partials] The arguments to prepend to those provided to
  6340. * the new function.
  6341. * @param {Array} [holders] The `partials` placeholder indexes.
  6342. * @param {Array} [argPos] The argument positions of the new function.
  6343. * @param {number} [ary] The arity cap of `func`.
  6344. * @param {number} [arity] The arity of `func`.
  6345. * @returns {Function} Returns the new wrapped function.
  6346. */
  6347. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6348. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6349. newHolders = isCurry ? holders : undefined,
  6350. newHoldersRight = isCurry ? undefined : holders,
  6351. newPartials = isCurry ? partials : undefined,
  6352. newPartialsRight = isCurry ? undefined : partials;
  6353. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6354. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6355. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6356. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6357. }
  6358. var newData = [
  6359. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6360. newHoldersRight, argPos, ary, arity
  6361. ];
  6362. var result = wrapFunc.apply(undefined, newData);
  6363. if (isLaziable(func)) {
  6364. setData(result, newData);
  6365. }
  6366. result.placeholder = placeholder;
  6367. return setWrapToString(result, func, bitmask);
  6368. }
  6369. /**
  6370. * Creates a function like `_.round`.
  6371. *
  6372. * @private
  6373. * @param {string} methodName The name of the `Math` method to use when rounding.
  6374. * @returns {Function} Returns the new round function.
  6375. */
  6376. function createRound(methodName) {
  6377. var func = Math[methodName];
  6378. return function(number, precision) {
  6379. number = toNumber(number);
  6380. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6381. if (precision && nativeIsFinite(number)) {
  6382. // Shift with exponential notation to avoid floating-point issues.
  6383. // See [MDN](https://mdn.io/round#Examples) for more details.
  6384. var pair = (toString(number) + 'e').split('e'),
  6385. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6386. pair = (toString(value) + 'e').split('e');
  6387. return +(pair[0] + 'e' + (+pair[1] - precision));
  6388. }
  6389. return func(number);
  6390. };
  6391. }
  6392. /**
  6393. * Creates a set object of `values`.
  6394. *
  6395. * @private
  6396. * @param {Array} values The values to add to the set.
  6397. * @returns {Object} Returns the new set.
  6398. */
  6399. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6400. return new Set(values);
  6401. };
  6402. /**
  6403. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6404. *
  6405. * @private
  6406. * @param {Function} keysFunc The function to get the keys of a given object.
  6407. * @returns {Function} Returns the new pairs function.
  6408. */
  6409. function createToPairs(keysFunc) {
  6410. return function(object) {
  6411. var tag = getTag(object);
  6412. if (tag == mapTag) {
  6413. return mapToArray(object);
  6414. }
  6415. if (tag == setTag) {
  6416. return setToPairs(object);
  6417. }
  6418. return baseToPairs(object, keysFunc(object));
  6419. };
  6420. }
  6421. /**
  6422. * Creates a function that either curries or invokes `func` with optional
  6423. * `this` binding and partially applied arguments.
  6424. *
  6425. * @private
  6426. * @param {Function|string} func The function or method name to wrap.
  6427. * @param {number} bitmask The bitmask flags.
  6428. * 1 - `_.bind`
  6429. * 2 - `_.bindKey`
  6430. * 4 - `_.curry` or `_.curryRight` of a bound function
  6431. * 8 - `_.curry`
  6432. * 16 - `_.curryRight`
  6433. * 32 - `_.partial`
  6434. * 64 - `_.partialRight`
  6435. * 128 - `_.rearg`
  6436. * 256 - `_.ary`
  6437. * 512 - `_.flip`
  6438. * @param {*} [thisArg] The `this` binding of `func`.
  6439. * @param {Array} [partials] The arguments to be partially applied.
  6440. * @param {Array} [holders] The `partials` placeholder indexes.
  6441. * @param {Array} [argPos] The argument positions of the new function.
  6442. * @param {number} [ary] The arity cap of `func`.
  6443. * @param {number} [arity] The arity of `func`.
  6444. * @returns {Function} Returns the new wrapped function.
  6445. */
  6446. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6447. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6448. if (!isBindKey && typeof func != 'function') {
  6449. throw new TypeError(FUNC_ERROR_TEXT);
  6450. }
  6451. var length = partials ? partials.length : 0;
  6452. if (!length) {
  6453. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6454. partials = holders = undefined;
  6455. }
  6456. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6457. arity = arity === undefined ? arity : toInteger(arity);
  6458. length -= holders ? holders.length : 0;
  6459. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6460. var partialsRight = partials,
  6461. holdersRight = holders;
  6462. partials = holders = undefined;
  6463. }
  6464. var data = isBindKey ? undefined : getData(func);
  6465. var newData = [
  6466. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6467. argPos, ary, arity
  6468. ];
  6469. if (data) {
  6470. mergeData(newData, data);
  6471. }
  6472. func = newData[0];
  6473. bitmask = newData[1];
  6474. thisArg = newData[2];
  6475. partials = newData[3];
  6476. holders = newData[4];
  6477. arity = newData[9] = newData[9] === undefined
  6478. ? (isBindKey ? 0 : func.length)
  6479. : nativeMax(newData[9] - length, 0);
  6480. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6481. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6482. }
  6483. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6484. var result = createBind(func, bitmask, thisArg);
  6485. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6486. result = createCurry(func, bitmask, arity);
  6487. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6488. result = createPartial(func, bitmask, thisArg, partials);
  6489. } else {
  6490. result = createHybrid.apply(undefined, newData);
  6491. }
  6492. var setter = data ? baseSetData : setData;
  6493. return setWrapToString(setter(result, newData), func, bitmask);
  6494. }
  6495. /**
  6496. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6497. * of source objects to the destination object for all destination properties
  6498. * that resolve to `undefined`.
  6499. *
  6500. * @private
  6501. * @param {*} objValue The destination value.
  6502. * @param {*} srcValue The source value.
  6503. * @param {string} key The key of the property to assign.
  6504. * @param {Object} object The parent object of `objValue`.
  6505. * @returns {*} Returns the value to assign.
  6506. */
  6507. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6508. if (objValue === undefined ||
  6509. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6510. return srcValue;
  6511. }
  6512. return objValue;
  6513. }
  6514. /**
  6515. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6516. * objects into destination objects that are passed thru.
  6517. *
  6518. * @private
  6519. * @param {*} objValue The destination value.
  6520. * @param {*} srcValue The source value.
  6521. * @param {string} key The key of the property to merge.
  6522. * @param {Object} object The parent object of `objValue`.
  6523. * @param {Object} source The parent object of `srcValue`.
  6524. * @param {Object} [stack] Tracks traversed source values and their merged
  6525. * counterparts.
  6526. * @returns {*} Returns the value to assign.
  6527. */
  6528. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6529. if (isObject(objValue) && isObject(srcValue)) {
  6530. // Recursively merge objects and arrays (susceptible to call stack limits).
  6531. stack.set(srcValue, objValue);
  6532. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6533. stack['delete'](srcValue);
  6534. }
  6535. return objValue;
  6536. }
  6537. /**
  6538. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6539. * objects.
  6540. *
  6541. * @private
  6542. * @param {*} value The value to inspect.
  6543. * @param {string} key The key of the property to inspect.
  6544. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6545. */
  6546. function customOmitClone(value) {
  6547. return isPlainObject(value) ? undefined : value;
  6548. }
  6549. /**
  6550. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6551. * partial deep comparisons.
  6552. *
  6553. * @private
  6554. * @param {Array} array The array to compare.
  6555. * @param {Array} other The other array to compare.
  6556. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6557. * @param {Function} customizer The function to customize comparisons.
  6558. * @param {Function} equalFunc The function to determine equivalents of values.
  6559. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6560. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6561. */
  6562. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6563. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6564. arrLength = array.length,
  6565. othLength = other.length;
  6566. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6567. return false;
  6568. }
  6569. // Check that cyclic values are equal.
  6570. var arrStacked = stack.get(array);
  6571. var othStacked = stack.get(other);
  6572. if (arrStacked && othStacked) {
  6573. return arrStacked == other && othStacked == array;
  6574. }
  6575. var index = -1,
  6576. result = true,
  6577. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6578. stack.set(array, other);
  6579. stack.set(other, array);
  6580. // Ignore non-index properties.
  6581. while (++index < arrLength) {
  6582. var arrValue = array[index],
  6583. othValue = other[index];
  6584. if (customizer) {
  6585. var compared = isPartial
  6586. ? customizer(othValue, arrValue, index, other, array, stack)
  6587. : customizer(arrValue, othValue, index, array, other, stack);
  6588. }
  6589. if (compared !== undefined) {
  6590. if (compared) {
  6591. continue;
  6592. }
  6593. result = false;
  6594. break;
  6595. }
  6596. // Recursively compare arrays (susceptible to call stack limits).
  6597. if (seen) {
  6598. if (!arraySome(other, function(othValue, othIndex) {
  6599. if (!cacheHas(seen, othIndex) &&
  6600. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6601. return seen.push(othIndex);
  6602. }
  6603. })) {
  6604. result = false;
  6605. break;
  6606. }
  6607. } else if (!(
  6608. arrValue === othValue ||
  6609. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6610. )) {
  6611. result = false;
  6612. break;
  6613. }
  6614. }
  6615. stack['delete'](array);
  6616. stack['delete'](other);
  6617. return result;
  6618. }
  6619. /**
  6620. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6621. * the same `toStringTag`.
  6622. *
  6623. * **Note:** This function only supports comparing values with tags of
  6624. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6625. *
  6626. * @private
  6627. * @param {Object} object The object to compare.
  6628. * @param {Object} other The other object to compare.
  6629. * @param {string} tag The `toStringTag` of the objects to compare.
  6630. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6631. * @param {Function} customizer The function to customize comparisons.
  6632. * @param {Function} equalFunc The function to determine equivalents of values.
  6633. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6634. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6635. */
  6636. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6637. switch (tag) {
  6638. case dataViewTag:
  6639. if ((object.byteLength != other.byteLength) ||
  6640. (object.byteOffset != other.byteOffset)) {
  6641. return false;
  6642. }
  6643. object = object.buffer;
  6644. other = other.buffer;
  6645. case arrayBufferTag:
  6646. if ((object.byteLength != other.byteLength) ||
  6647. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6648. return false;
  6649. }
  6650. return true;
  6651. case boolTag:
  6652. case dateTag:
  6653. case numberTag:
  6654. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6655. // Invalid dates are coerced to `NaN`.
  6656. return eq(+object, +other);
  6657. case errorTag:
  6658. return object.name == other.name && object.message == other.message;
  6659. case regexpTag:
  6660. case stringTag:
  6661. // Coerce regexes to strings and treat strings, primitives and objects,
  6662. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6663. // for more details.
  6664. return object == (other + '');
  6665. case mapTag:
  6666. var convert = mapToArray;
  6667. case setTag:
  6668. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6669. convert || (convert = setToArray);
  6670. if (object.size != other.size && !isPartial) {
  6671. return false;
  6672. }
  6673. // Assume cyclic values are equal.
  6674. var stacked = stack.get(object);
  6675. if (stacked) {
  6676. return stacked == other;
  6677. }
  6678. bitmask |= COMPARE_UNORDERED_FLAG;
  6679. // Recursively compare objects (susceptible to call stack limits).
  6680. stack.set(object, other);
  6681. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6682. stack['delete'](object);
  6683. return result;
  6684. case symbolTag:
  6685. if (symbolValueOf) {
  6686. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6687. }
  6688. }
  6689. return false;
  6690. }
  6691. /**
  6692. * A specialized version of `baseIsEqualDeep` for objects with support for
  6693. * partial deep comparisons.
  6694. *
  6695. * @private
  6696. * @param {Object} object The object to compare.
  6697. * @param {Object} other The other object to compare.
  6698. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6699. * @param {Function} customizer The function to customize comparisons.
  6700. * @param {Function} equalFunc The function to determine equivalents of values.
  6701. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6702. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6703. */
  6704. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6705. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6706. objProps = getAllKeys(object),
  6707. objLength = objProps.length,
  6708. othProps = getAllKeys(other),
  6709. othLength = othProps.length;
  6710. if (objLength != othLength && !isPartial) {
  6711. return false;
  6712. }
  6713. var index = objLength;
  6714. while (index--) {
  6715. var key = objProps[index];
  6716. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6717. return false;
  6718. }
  6719. }
  6720. // Check that cyclic values are equal.
  6721. var objStacked = stack.get(object);
  6722. var othStacked = stack.get(other);
  6723. if (objStacked && othStacked) {
  6724. return objStacked == other && othStacked == object;
  6725. }
  6726. var result = true;
  6727. stack.set(object, other);
  6728. stack.set(other, object);
  6729. var skipCtor = isPartial;
  6730. while (++index < objLength) {
  6731. key = objProps[index];
  6732. var objValue = object[key],
  6733. othValue = other[key];
  6734. if (customizer) {
  6735. var compared = isPartial
  6736. ? customizer(othValue, objValue, key, other, object, stack)
  6737. : customizer(objValue, othValue, key, object, other, stack);
  6738. }
  6739. // Recursively compare objects (susceptible to call stack limits).
  6740. if (!(compared === undefined
  6741. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6742. : compared
  6743. )) {
  6744. result = false;
  6745. break;
  6746. }
  6747. skipCtor || (skipCtor = key == 'constructor');
  6748. }
  6749. if (result && !skipCtor) {
  6750. var objCtor = object.constructor,
  6751. othCtor = other.constructor;
  6752. // Non `Object` object instances with different constructors are not equal.
  6753. if (objCtor != othCtor &&
  6754. ('constructor' in object && 'constructor' in other) &&
  6755. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6756. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6757. result = false;
  6758. }
  6759. }
  6760. stack['delete'](object);
  6761. stack['delete'](other);
  6762. return result;
  6763. }
  6764. /**
  6765. * A specialized version of `baseRest` which flattens the rest array.
  6766. *
  6767. * @private
  6768. * @param {Function} func The function to apply a rest parameter to.
  6769. * @returns {Function} Returns the new function.
  6770. */
  6771. function flatRest(func) {
  6772. return setToString(overRest(func, undefined, flatten), func + '');
  6773. }
  6774. /**
  6775. * Creates an array of own enumerable property names and symbols of `object`.
  6776. *
  6777. * @private
  6778. * @param {Object} object The object to query.
  6779. * @returns {Array} Returns the array of property names and symbols.
  6780. */
  6781. function getAllKeys(object) {
  6782. return baseGetAllKeys(object, keys, getSymbols);
  6783. }
  6784. /**
  6785. * Creates an array of own and inherited enumerable property names and
  6786. * symbols of `object`.
  6787. *
  6788. * @private
  6789. * @param {Object} object The object to query.
  6790. * @returns {Array} Returns the array of property names and symbols.
  6791. */
  6792. function getAllKeysIn(object) {
  6793. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6794. }
  6795. /**
  6796. * Gets metadata for `func`.
  6797. *
  6798. * @private
  6799. * @param {Function} func The function to query.
  6800. * @returns {*} Returns the metadata for `func`.
  6801. */
  6802. var getData = !metaMap ? noop : function(func) {
  6803. return metaMap.get(func);
  6804. };
  6805. /**
  6806. * Gets the name of `func`.
  6807. *
  6808. * @private
  6809. * @param {Function} func The function to query.
  6810. * @returns {string} Returns the function name.
  6811. */
  6812. function getFuncName(func) {
  6813. var result = (func.name + ''),
  6814. array = realNames[result],
  6815. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6816. while (length--) {
  6817. var data = array[length],
  6818. otherFunc = data.func;
  6819. if (otherFunc == null || otherFunc == func) {
  6820. return data.name;
  6821. }
  6822. }
  6823. return result;
  6824. }
  6825. /**
  6826. * Gets the argument placeholder value for `func`.
  6827. *
  6828. * @private
  6829. * @param {Function} func The function to inspect.
  6830. * @returns {*} Returns the placeholder value.
  6831. */
  6832. function getHolder(func) {
  6833. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6834. return object.placeholder;
  6835. }
  6836. /**
  6837. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6838. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6839. * If arguments are provided, the chosen function is invoked with them and
  6840. * its result is returned.
  6841. *
  6842. * @private
  6843. * @param {*} [value] The value to convert to an iteratee.
  6844. * @param {number} [arity] The arity of the created iteratee.
  6845. * @returns {Function} Returns the chosen function or its result.
  6846. */
  6847. function getIteratee() {
  6848. var result = lodash.iteratee || iteratee;
  6849. result = result === iteratee ? baseIteratee : result;
  6850. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6851. }
  6852. /**
  6853. * Gets the data for `map`.
  6854. *
  6855. * @private
  6856. * @param {Object} map The map to query.
  6857. * @param {string} key The reference key.
  6858. * @returns {*} Returns the map data.
  6859. */
  6860. function getMapData(map, key) {
  6861. var data = map.__data__;
  6862. return isKeyable(key)
  6863. ? data[typeof key == 'string' ? 'string' : 'hash']
  6864. : data.map;
  6865. }
  6866. /**
  6867. * Gets the property names, values, and compare flags of `object`.
  6868. *
  6869. * @private
  6870. * @param {Object} object The object to query.
  6871. * @returns {Array} Returns the match data of `object`.
  6872. */
  6873. function getMatchData(object) {
  6874. var result = keys(object),
  6875. length = result.length;
  6876. while (length--) {
  6877. var key = result[length],
  6878. value = object[key];
  6879. result[length] = [key, value, isStrictComparable(value)];
  6880. }
  6881. return result;
  6882. }
  6883. /**
  6884. * Gets the native function at `key` of `object`.
  6885. *
  6886. * @private
  6887. * @param {Object} object The object to query.
  6888. * @param {string} key The key of the method to get.
  6889. * @returns {*} Returns the function if it's native, else `undefined`.
  6890. */
  6891. function getNative(object, key) {
  6892. var value = getValue(object, key);
  6893. return baseIsNative(value) ? value : undefined;
  6894. }
  6895. /**
  6896. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6897. *
  6898. * @private
  6899. * @param {*} value The value to query.
  6900. * @returns {string} Returns the raw `toStringTag`.
  6901. */
  6902. function getRawTag(value) {
  6903. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6904. tag = value[symToStringTag];
  6905. try {
  6906. value[symToStringTag] = undefined;
  6907. var unmasked = true;
  6908. } catch (e) {}
  6909. var result = nativeObjectToString.call(value);
  6910. if (unmasked) {
  6911. if (isOwn) {
  6912. value[symToStringTag] = tag;
  6913. } else {
  6914. delete value[symToStringTag];
  6915. }
  6916. }
  6917. return result;
  6918. }
  6919. /**
  6920. * Creates an array of the own enumerable symbols of `object`.
  6921. *
  6922. * @private
  6923. * @param {Object} object The object to query.
  6924. * @returns {Array} Returns the array of symbols.
  6925. */
  6926. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6927. if (object == null) {
  6928. return [];
  6929. }
  6930. object = Object(object);
  6931. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6932. return propertyIsEnumerable.call(object, symbol);
  6933. });
  6934. };
  6935. /**
  6936. * Creates an array of the own and inherited enumerable symbols of `object`.
  6937. *
  6938. * @private
  6939. * @param {Object} object The object to query.
  6940. * @returns {Array} Returns the array of symbols.
  6941. */
  6942. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6943. var result = [];
  6944. while (object) {
  6945. arrayPush(result, getSymbols(object));
  6946. object = getPrototype(object);
  6947. }
  6948. return result;
  6949. };
  6950. /**
  6951. * Gets the `toStringTag` of `value`.
  6952. *
  6953. * @private
  6954. * @param {*} value The value to query.
  6955. * @returns {string} Returns the `toStringTag`.
  6956. */
  6957. var getTag = baseGetTag;
  6958. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6959. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6960. (Map && getTag(new Map) != mapTag) ||
  6961. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6962. (Set && getTag(new Set) != setTag) ||
  6963. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6964. getTag = function(value) {
  6965. var result = baseGetTag(value),
  6966. Ctor = result == objectTag ? value.constructor : undefined,
  6967. ctorString = Ctor ? toSource(Ctor) : '';
  6968. if (ctorString) {
  6969. switch (ctorString) {
  6970. case dataViewCtorString: return dataViewTag;
  6971. case mapCtorString: return mapTag;
  6972. case promiseCtorString: return promiseTag;
  6973. case setCtorString: return setTag;
  6974. case weakMapCtorString: return weakMapTag;
  6975. }
  6976. }
  6977. return result;
  6978. };
  6979. }
  6980. /**
  6981. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6982. *
  6983. * @private
  6984. * @param {number} start The start of the view.
  6985. * @param {number} end The end of the view.
  6986. * @param {Array} transforms The transformations to apply to the view.
  6987. * @returns {Object} Returns an object containing the `start` and `end`
  6988. * positions of the view.
  6989. */
  6990. function getView(start, end, transforms) {
  6991. var index = -1,
  6992. length = transforms.length;
  6993. while (++index < length) {
  6994. var data = transforms[index],
  6995. size = data.size;
  6996. switch (data.type) {
  6997. case 'drop': start += size; break;
  6998. case 'dropRight': end -= size; break;
  6999. case 'take': end = nativeMin(end, start + size); break;
  7000. case 'takeRight': start = nativeMax(start, end - size); break;
  7001. }
  7002. }
  7003. return { 'start': start, 'end': end };
  7004. }
  7005. /**
  7006. * Extracts wrapper details from the `source` body comment.
  7007. *
  7008. * @private
  7009. * @param {string} source The source to inspect.
  7010. * @returns {Array} Returns the wrapper details.
  7011. */
  7012. function getWrapDetails(source) {
  7013. var match = source.match(reWrapDetails);
  7014. return match ? match[1].split(reSplitDetails) : [];
  7015. }
  7016. /**
  7017. * Checks if `path` exists on `object`.
  7018. *
  7019. * @private
  7020. * @param {Object} object The object to query.
  7021. * @param {Array|string} path The path to check.
  7022. * @param {Function} hasFunc The function to check properties.
  7023. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7024. */
  7025. function hasPath(object, path, hasFunc) {
  7026. path = castPath(path, object);
  7027. var index = -1,
  7028. length = path.length,
  7029. result = false;
  7030. while (++index < length) {
  7031. var key = toKey(path[index]);
  7032. if (!(result = object != null && hasFunc(object, key))) {
  7033. break;
  7034. }
  7035. object = object[key];
  7036. }
  7037. if (result || ++index != length) {
  7038. return result;
  7039. }
  7040. length = object == null ? 0 : object.length;
  7041. return !!length && isLength(length) && isIndex(key, length) &&
  7042. (isArray(object) || isArguments(object));
  7043. }
  7044. /**
  7045. * Initializes an array clone.
  7046. *
  7047. * @private
  7048. * @param {Array} array The array to clone.
  7049. * @returns {Array} Returns the initialized clone.
  7050. */
  7051. function initCloneArray(array) {
  7052. var length = array.length,
  7053. result = new array.constructor(length);
  7054. // Add properties assigned by `RegExp#exec`.
  7055. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7056. result.index = array.index;
  7057. result.input = array.input;
  7058. }
  7059. return result;
  7060. }
  7061. /**
  7062. * Initializes an object clone.
  7063. *
  7064. * @private
  7065. * @param {Object} object The object to clone.
  7066. * @returns {Object} Returns the initialized clone.
  7067. */
  7068. function initCloneObject(object) {
  7069. return (typeof object.constructor == 'function' && !isPrototype(object))
  7070. ? baseCreate(getPrototype(object))
  7071. : {};
  7072. }
  7073. /**
  7074. * Initializes an object clone based on its `toStringTag`.
  7075. *
  7076. * **Note:** This function only supports cloning values with tags of
  7077. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7078. *
  7079. * @private
  7080. * @param {Object} object The object to clone.
  7081. * @param {string} tag The `toStringTag` of the object to clone.
  7082. * @param {boolean} [isDeep] Specify a deep clone.
  7083. * @returns {Object} Returns the initialized clone.
  7084. */
  7085. function initCloneByTag(object, tag, isDeep) {
  7086. var Ctor = object.constructor;
  7087. switch (tag) {
  7088. case arrayBufferTag:
  7089. return cloneArrayBuffer(object);
  7090. case boolTag:
  7091. case dateTag:
  7092. return new Ctor(+object);
  7093. case dataViewTag:
  7094. return cloneDataView(object, isDeep);
  7095. case float32Tag: case float64Tag:
  7096. case int8Tag: case int16Tag: case int32Tag:
  7097. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7098. return cloneTypedArray(object, isDeep);
  7099. case mapTag:
  7100. return new Ctor;
  7101. case numberTag:
  7102. case stringTag:
  7103. return new Ctor(object);
  7104. case regexpTag:
  7105. return cloneRegExp(object);
  7106. case setTag:
  7107. return new Ctor;
  7108. case symbolTag:
  7109. return cloneSymbol(object);
  7110. }
  7111. }
  7112. /**
  7113. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7114. *
  7115. * @private
  7116. * @param {string} source The source to modify.
  7117. * @returns {Array} details The details to insert.
  7118. * @returns {string} Returns the modified source.
  7119. */
  7120. function insertWrapDetails(source, details) {
  7121. var length = details.length;
  7122. if (!length) {
  7123. return source;
  7124. }
  7125. var lastIndex = length - 1;
  7126. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7127. details = details.join(length > 2 ? ', ' : ' ');
  7128. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7129. }
  7130. /**
  7131. * Checks if `value` is a flattenable `arguments` object or array.
  7132. *
  7133. * @private
  7134. * @param {*} value The value to check.
  7135. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7136. */
  7137. function isFlattenable(value) {
  7138. return isArray(value) || isArguments(value) ||
  7139. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7140. }
  7141. /**
  7142. * Checks if `value` is a valid array-like index.
  7143. *
  7144. * @private
  7145. * @param {*} value The value to check.
  7146. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7147. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7148. */
  7149. function isIndex(value, length) {
  7150. var type = typeof value;
  7151. length = length == null ? MAX_SAFE_INTEGER : length;
  7152. return !!length &&
  7153. (type == 'number' ||
  7154. (type != 'symbol' && reIsUint.test(value))) &&
  7155. (value > -1 && value % 1 == 0 && value < length);
  7156. }
  7157. /**
  7158. * Checks if the given arguments are from an iteratee call.
  7159. *
  7160. * @private
  7161. * @param {*} value The potential iteratee value argument.
  7162. * @param {*} index The potential iteratee index or key argument.
  7163. * @param {*} object The potential iteratee object argument.
  7164. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7165. * else `false`.
  7166. */
  7167. function isIterateeCall(value, index, object) {
  7168. if (!isObject(object)) {
  7169. return false;
  7170. }
  7171. var type = typeof index;
  7172. if (type == 'number'
  7173. ? (isArrayLike(object) && isIndex(index, object.length))
  7174. : (type == 'string' && index in object)
  7175. ) {
  7176. return eq(object[index], value);
  7177. }
  7178. return false;
  7179. }
  7180. /**
  7181. * Checks if `value` is a property name and not a property path.
  7182. *
  7183. * @private
  7184. * @param {*} value The value to check.
  7185. * @param {Object} [object] The object to query keys on.
  7186. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7187. */
  7188. function isKey(value, object) {
  7189. if (isArray(value)) {
  7190. return false;
  7191. }
  7192. var type = typeof value;
  7193. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7194. value == null || isSymbol(value)) {
  7195. return true;
  7196. }
  7197. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7198. (object != null && value in Object(object));
  7199. }
  7200. /**
  7201. * Checks if `value` is suitable for use as unique object key.
  7202. *
  7203. * @private
  7204. * @param {*} value The value to check.
  7205. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7206. */
  7207. function isKeyable(value) {
  7208. var type = typeof value;
  7209. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7210. ? (value !== '__proto__')
  7211. : (value === null);
  7212. }
  7213. /**
  7214. * Checks if `func` has a lazy counterpart.
  7215. *
  7216. * @private
  7217. * @param {Function} func The function to check.
  7218. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7219. * else `false`.
  7220. */
  7221. function isLaziable(func) {
  7222. var funcName = getFuncName(func),
  7223. other = lodash[funcName];
  7224. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7225. return false;
  7226. }
  7227. if (func === other) {
  7228. return true;
  7229. }
  7230. var data = getData(other);
  7231. return !!data && func === data[0];
  7232. }
  7233. /**
  7234. * Checks if `func` has its source masked.
  7235. *
  7236. * @private
  7237. * @param {Function} func The function to check.
  7238. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7239. */
  7240. function isMasked(func) {
  7241. return !!maskSrcKey && (maskSrcKey in func);
  7242. }
  7243. /**
  7244. * Checks if `func` is capable of being masked.
  7245. *
  7246. * @private
  7247. * @param {*} value The value to check.
  7248. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7249. */
  7250. var isMaskable = coreJsData ? isFunction : stubFalse;
  7251. /**
  7252. * Checks if `value` is likely a prototype object.
  7253. *
  7254. * @private
  7255. * @param {*} value The value to check.
  7256. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7257. */
  7258. function isPrototype(value) {
  7259. var Ctor = value && value.constructor,
  7260. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7261. return value === proto;
  7262. }
  7263. /**
  7264. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7265. *
  7266. * @private
  7267. * @param {*} value The value to check.
  7268. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7269. * equality comparisons, else `false`.
  7270. */
  7271. function isStrictComparable(value) {
  7272. return value === value && !isObject(value);
  7273. }
  7274. /**
  7275. * A specialized version of `matchesProperty` for source values suitable
  7276. * for strict equality comparisons, i.e. `===`.
  7277. *
  7278. * @private
  7279. * @param {string} key The key of the property to get.
  7280. * @param {*} srcValue The value to match.
  7281. * @returns {Function} Returns the new spec function.
  7282. */
  7283. function matchesStrictComparable(key, srcValue) {
  7284. return function(object) {
  7285. if (object == null) {
  7286. return false;
  7287. }
  7288. return object[key] === srcValue &&
  7289. (srcValue !== undefined || (key in Object(object)));
  7290. };
  7291. }
  7292. /**
  7293. * A specialized version of `_.memoize` which clears the memoized function's
  7294. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7295. *
  7296. * @private
  7297. * @param {Function} func The function to have its output memoized.
  7298. * @returns {Function} Returns the new memoized function.
  7299. */
  7300. function memoizeCapped(func) {
  7301. var result = memoize(func, function(key) {
  7302. if (cache.size === MAX_MEMOIZE_SIZE) {
  7303. cache.clear();
  7304. }
  7305. return key;
  7306. });
  7307. var cache = result.cache;
  7308. return result;
  7309. }
  7310. /**
  7311. * Merges the function metadata of `source` into `data`.
  7312. *
  7313. * Merging metadata reduces the number of wrappers used to invoke a function.
  7314. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7315. * may be applied regardless of execution order. Methods like `_.ary` and
  7316. * `_.rearg` modify function arguments, making the order in which they are
  7317. * executed important, preventing the merging of metadata. However, we make
  7318. * an exception for a safe combined case where curried functions have `_.ary`
  7319. * and or `_.rearg` applied.
  7320. *
  7321. * @private
  7322. * @param {Array} data The destination metadata.
  7323. * @param {Array} source The source metadata.
  7324. * @returns {Array} Returns `data`.
  7325. */
  7326. function mergeData(data, source) {
  7327. var bitmask = data[1],
  7328. srcBitmask = source[1],
  7329. newBitmask = bitmask | srcBitmask,
  7330. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7331. var isCombo =
  7332. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7333. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7334. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7335. // Exit early if metadata can't be merged.
  7336. if (!(isCommon || isCombo)) {
  7337. return data;
  7338. }
  7339. // Use source `thisArg` if available.
  7340. if (srcBitmask & WRAP_BIND_FLAG) {
  7341. data[2] = source[2];
  7342. // Set when currying a bound function.
  7343. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7344. }
  7345. // Compose partial arguments.
  7346. var value = source[3];
  7347. if (value) {
  7348. var partials = data[3];
  7349. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7350. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7351. }
  7352. // Compose partial right arguments.
  7353. value = source[5];
  7354. if (value) {
  7355. partials = data[5];
  7356. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7357. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7358. }
  7359. // Use source `argPos` if available.
  7360. value = source[7];
  7361. if (value) {
  7362. data[7] = value;
  7363. }
  7364. // Use source `ary` if it's smaller.
  7365. if (srcBitmask & WRAP_ARY_FLAG) {
  7366. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7367. }
  7368. // Use source `arity` if one is not provided.
  7369. if (data[9] == null) {
  7370. data[9] = source[9];
  7371. }
  7372. // Use source `func` and merge bitmasks.
  7373. data[0] = source[0];
  7374. data[1] = newBitmask;
  7375. return data;
  7376. }
  7377. /**
  7378. * This function is like
  7379. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7380. * except that it includes inherited enumerable properties.
  7381. *
  7382. * @private
  7383. * @param {Object} object The object to query.
  7384. * @returns {Array} Returns the array of property names.
  7385. */
  7386. function nativeKeysIn(object) {
  7387. var result = [];
  7388. if (object != null) {
  7389. for (var key in Object(object)) {
  7390. result.push(key);
  7391. }
  7392. }
  7393. return result;
  7394. }
  7395. /**
  7396. * Converts `value` to a string using `Object.prototype.toString`.
  7397. *
  7398. * @private
  7399. * @param {*} value The value to convert.
  7400. * @returns {string} Returns the converted string.
  7401. */
  7402. function objectToString(value) {
  7403. return nativeObjectToString.call(value);
  7404. }
  7405. /**
  7406. * A specialized version of `baseRest` which transforms the rest array.
  7407. *
  7408. * @private
  7409. * @param {Function} func The function to apply a rest parameter to.
  7410. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7411. * @param {Function} transform The rest array transform.
  7412. * @returns {Function} Returns the new function.
  7413. */
  7414. function overRest(func, start, transform) {
  7415. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7416. return function() {
  7417. var args = arguments,
  7418. index = -1,
  7419. length = nativeMax(args.length - start, 0),
  7420. array = Array(length);
  7421. while (++index < length) {
  7422. array[index] = args[start + index];
  7423. }
  7424. index = -1;
  7425. var otherArgs = Array(start + 1);
  7426. while (++index < start) {
  7427. otherArgs[index] = args[index];
  7428. }
  7429. otherArgs[start] = transform(array);
  7430. return apply(func, this, otherArgs);
  7431. };
  7432. }
  7433. /**
  7434. * Gets the parent value at `path` of `object`.
  7435. *
  7436. * @private
  7437. * @param {Object} object The object to query.
  7438. * @param {Array} path The path to get the parent value of.
  7439. * @returns {*} Returns the parent value.
  7440. */
  7441. function parent(object, path) {
  7442. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7443. }
  7444. /**
  7445. * Reorder `array` according to the specified indexes where the element at
  7446. * the first index is assigned as the first element, the element at
  7447. * the second index is assigned as the second element, and so on.
  7448. *
  7449. * @private
  7450. * @param {Array} array The array to reorder.
  7451. * @param {Array} indexes The arranged array indexes.
  7452. * @returns {Array} Returns `array`.
  7453. */
  7454. function reorder(array, indexes) {
  7455. var arrLength = array.length,
  7456. length = nativeMin(indexes.length, arrLength),
  7457. oldArray = copyArray(array);
  7458. while (length--) {
  7459. var index = indexes[length];
  7460. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7461. }
  7462. return array;
  7463. }
  7464. /**
  7465. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7466. *
  7467. * @private
  7468. * @param {Object} object The object to query.
  7469. * @param {string} key The key of the property to get.
  7470. * @returns {*} Returns the property value.
  7471. */
  7472. function safeGet(object, key) {
  7473. if (key === 'constructor' && typeof object[key] === 'function') {
  7474. return;
  7475. }
  7476. if (key == '__proto__') {
  7477. return;
  7478. }
  7479. return object[key];
  7480. }
  7481. /**
  7482. * Sets metadata for `func`.
  7483. *
  7484. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7485. * period of time, it will trip its breaker and transition to an identity
  7486. * function to avoid garbage collection pauses in V8. See
  7487. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7488. * for more details.
  7489. *
  7490. * @private
  7491. * @param {Function} func The function to associate metadata with.
  7492. * @param {*} data The metadata.
  7493. * @returns {Function} Returns `func`.
  7494. */
  7495. var setData = shortOut(baseSetData);
  7496. /**
  7497. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7498. *
  7499. * @private
  7500. * @param {Function} func The function to delay.
  7501. * @param {number} wait The number of milliseconds to delay invocation.
  7502. * @returns {number|Object} Returns the timer id or timeout object.
  7503. */
  7504. var setTimeout = ctxSetTimeout || function(func, wait) {
  7505. return root.setTimeout(func, wait);
  7506. };
  7507. /**
  7508. * Sets the `toString` method of `func` to return `string`.
  7509. *
  7510. * @private
  7511. * @param {Function} func The function to modify.
  7512. * @param {Function} string The `toString` result.
  7513. * @returns {Function} Returns `func`.
  7514. */
  7515. var setToString = shortOut(baseSetToString);
  7516. /**
  7517. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7518. * with wrapper details in a comment at the top of the source body.
  7519. *
  7520. * @private
  7521. * @param {Function} wrapper The function to modify.
  7522. * @param {Function} reference The reference function.
  7523. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7524. * @returns {Function} Returns `wrapper`.
  7525. */
  7526. function setWrapToString(wrapper, reference, bitmask) {
  7527. var source = (reference + '');
  7528. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7529. }
  7530. /**
  7531. * Creates a function that'll short out and invoke `identity` instead
  7532. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7533. * milliseconds.
  7534. *
  7535. * @private
  7536. * @param {Function} func The function to restrict.
  7537. * @returns {Function} Returns the new shortable function.
  7538. */
  7539. function shortOut(func) {
  7540. var count = 0,
  7541. lastCalled = 0;
  7542. return function() {
  7543. var stamp = nativeNow(),
  7544. remaining = HOT_SPAN - (stamp - lastCalled);
  7545. lastCalled = stamp;
  7546. if (remaining > 0) {
  7547. if (++count >= HOT_COUNT) {
  7548. return arguments[0];
  7549. }
  7550. } else {
  7551. count = 0;
  7552. }
  7553. return func.apply(undefined, arguments);
  7554. };
  7555. }
  7556. /**
  7557. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7558. *
  7559. * @private
  7560. * @param {Array} array The array to shuffle.
  7561. * @param {number} [size=array.length] The size of `array`.
  7562. * @returns {Array} Returns `array`.
  7563. */
  7564. function shuffleSelf(array, size) {
  7565. var index = -1,
  7566. length = array.length,
  7567. lastIndex = length - 1;
  7568. size = size === undefined ? length : size;
  7569. while (++index < size) {
  7570. var rand = baseRandom(index, lastIndex),
  7571. value = array[rand];
  7572. array[rand] = array[index];
  7573. array[index] = value;
  7574. }
  7575. array.length = size;
  7576. return array;
  7577. }
  7578. /**
  7579. * Converts `string` to a property path array.
  7580. *
  7581. * @private
  7582. * @param {string} string The string to convert.
  7583. * @returns {Array} Returns the property path array.
  7584. */
  7585. var stringToPath = memoizeCapped(function(string) {
  7586. var result = [];
  7587. if (string.charCodeAt(0) === 46 /* . */) {
  7588. result.push('');
  7589. }
  7590. string.replace(rePropName, function(match, number, quote, subString) {
  7591. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7592. });
  7593. return result;
  7594. });
  7595. /**
  7596. * Converts `value` to a string key if it's not a string or symbol.
  7597. *
  7598. * @private
  7599. * @param {*} value The value to inspect.
  7600. * @returns {string|symbol} Returns the key.
  7601. */
  7602. function toKey(value) {
  7603. if (typeof value == 'string' || isSymbol(value)) {
  7604. return value;
  7605. }
  7606. var result = (value + '');
  7607. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7608. }
  7609. /**
  7610. * Converts `func` to its source code.
  7611. *
  7612. * @private
  7613. * @param {Function} func The function to convert.
  7614. * @returns {string} Returns the source code.
  7615. */
  7616. function toSource(func) {
  7617. if (func != null) {
  7618. try {
  7619. return funcToString.call(func);
  7620. } catch (e) {}
  7621. try {
  7622. return (func + '');
  7623. } catch (e) {}
  7624. }
  7625. return '';
  7626. }
  7627. /**
  7628. * Updates wrapper `details` based on `bitmask` flags.
  7629. *
  7630. * @private
  7631. * @returns {Array} details The details to modify.
  7632. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7633. * @returns {Array} Returns `details`.
  7634. */
  7635. function updateWrapDetails(details, bitmask) {
  7636. arrayEach(wrapFlags, function(pair) {
  7637. var value = '_.' + pair[0];
  7638. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7639. details.push(value);
  7640. }
  7641. });
  7642. return details.sort();
  7643. }
  7644. /**
  7645. * Creates a clone of `wrapper`.
  7646. *
  7647. * @private
  7648. * @param {Object} wrapper The wrapper to clone.
  7649. * @returns {Object} Returns the cloned wrapper.
  7650. */
  7651. function wrapperClone(wrapper) {
  7652. if (wrapper instanceof LazyWrapper) {
  7653. return wrapper.clone();
  7654. }
  7655. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7656. result.__actions__ = copyArray(wrapper.__actions__);
  7657. result.__index__ = wrapper.__index__;
  7658. result.__values__ = wrapper.__values__;
  7659. return result;
  7660. }
  7661. /*------------------------------------------------------------------------*/
  7662. /**
  7663. * Creates an array of elements split into groups the length of `size`.
  7664. * If `array` can't be split evenly, the final chunk will be the remaining
  7665. * elements.
  7666. *
  7667. * @static
  7668. * @memberOf _
  7669. * @since 3.0.0
  7670. * @category Array
  7671. * @param {Array} array The array to process.
  7672. * @param {number} [size=1] The length of each chunk
  7673. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7674. * @returns {Array} Returns the new array of chunks.
  7675. * @example
  7676. *
  7677. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7678. * // => [['a', 'b'], ['c', 'd']]
  7679. *
  7680. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7681. * // => [['a', 'b', 'c'], ['d']]
  7682. */
  7683. function chunk(array, size, guard) {
  7684. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7685. size = 1;
  7686. } else {
  7687. size = nativeMax(toInteger(size), 0);
  7688. }
  7689. var length = array == null ? 0 : array.length;
  7690. if (!length || size < 1) {
  7691. return [];
  7692. }
  7693. var index = 0,
  7694. resIndex = 0,
  7695. result = Array(nativeCeil(length / size));
  7696. while (index < length) {
  7697. result[resIndex++] = baseSlice(array, index, (index += size));
  7698. }
  7699. return result;
  7700. }
  7701. /**
  7702. * Creates an array with all falsey values removed. The values `false`, `null`,
  7703. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7704. *
  7705. * @static
  7706. * @memberOf _
  7707. * @since 0.1.0
  7708. * @category Array
  7709. * @param {Array} array The array to compact.
  7710. * @returns {Array} Returns the new array of filtered values.
  7711. * @example
  7712. *
  7713. * _.compact([0, 1, false, 2, '', 3]);
  7714. * // => [1, 2, 3]
  7715. */
  7716. function compact(array) {
  7717. var index = -1,
  7718. length = array == null ? 0 : array.length,
  7719. resIndex = 0,
  7720. result = [];
  7721. while (++index < length) {
  7722. var value = array[index];
  7723. if (value) {
  7724. result[resIndex++] = value;
  7725. }
  7726. }
  7727. return result;
  7728. }
  7729. /**
  7730. * Creates a new array concatenating `array` with any additional arrays
  7731. * and/or values.
  7732. *
  7733. * @static
  7734. * @memberOf _
  7735. * @since 4.0.0
  7736. * @category Array
  7737. * @param {Array} array The array to concatenate.
  7738. * @param {...*} [values] The values to concatenate.
  7739. * @returns {Array} Returns the new concatenated array.
  7740. * @example
  7741. *
  7742. * var array = [1];
  7743. * var other = _.concat(array, 2, [3], [[4]]);
  7744. *
  7745. * console.log(other);
  7746. * // => [1, 2, 3, [4]]
  7747. *
  7748. * console.log(array);
  7749. * // => [1]
  7750. */
  7751. function concat() {
  7752. var length = arguments.length;
  7753. if (!length) {
  7754. return [];
  7755. }
  7756. var args = Array(length - 1),
  7757. array = arguments[0],
  7758. index = length;
  7759. while (index--) {
  7760. args[index - 1] = arguments[index];
  7761. }
  7762. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7763. }
  7764. /**
  7765. * Creates an array of `array` values not included in the other given arrays
  7766. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7767. * for equality comparisons. The order and references of result values are
  7768. * determined by the first array.
  7769. *
  7770. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7771. *
  7772. * @static
  7773. * @memberOf _
  7774. * @since 0.1.0
  7775. * @category Array
  7776. * @param {Array} array The array to inspect.
  7777. * @param {...Array} [values] The values to exclude.
  7778. * @returns {Array} Returns the new array of filtered values.
  7779. * @see _.without, _.xor
  7780. * @example
  7781. *
  7782. * _.difference([2, 1], [2, 3]);
  7783. * // => [1]
  7784. */
  7785. var difference = baseRest(function(array, values) {
  7786. return isArrayLikeObject(array)
  7787. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7788. : [];
  7789. });
  7790. /**
  7791. * This method is like `_.difference` except that it accepts `iteratee` which
  7792. * is invoked for each element of `array` and `values` to generate the criterion
  7793. * by which they're compared. The order and references of result values are
  7794. * determined by the first array. The iteratee is invoked with one argument:
  7795. * (value).
  7796. *
  7797. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7798. *
  7799. * @static
  7800. * @memberOf _
  7801. * @since 4.0.0
  7802. * @category Array
  7803. * @param {Array} array The array to inspect.
  7804. * @param {...Array} [values] The values to exclude.
  7805. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7806. * @returns {Array} Returns the new array of filtered values.
  7807. * @example
  7808. *
  7809. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7810. * // => [1.2]
  7811. *
  7812. * // The `_.property` iteratee shorthand.
  7813. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7814. * // => [{ 'x': 2 }]
  7815. */
  7816. var differenceBy = baseRest(function(array, values) {
  7817. var iteratee = last(values);
  7818. if (isArrayLikeObject(iteratee)) {
  7819. iteratee = undefined;
  7820. }
  7821. return isArrayLikeObject(array)
  7822. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7823. : [];
  7824. });
  7825. /**
  7826. * This method is like `_.difference` except that it accepts `comparator`
  7827. * which is invoked to compare elements of `array` to `values`. The order and
  7828. * references of result values are determined by the first array. The comparator
  7829. * is invoked with two arguments: (arrVal, othVal).
  7830. *
  7831. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7832. *
  7833. * @static
  7834. * @memberOf _
  7835. * @since 4.0.0
  7836. * @category Array
  7837. * @param {Array} array The array to inspect.
  7838. * @param {...Array} [values] The values to exclude.
  7839. * @param {Function} [comparator] The comparator invoked per element.
  7840. * @returns {Array} Returns the new array of filtered values.
  7841. * @example
  7842. *
  7843. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7844. *
  7845. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7846. * // => [{ 'x': 2, 'y': 1 }]
  7847. */
  7848. var differenceWith = baseRest(function(array, values) {
  7849. var comparator = last(values);
  7850. if (isArrayLikeObject(comparator)) {
  7851. comparator = undefined;
  7852. }
  7853. return isArrayLikeObject(array)
  7854. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7855. : [];
  7856. });
  7857. /**
  7858. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7859. *
  7860. * @static
  7861. * @memberOf _
  7862. * @since 0.5.0
  7863. * @category Array
  7864. * @param {Array} array The array to query.
  7865. * @param {number} [n=1] The number of elements to drop.
  7866. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7867. * @returns {Array} Returns the slice of `array`.
  7868. * @example
  7869. *
  7870. * _.drop([1, 2, 3]);
  7871. * // => [2, 3]
  7872. *
  7873. * _.drop([1, 2, 3], 2);
  7874. * // => [3]
  7875. *
  7876. * _.drop([1, 2, 3], 5);
  7877. * // => []
  7878. *
  7879. * _.drop([1, 2, 3], 0);
  7880. * // => [1, 2, 3]
  7881. */
  7882. function drop(array, n, guard) {
  7883. var length = array == null ? 0 : array.length;
  7884. if (!length) {
  7885. return [];
  7886. }
  7887. n = (guard || n === undefined) ? 1 : toInteger(n);
  7888. return baseSlice(array, n < 0 ? 0 : n, length);
  7889. }
  7890. /**
  7891. * Creates a slice of `array` with `n` elements dropped from the end.
  7892. *
  7893. * @static
  7894. * @memberOf _
  7895. * @since 3.0.0
  7896. * @category Array
  7897. * @param {Array} array The array to query.
  7898. * @param {number} [n=1] The number of elements to drop.
  7899. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7900. * @returns {Array} Returns the slice of `array`.
  7901. * @example
  7902. *
  7903. * _.dropRight([1, 2, 3]);
  7904. * // => [1, 2]
  7905. *
  7906. * _.dropRight([1, 2, 3], 2);
  7907. * // => [1]
  7908. *
  7909. * _.dropRight([1, 2, 3], 5);
  7910. * // => []
  7911. *
  7912. * _.dropRight([1, 2, 3], 0);
  7913. * // => [1, 2, 3]
  7914. */
  7915. function dropRight(array, n, guard) {
  7916. var length = array == null ? 0 : array.length;
  7917. if (!length) {
  7918. return [];
  7919. }
  7920. n = (guard || n === undefined) ? 1 : toInteger(n);
  7921. n = length - n;
  7922. return baseSlice(array, 0, n < 0 ? 0 : n);
  7923. }
  7924. /**
  7925. * Creates a slice of `array` excluding elements dropped from the end.
  7926. * Elements are dropped until `predicate` returns falsey. The predicate is
  7927. * invoked with three arguments: (value, index, array).
  7928. *
  7929. * @static
  7930. * @memberOf _
  7931. * @since 3.0.0
  7932. * @category Array
  7933. * @param {Array} array The array to query.
  7934. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7935. * @returns {Array} Returns the slice of `array`.
  7936. * @example
  7937. *
  7938. * var users = [
  7939. * { 'user': 'barney', 'active': true },
  7940. * { 'user': 'fred', 'active': false },
  7941. * { 'user': 'pebbles', 'active': false }
  7942. * ];
  7943. *
  7944. * _.dropRightWhile(users, function(o) { return !o.active; });
  7945. * // => objects for ['barney']
  7946. *
  7947. * // The `_.matches` iteratee shorthand.
  7948. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7949. * // => objects for ['barney', 'fred']
  7950. *
  7951. * // The `_.matchesProperty` iteratee shorthand.
  7952. * _.dropRightWhile(users, ['active', false]);
  7953. * // => objects for ['barney']
  7954. *
  7955. * // The `_.property` iteratee shorthand.
  7956. * _.dropRightWhile(users, 'active');
  7957. * // => objects for ['barney', 'fred', 'pebbles']
  7958. */
  7959. function dropRightWhile(array, predicate) {
  7960. return (array && array.length)
  7961. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7962. : [];
  7963. }
  7964. /**
  7965. * Creates a slice of `array` excluding elements dropped from the beginning.
  7966. * Elements are dropped until `predicate` returns falsey. The predicate is
  7967. * invoked with three arguments: (value, index, array).
  7968. *
  7969. * @static
  7970. * @memberOf _
  7971. * @since 3.0.0
  7972. * @category Array
  7973. * @param {Array} array The array to query.
  7974. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7975. * @returns {Array} Returns the slice of `array`.
  7976. * @example
  7977. *
  7978. * var users = [
  7979. * { 'user': 'barney', 'active': false },
  7980. * { 'user': 'fred', 'active': false },
  7981. * { 'user': 'pebbles', 'active': true }
  7982. * ];
  7983. *
  7984. * _.dropWhile(users, function(o) { return !o.active; });
  7985. * // => objects for ['pebbles']
  7986. *
  7987. * // The `_.matches` iteratee shorthand.
  7988. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7989. * // => objects for ['fred', 'pebbles']
  7990. *
  7991. * // The `_.matchesProperty` iteratee shorthand.
  7992. * _.dropWhile(users, ['active', false]);
  7993. * // => objects for ['pebbles']
  7994. *
  7995. * // The `_.property` iteratee shorthand.
  7996. * _.dropWhile(users, 'active');
  7997. * // => objects for ['barney', 'fred', 'pebbles']
  7998. */
  7999. function dropWhile(array, predicate) {
  8000. return (array && array.length)
  8001. ? baseWhile(array, getIteratee(predicate, 3), true)
  8002. : [];
  8003. }
  8004. /**
  8005. * Fills elements of `array` with `value` from `start` up to, but not
  8006. * including, `end`.
  8007. *
  8008. * **Note:** This method mutates `array`.
  8009. *
  8010. * @static
  8011. * @memberOf _
  8012. * @since 3.2.0
  8013. * @category Array
  8014. * @param {Array} array The array to fill.
  8015. * @param {*} value The value to fill `array` with.
  8016. * @param {number} [start=0] The start position.
  8017. * @param {number} [end=array.length] The end position.
  8018. * @returns {Array} Returns `array`.
  8019. * @example
  8020. *
  8021. * var array = [1, 2, 3];
  8022. *
  8023. * _.fill(array, 'a');
  8024. * console.log(array);
  8025. * // => ['a', 'a', 'a']
  8026. *
  8027. * _.fill(Array(3), 2);
  8028. * // => [2, 2, 2]
  8029. *
  8030. * _.fill([4, 6, 8, 10], '*', 1, 3);
  8031. * // => [4, '*', '*', 10]
  8032. */
  8033. function fill(array, value, start, end) {
  8034. var length = array == null ? 0 : array.length;
  8035. if (!length) {
  8036. return [];
  8037. }
  8038. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  8039. start = 0;
  8040. end = length;
  8041. }
  8042. return baseFill(array, value, start, end);
  8043. }
  8044. /**
  8045. * This method is like `_.find` except that it returns the index of the first
  8046. * element `predicate` returns truthy for instead of the element itself.
  8047. *
  8048. * @static
  8049. * @memberOf _
  8050. * @since 1.1.0
  8051. * @category Array
  8052. * @param {Array} array The array to inspect.
  8053. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8054. * @param {number} [fromIndex=0] The index to search from.
  8055. * @returns {number} Returns the index of the found element, else `-1`.
  8056. * @example
  8057. *
  8058. * var users = [
  8059. * { 'user': 'barney', 'active': false },
  8060. * { 'user': 'fred', 'active': false },
  8061. * { 'user': 'pebbles', 'active': true }
  8062. * ];
  8063. *
  8064. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8065. * // => 0
  8066. *
  8067. * // The `_.matches` iteratee shorthand.
  8068. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8069. * // => 1
  8070. *
  8071. * // The `_.matchesProperty` iteratee shorthand.
  8072. * _.findIndex(users, ['active', false]);
  8073. * // => 0
  8074. *
  8075. * // The `_.property` iteratee shorthand.
  8076. * _.findIndex(users, 'active');
  8077. * // => 2
  8078. */
  8079. function findIndex(array, predicate, fromIndex) {
  8080. var length = array == null ? 0 : array.length;
  8081. if (!length) {
  8082. return -1;
  8083. }
  8084. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8085. if (index < 0) {
  8086. index = nativeMax(length + index, 0);
  8087. }
  8088. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8089. }
  8090. /**
  8091. * This method is like `_.findIndex` except that it iterates over elements
  8092. * of `collection` from right to left.
  8093. *
  8094. * @static
  8095. * @memberOf _
  8096. * @since 2.0.0
  8097. * @category Array
  8098. * @param {Array} array The array to inspect.
  8099. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8100. * @param {number} [fromIndex=array.length-1] The index to search from.
  8101. * @returns {number} Returns the index of the found element, else `-1`.
  8102. * @example
  8103. *
  8104. * var users = [
  8105. * { 'user': 'barney', 'active': true },
  8106. * { 'user': 'fred', 'active': false },
  8107. * { 'user': 'pebbles', 'active': false }
  8108. * ];
  8109. *
  8110. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8111. * // => 2
  8112. *
  8113. * // The `_.matches` iteratee shorthand.
  8114. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8115. * // => 0
  8116. *
  8117. * // The `_.matchesProperty` iteratee shorthand.
  8118. * _.findLastIndex(users, ['active', false]);
  8119. * // => 2
  8120. *
  8121. * // The `_.property` iteratee shorthand.
  8122. * _.findLastIndex(users, 'active');
  8123. * // => 0
  8124. */
  8125. function findLastIndex(array, predicate, fromIndex) {
  8126. var length = array == null ? 0 : array.length;
  8127. if (!length) {
  8128. return -1;
  8129. }
  8130. var index = length - 1;
  8131. if (fromIndex !== undefined) {
  8132. index = toInteger(fromIndex);
  8133. index = fromIndex < 0
  8134. ? nativeMax(length + index, 0)
  8135. : nativeMin(index, length - 1);
  8136. }
  8137. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8138. }
  8139. /**
  8140. * Flattens `array` a single level deep.
  8141. *
  8142. * @static
  8143. * @memberOf _
  8144. * @since 0.1.0
  8145. * @category Array
  8146. * @param {Array} array The array to flatten.
  8147. * @returns {Array} Returns the new flattened array.
  8148. * @example
  8149. *
  8150. * _.flatten([1, [2, [3, [4]], 5]]);
  8151. * // => [1, 2, [3, [4]], 5]
  8152. */
  8153. function flatten(array) {
  8154. var length = array == null ? 0 : array.length;
  8155. return length ? baseFlatten(array, 1) : [];
  8156. }
  8157. /**
  8158. * Recursively flattens `array`.
  8159. *
  8160. * @static
  8161. * @memberOf _
  8162. * @since 3.0.0
  8163. * @category Array
  8164. * @param {Array} array The array to flatten.
  8165. * @returns {Array} Returns the new flattened array.
  8166. * @example
  8167. *
  8168. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8169. * // => [1, 2, 3, 4, 5]
  8170. */
  8171. function flattenDeep(array) {
  8172. var length = array == null ? 0 : array.length;
  8173. return length ? baseFlatten(array, INFINITY) : [];
  8174. }
  8175. /**
  8176. * Recursively flatten `array` up to `depth` times.
  8177. *
  8178. * @static
  8179. * @memberOf _
  8180. * @since 4.4.0
  8181. * @category Array
  8182. * @param {Array} array The array to flatten.
  8183. * @param {number} [depth=1] The maximum recursion depth.
  8184. * @returns {Array} Returns the new flattened array.
  8185. * @example
  8186. *
  8187. * var array = [1, [2, [3, [4]], 5]];
  8188. *
  8189. * _.flattenDepth(array, 1);
  8190. * // => [1, 2, [3, [4]], 5]
  8191. *
  8192. * _.flattenDepth(array, 2);
  8193. * // => [1, 2, 3, [4], 5]
  8194. */
  8195. function flattenDepth(array, depth) {
  8196. var length = array == null ? 0 : array.length;
  8197. if (!length) {
  8198. return [];
  8199. }
  8200. depth = depth === undefined ? 1 : toInteger(depth);
  8201. return baseFlatten(array, depth);
  8202. }
  8203. /**
  8204. * The inverse of `_.toPairs`; this method returns an object composed
  8205. * from key-value `pairs`.
  8206. *
  8207. * @static
  8208. * @memberOf _
  8209. * @since 4.0.0
  8210. * @category Array
  8211. * @param {Array} pairs The key-value pairs.
  8212. * @returns {Object} Returns the new object.
  8213. * @example
  8214. *
  8215. * _.fromPairs([['a', 1], ['b', 2]]);
  8216. * // => { 'a': 1, 'b': 2 }
  8217. */
  8218. function fromPairs(pairs) {
  8219. var index = -1,
  8220. length = pairs == null ? 0 : pairs.length,
  8221. result = {};
  8222. while (++index < length) {
  8223. var pair = pairs[index];
  8224. result[pair[0]] = pair[1];
  8225. }
  8226. return result;
  8227. }
  8228. /**
  8229. * Gets the first element of `array`.
  8230. *
  8231. * @static
  8232. * @memberOf _
  8233. * @since 0.1.0
  8234. * @alias first
  8235. * @category Array
  8236. * @param {Array} array The array to query.
  8237. * @returns {*} Returns the first element of `array`.
  8238. * @example
  8239. *
  8240. * _.head([1, 2, 3]);
  8241. * // => 1
  8242. *
  8243. * _.head([]);
  8244. * // => undefined
  8245. */
  8246. function head(array) {
  8247. return (array && array.length) ? array[0] : undefined;
  8248. }
  8249. /**
  8250. * Gets the index at which the first occurrence of `value` is found in `array`
  8251. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8252. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8253. * offset from the end of `array`.
  8254. *
  8255. * @static
  8256. * @memberOf _
  8257. * @since 0.1.0
  8258. * @category Array
  8259. * @param {Array} array The array to inspect.
  8260. * @param {*} value The value to search for.
  8261. * @param {number} [fromIndex=0] The index to search from.
  8262. * @returns {number} Returns the index of the matched value, else `-1`.
  8263. * @example
  8264. *
  8265. * _.indexOf([1, 2, 1, 2], 2);
  8266. * // => 1
  8267. *
  8268. * // Search from the `fromIndex`.
  8269. * _.indexOf([1, 2, 1, 2], 2, 2);
  8270. * // => 3
  8271. */
  8272. function indexOf(array, value, fromIndex) {
  8273. var length = array == null ? 0 : array.length;
  8274. if (!length) {
  8275. return -1;
  8276. }
  8277. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8278. if (index < 0) {
  8279. index = nativeMax(length + index, 0);
  8280. }
  8281. return baseIndexOf(array, value, index);
  8282. }
  8283. /**
  8284. * Gets all but the last element of `array`.
  8285. *
  8286. * @static
  8287. * @memberOf _
  8288. * @since 0.1.0
  8289. * @category Array
  8290. * @param {Array} array The array to query.
  8291. * @returns {Array} Returns the slice of `array`.
  8292. * @example
  8293. *
  8294. * _.initial([1, 2, 3]);
  8295. * // => [1, 2]
  8296. */
  8297. function initial(array) {
  8298. var length = array == null ? 0 : array.length;
  8299. return length ? baseSlice(array, 0, -1) : [];
  8300. }
  8301. /**
  8302. * Creates an array of unique values that are included in all given arrays
  8303. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8304. * for equality comparisons. The order and references of result values are
  8305. * determined by the first array.
  8306. *
  8307. * @static
  8308. * @memberOf _
  8309. * @since 0.1.0
  8310. * @category Array
  8311. * @param {...Array} [arrays] The arrays to inspect.
  8312. * @returns {Array} Returns the new array of intersecting values.
  8313. * @example
  8314. *
  8315. * _.intersection([2, 1], [2, 3]);
  8316. * // => [2]
  8317. */
  8318. var intersection = baseRest(function(arrays) {
  8319. var mapped = arrayMap(arrays, castArrayLikeObject);
  8320. return (mapped.length && mapped[0] === arrays[0])
  8321. ? baseIntersection(mapped)
  8322. : [];
  8323. });
  8324. /**
  8325. * This method is like `_.intersection` except that it accepts `iteratee`
  8326. * which is invoked for each element of each `arrays` to generate the criterion
  8327. * by which they're compared. The order and references of result values are
  8328. * determined by the first array. The iteratee is invoked with one argument:
  8329. * (value).
  8330. *
  8331. * @static
  8332. * @memberOf _
  8333. * @since 4.0.0
  8334. * @category Array
  8335. * @param {...Array} [arrays] The arrays to inspect.
  8336. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8337. * @returns {Array} Returns the new array of intersecting values.
  8338. * @example
  8339. *
  8340. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8341. * // => [2.1]
  8342. *
  8343. * // The `_.property` iteratee shorthand.
  8344. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8345. * // => [{ 'x': 1 }]
  8346. */
  8347. var intersectionBy = baseRest(function(arrays) {
  8348. var iteratee = last(arrays),
  8349. mapped = arrayMap(arrays, castArrayLikeObject);
  8350. if (iteratee === last(mapped)) {
  8351. iteratee = undefined;
  8352. } else {
  8353. mapped.pop();
  8354. }
  8355. return (mapped.length && mapped[0] === arrays[0])
  8356. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8357. : [];
  8358. });
  8359. /**
  8360. * This method is like `_.intersection` except that it accepts `comparator`
  8361. * which is invoked to compare elements of `arrays`. The order and references
  8362. * of result values are determined by the first array. The comparator is
  8363. * invoked with two arguments: (arrVal, othVal).
  8364. *
  8365. * @static
  8366. * @memberOf _
  8367. * @since 4.0.0
  8368. * @category Array
  8369. * @param {...Array} [arrays] The arrays to inspect.
  8370. * @param {Function} [comparator] The comparator invoked per element.
  8371. * @returns {Array} Returns the new array of intersecting values.
  8372. * @example
  8373. *
  8374. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8375. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8376. *
  8377. * _.intersectionWith(objects, others, _.isEqual);
  8378. * // => [{ 'x': 1, 'y': 2 }]
  8379. */
  8380. var intersectionWith = baseRest(function(arrays) {
  8381. var comparator = last(arrays),
  8382. mapped = arrayMap(arrays, castArrayLikeObject);
  8383. comparator = typeof comparator == 'function' ? comparator : undefined;
  8384. if (comparator) {
  8385. mapped.pop();
  8386. }
  8387. return (mapped.length && mapped[0] === arrays[0])
  8388. ? baseIntersection(mapped, undefined, comparator)
  8389. : [];
  8390. });
  8391. /**
  8392. * Converts all elements in `array` into a string separated by `separator`.
  8393. *
  8394. * @static
  8395. * @memberOf _
  8396. * @since 4.0.0
  8397. * @category Array
  8398. * @param {Array} array The array to convert.
  8399. * @param {string} [separator=','] The element separator.
  8400. * @returns {string} Returns the joined string.
  8401. * @example
  8402. *
  8403. * _.join(['a', 'b', 'c'], '~');
  8404. * // => 'a~b~c'
  8405. */
  8406. function join(array, separator) {
  8407. return array == null ? '' : nativeJoin.call(array, separator);
  8408. }
  8409. /**
  8410. * Gets the last element of `array`.
  8411. *
  8412. * @static
  8413. * @memberOf _
  8414. * @since 0.1.0
  8415. * @category Array
  8416. * @param {Array} array The array to query.
  8417. * @returns {*} Returns the last element of `array`.
  8418. * @example
  8419. *
  8420. * _.last([1, 2, 3]);
  8421. * // => 3
  8422. */
  8423. function last(array) {
  8424. var length = array == null ? 0 : array.length;
  8425. return length ? array[length - 1] : undefined;
  8426. }
  8427. /**
  8428. * This method is like `_.indexOf` except that it iterates over elements of
  8429. * `array` from right to left.
  8430. *
  8431. * @static
  8432. * @memberOf _
  8433. * @since 0.1.0
  8434. * @category Array
  8435. * @param {Array} array The array to inspect.
  8436. * @param {*} value The value to search for.
  8437. * @param {number} [fromIndex=array.length-1] The index to search from.
  8438. * @returns {number} Returns the index of the matched value, else `-1`.
  8439. * @example
  8440. *
  8441. * _.lastIndexOf([1, 2, 1, 2], 2);
  8442. * // => 3
  8443. *
  8444. * // Search from the `fromIndex`.
  8445. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8446. * // => 1
  8447. */
  8448. function lastIndexOf(array, value, fromIndex) {
  8449. var length = array == null ? 0 : array.length;
  8450. if (!length) {
  8451. return -1;
  8452. }
  8453. var index = length;
  8454. if (fromIndex !== undefined) {
  8455. index = toInteger(fromIndex);
  8456. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8457. }
  8458. return value === value
  8459. ? strictLastIndexOf(array, value, index)
  8460. : baseFindIndex(array, baseIsNaN, index, true);
  8461. }
  8462. /**
  8463. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8464. * element from the end is returned.
  8465. *
  8466. * @static
  8467. * @memberOf _
  8468. * @since 4.11.0
  8469. * @category Array
  8470. * @param {Array} array The array to query.
  8471. * @param {number} [n=0] The index of the element to return.
  8472. * @returns {*} Returns the nth element of `array`.
  8473. * @example
  8474. *
  8475. * var array = ['a', 'b', 'c', 'd'];
  8476. *
  8477. * _.nth(array, 1);
  8478. * // => 'b'
  8479. *
  8480. * _.nth(array, -2);
  8481. * // => 'c';
  8482. */
  8483. function nth(array, n) {
  8484. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8485. }
  8486. /**
  8487. * Removes all given values from `array` using
  8488. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8489. * for equality comparisons.
  8490. *
  8491. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8492. * to remove elements from an array by predicate.
  8493. *
  8494. * @static
  8495. * @memberOf _
  8496. * @since 2.0.0
  8497. * @category Array
  8498. * @param {Array} array The array to modify.
  8499. * @param {...*} [values] The values to remove.
  8500. * @returns {Array} Returns `array`.
  8501. * @example
  8502. *
  8503. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8504. *
  8505. * _.pull(array, 'a', 'c');
  8506. * console.log(array);
  8507. * // => ['b', 'b']
  8508. */
  8509. var pull = baseRest(pullAll);
  8510. /**
  8511. * This method is like `_.pull` except that it accepts an array of values to remove.
  8512. *
  8513. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8514. *
  8515. * @static
  8516. * @memberOf _
  8517. * @since 4.0.0
  8518. * @category Array
  8519. * @param {Array} array The array to modify.
  8520. * @param {Array} values The values to remove.
  8521. * @returns {Array} Returns `array`.
  8522. * @example
  8523. *
  8524. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8525. *
  8526. * _.pullAll(array, ['a', 'c']);
  8527. * console.log(array);
  8528. * // => ['b', 'b']
  8529. */
  8530. function pullAll(array, values) {
  8531. return (array && array.length && values && values.length)
  8532. ? basePullAll(array, values)
  8533. : array;
  8534. }
  8535. /**
  8536. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8537. * invoked for each element of `array` and `values` to generate the criterion
  8538. * by which they're compared. The iteratee is invoked with one argument: (value).
  8539. *
  8540. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8541. *
  8542. * @static
  8543. * @memberOf _
  8544. * @since 4.0.0
  8545. * @category Array
  8546. * @param {Array} array The array to modify.
  8547. * @param {Array} values The values to remove.
  8548. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8549. * @returns {Array} Returns `array`.
  8550. * @example
  8551. *
  8552. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8553. *
  8554. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8555. * console.log(array);
  8556. * // => [{ 'x': 2 }]
  8557. */
  8558. function pullAllBy(array, values, iteratee) {
  8559. return (array && array.length && values && values.length)
  8560. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8561. : array;
  8562. }
  8563. /**
  8564. * This method is like `_.pullAll` except that it accepts `comparator` which
  8565. * is invoked to compare elements of `array` to `values`. The comparator is
  8566. * invoked with two arguments: (arrVal, othVal).
  8567. *
  8568. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8569. *
  8570. * @static
  8571. * @memberOf _
  8572. * @since 4.6.0
  8573. * @category Array
  8574. * @param {Array} array The array to modify.
  8575. * @param {Array} values The values to remove.
  8576. * @param {Function} [comparator] The comparator invoked per element.
  8577. * @returns {Array} Returns `array`.
  8578. * @example
  8579. *
  8580. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8581. *
  8582. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8583. * console.log(array);
  8584. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8585. */
  8586. function pullAllWith(array, values, comparator) {
  8587. return (array && array.length && values && values.length)
  8588. ? basePullAll(array, values, undefined, comparator)
  8589. : array;
  8590. }
  8591. /**
  8592. * Removes elements from `array` corresponding to `indexes` and returns an
  8593. * array of removed elements.
  8594. *
  8595. * **Note:** Unlike `_.at`, this method mutates `array`.
  8596. *
  8597. * @static
  8598. * @memberOf _
  8599. * @since 3.0.0
  8600. * @category Array
  8601. * @param {Array} array The array to modify.
  8602. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8603. * @returns {Array} Returns the new array of removed elements.
  8604. * @example
  8605. *
  8606. * var array = ['a', 'b', 'c', 'd'];
  8607. * var pulled = _.pullAt(array, [1, 3]);
  8608. *
  8609. * console.log(array);
  8610. * // => ['a', 'c']
  8611. *
  8612. * console.log(pulled);
  8613. * // => ['b', 'd']
  8614. */
  8615. var pullAt = flatRest(function(array, indexes) {
  8616. var length = array == null ? 0 : array.length,
  8617. result = baseAt(array, indexes);
  8618. basePullAt(array, arrayMap(indexes, function(index) {
  8619. return isIndex(index, length) ? +index : index;
  8620. }).sort(compareAscending));
  8621. return result;
  8622. });
  8623. /**
  8624. * Removes all elements from `array` that `predicate` returns truthy for
  8625. * and returns an array of the removed elements. The predicate is invoked
  8626. * with three arguments: (value, index, array).
  8627. *
  8628. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8629. * to pull elements from an array by value.
  8630. *
  8631. * @static
  8632. * @memberOf _
  8633. * @since 2.0.0
  8634. * @category Array
  8635. * @param {Array} array The array to modify.
  8636. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8637. * @returns {Array} Returns the new array of removed elements.
  8638. * @example
  8639. *
  8640. * var array = [1, 2, 3, 4];
  8641. * var evens = _.remove(array, function(n) {
  8642. * return n % 2 == 0;
  8643. * });
  8644. *
  8645. * console.log(array);
  8646. * // => [1, 3]
  8647. *
  8648. * console.log(evens);
  8649. * // => [2, 4]
  8650. */
  8651. function remove(array, predicate) {
  8652. var result = [];
  8653. if (!(array && array.length)) {
  8654. return result;
  8655. }
  8656. var index = -1,
  8657. indexes = [],
  8658. length = array.length;
  8659. predicate = getIteratee(predicate, 3);
  8660. while (++index < length) {
  8661. var value = array[index];
  8662. if (predicate(value, index, array)) {
  8663. result.push(value);
  8664. indexes.push(index);
  8665. }
  8666. }
  8667. basePullAt(array, indexes);
  8668. return result;
  8669. }
  8670. /**
  8671. * Reverses `array` so that the first element becomes the last, the second
  8672. * element becomes the second to last, and so on.
  8673. *
  8674. * **Note:** This method mutates `array` and is based on
  8675. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8676. *
  8677. * @static
  8678. * @memberOf _
  8679. * @since 4.0.0
  8680. * @category Array
  8681. * @param {Array} array The array to modify.
  8682. * @returns {Array} Returns `array`.
  8683. * @example
  8684. *
  8685. * var array = [1, 2, 3];
  8686. *
  8687. * _.reverse(array);
  8688. * // => [3, 2, 1]
  8689. *
  8690. * console.log(array);
  8691. * // => [3, 2, 1]
  8692. */
  8693. function reverse(array) {
  8694. return array == null ? array : nativeReverse.call(array);
  8695. }
  8696. /**
  8697. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8698. *
  8699. * **Note:** This method is used instead of
  8700. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8701. * returned.
  8702. *
  8703. * @static
  8704. * @memberOf _
  8705. * @since 3.0.0
  8706. * @category Array
  8707. * @param {Array} array The array to slice.
  8708. * @param {number} [start=0] The start position.
  8709. * @param {number} [end=array.length] The end position.
  8710. * @returns {Array} Returns the slice of `array`.
  8711. */
  8712. function slice(array, start, end) {
  8713. var length = array == null ? 0 : array.length;
  8714. if (!length) {
  8715. return [];
  8716. }
  8717. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8718. start = 0;
  8719. end = length;
  8720. }
  8721. else {
  8722. start = start == null ? 0 : toInteger(start);
  8723. end = end === undefined ? length : toInteger(end);
  8724. }
  8725. return baseSlice(array, start, end);
  8726. }
  8727. /**
  8728. * Uses a binary search to determine the lowest index at which `value`
  8729. * should be inserted into `array` in order to maintain its sort order.
  8730. *
  8731. * @static
  8732. * @memberOf _
  8733. * @since 0.1.0
  8734. * @category Array
  8735. * @param {Array} array The sorted array to inspect.
  8736. * @param {*} value The value to evaluate.
  8737. * @returns {number} Returns the index at which `value` should be inserted
  8738. * into `array`.
  8739. * @example
  8740. *
  8741. * _.sortedIndex([30, 50], 40);
  8742. * // => 1
  8743. */
  8744. function sortedIndex(array, value) {
  8745. return baseSortedIndex(array, value);
  8746. }
  8747. /**
  8748. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8749. * which is invoked for `value` and each element of `array` to compute their
  8750. * sort ranking. The iteratee is invoked with one argument: (value).
  8751. *
  8752. * @static
  8753. * @memberOf _
  8754. * @since 4.0.0
  8755. * @category Array
  8756. * @param {Array} array The sorted array to inspect.
  8757. * @param {*} value The value to evaluate.
  8758. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8759. * @returns {number} Returns the index at which `value` should be inserted
  8760. * into `array`.
  8761. * @example
  8762. *
  8763. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8764. *
  8765. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8766. * // => 0
  8767. *
  8768. * // The `_.property` iteratee shorthand.
  8769. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8770. * // => 0
  8771. */
  8772. function sortedIndexBy(array, value, iteratee) {
  8773. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8774. }
  8775. /**
  8776. * This method is like `_.indexOf` except that it performs a binary
  8777. * search on a sorted `array`.
  8778. *
  8779. * @static
  8780. * @memberOf _
  8781. * @since 4.0.0
  8782. * @category Array
  8783. * @param {Array} array The array to inspect.
  8784. * @param {*} value The value to search for.
  8785. * @returns {number} Returns the index of the matched value, else `-1`.
  8786. * @example
  8787. *
  8788. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8789. * // => 1
  8790. */
  8791. function sortedIndexOf(array, value) {
  8792. var length = array == null ? 0 : array.length;
  8793. if (length) {
  8794. var index = baseSortedIndex(array, value);
  8795. if (index < length && eq(array[index], value)) {
  8796. return index;
  8797. }
  8798. }
  8799. return -1;
  8800. }
  8801. /**
  8802. * This method is like `_.sortedIndex` except that it returns the highest
  8803. * index at which `value` should be inserted into `array` in order to
  8804. * maintain its sort order.
  8805. *
  8806. * @static
  8807. * @memberOf _
  8808. * @since 3.0.0
  8809. * @category Array
  8810. * @param {Array} array The sorted array to inspect.
  8811. * @param {*} value The value to evaluate.
  8812. * @returns {number} Returns the index at which `value` should be inserted
  8813. * into `array`.
  8814. * @example
  8815. *
  8816. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8817. * // => 4
  8818. */
  8819. function sortedLastIndex(array, value) {
  8820. return baseSortedIndex(array, value, true);
  8821. }
  8822. /**
  8823. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8824. * which is invoked for `value` and each element of `array` to compute their
  8825. * sort ranking. The iteratee is invoked with one argument: (value).
  8826. *
  8827. * @static
  8828. * @memberOf _
  8829. * @since 4.0.0
  8830. * @category Array
  8831. * @param {Array} array The sorted array to inspect.
  8832. * @param {*} value The value to evaluate.
  8833. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8834. * @returns {number} Returns the index at which `value` should be inserted
  8835. * into `array`.
  8836. * @example
  8837. *
  8838. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8839. *
  8840. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8841. * // => 1
  8842. *
  8843. * // The `_.property` iteratee shorthand.
  8844. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8845. * // => 1
  8846. */
  8847. function sortedLastIndexBy(array, value, iteratee) {
  8848. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8849. }
  8850. /**
  8851. * This method is like `_.lastIndexOf` except that it performs a binary
  8852. * search on a sorted `array`.
  8853. *
  8854. * @static
  8855. * @memberOf _
  8856. * @since 4.0.0
  8857. * @category Array
  8858. * @param {Array} array The array to inspect.
  8859. * @param {*} value The value to search for.
  8860. * @returns {number} Returns the index of the matched value, else `-1`.
  8861. * @example
  8862. *
  8863. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8864. * // => 3
  8865. */
  8866. function sortedLastIndexOf(array, value) {
  8867. var length = array == null ? 0 : array.length;
  8868. if (length) {
  8869. var index = baseSortedIndex(array, value, true) - 1;
  8870. if (eq(array[index], value)) {
  8871. return index;
  8872. }
  8873. }
  8874. return -1;
  8875. }
  8876. /**
  8877. * This method is like `_.uniq` except that it's designed and optimized
  8878. * for sorted arrays.
  8879. *
  8880. * @static
  8881. * @memberOf _
  8882. * @since 4.0.0
  8883. * @category Array
  8884. * @param {Array} array The array to inspect.
  8885. * @returns {Array} Returns the new duplicate free array.
  8886. * @example
  8887. *
  8888. * _.sortedUniq([1, 1, 2]);
  8889. * // => [1, 2]
  8890. */
  8891. function sortedUniq(array) {
  8892. return (array && array.length)
  8893. ? baseSortedUniq(array)
  8894. : [];
  8895. }
  8896. /**
  8897. * This method is like `_.uniqBy` except that it's designed and optimized
  8898. * for sorted arrays.
  8899. *
  8900. * @static
  8901. * @memberOf _
  8902. * @since 4.0.0
  8903. * @category Array
  8904. * @param {Array} array The array to inspect.
  8905. * @param {Function} [iteratee] The iteratee invoked per element.
  8906. * @returns {Array} Returns the new duplicate free array.
  8907. * @example
  8908. *
  8909. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8910. * // => [1.1, 2.3]
  8911. */
  8912. function sortedUniqBy(array, iteratee) {
  8913. return (array && array.length)
  8914. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8915. : [];
  8916. }
  8917. /**
  8918. * Gets all but the first element of `array`.
  8919. *
  8920. * @static
  8921. * @memberOf _
  8922. * @since 4.0.0
  8923. * @category Array
  8924. * @param {Array} array The array to query.
  8925. * @returns {Array} Returns the slice of `array`.
  8926. * @example
  8927. *
  8928. * _.tail([1, 2, 3]);
  8929. * // => [2, 3]
  8930. */
  8931. function tail(array) {
  8932. var length = array == null ? 0 : array.length;
  8933. return length ? baseSlice(array, 1, length) : [];
  8934. }
  8935. /**
  8936. * Creates a slice of `array` with `n` elements taken from the beginning.
  8937. *
  8938. * @static
  8939. * @memberOf _
  8940. * @since 0.1.0
  8941. * @category Array
  8942. * @param {Array} array The array to query.
  8943. * @param {number} [n=1] The number of elements to take.
  8944. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8945. * @returns {Array} Returns the slice of `array`.
  8946. * @example
  8947. *
  8948. * _.take([1, 2, 3]);
  8949. * // => [1]
  8950. *
  8951. * _.take([1, 2, 3], 2);
  8952. * // => [1, 2]
  8953. *
  8954. * _.take([1, 2, 3], 5);
  8955. * // => [1, 2, 3]
  8956. *
  8957. * _.take([1, 2, 3], 0);
  8958. * // => []
  8959. */
  8960. function take(array, n, guard) {
  8961. if (!(array && array.length)) {
  8962. return [];
  8963. }
  8964. n = (guard || n === undefined) ? 1 : toInteger(n);
  8965. return baseSlice(array, 0, n < 0 ? 0 : n);
  8966. }
  8967. /**
  8968. * Creates a slice of `array` with `n` elements taken from the end.
  8969. *
  8970. * @static
  8971. * @memberOf _
  8972. * @since 3.0.0
  8973. * @category Array
  8974. * @param {Array} array The array to query.
  8975. * @param {number} [n=1] The number of elements to take.
  8976. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8977. * @returns {Array} Returns the slice of `array`.
  8978. * @example
  8979. *
  8980. * _.takeRight([1, 2, 3]);
  8981. * // => [3]
  8982. *
  8983. * _.takeRight([1, 2, 3], 2);
  8984. * // => [2, 3]
  8985. *
  8986. * _.takeRight([1, 2, 3], 5);
  8987. * // => [1, 2, 3]
  8988. *
  8989. * _.takeRight([1, 2, 3], 0);
  8990. * // => []
  8991. */
  8992. function takeRight(array, n, guard) {
  8993. var length = array == null ? 0 : array.length;
  8994. if (!length) {
  8995. return [];
  8996. }
  8997. n = (guard || n === undefined) ? 1 : toInteger(n);
  8998. n = length - n;
  8999. return baseSlice(array, n < 0 ? 0 : n, length);
  9000. }
  9001. /**
  9002. * Creates a slice of `array` with elements taken from the end. Elements are
  9003. * taken until `predicate` returns falsey. The predicate is invoked with
  9004. * three arguments: (value, index, array).
  9005. *
  9006. * @static
  9007. * @memberOf _
  9008. * @since 3.0.0
  9009. * @category Array
  9010. * @param {Array} array The array to query.
  9011. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9012. * @returns {Array} Returns the slice of `array`.
  9013. * @example
  9014. *
  9015. * var users = [
  9016. * { 'user': 'barney', 'active': true },
  9017. * { 'user': 'fred', 'active': false },
  9018. * { 'user': 'pebbles', 'active': false }
  9019. * ];
  9020. *
  9021. * _.takeRightWhile(users, function(o) { return !o.active; });
  9022. * // => objects for ['fred', 'pebbles']
  9023. *
  9024. * // The `_.matches` iteratee shorthand.
  9025. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  9026. * // => objects for ['pebbles']
  9027. *
  9028. * // The `_.matchesProperty` iteratee shorthand.
  9029. * _.takeRightWhile(users, ['active', false]);
  9030. * // => objects for ['fred', 'pebbles']
  9031. *
  9032. * // The `_.property` iteratee shorthand.
  9033. * _.takeRightWhile(users, 'active');
  9034. * // => []
  9035. */
  9036. function takeRightWhile(array, predicate) {
  9037. return (array && array.length)
  9038. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  9039. : [];
  9040. }
  9041. /**
  9042. * Creates a slice of `array` with elements taken from the beginning. Elements
  9043. * are taken until `predicate` returns falsey. The predicate is invoked with
  9044. * three arguments: (value, index, array).
  9045. *
  9046. * @static
  9047. * @memberOf _
  9048. * @since 3.0.0
  9049. * @category Array
  9050. * @param {Array} array The array to query.
  9051. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9052. * @returns {Array} Returns the slice of `array`.
  9053. * @example
  9054. *
  9055. * var users = [
  9056. * { 'user': 'barney', 'active': false },
  9057. * { 'user': 'fred', 'active': false },
  9058. * { 'user': 'pebbles', 'active': true }
  9059. * ];
  9060. *
  9061. * _.takeWhile(users, function(o) { return !o.active; });
  9062. * // => objects for ['barney', 'fred']
  9063. *
  9064. * // The `_.matches` iteratee shorthand.
  9065. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9066. * // => objects for ['barney']
  9067. *
  9068. * // The `_.matchesProperty` iteratee shorthand.
  9069. * _.takeWhile(users, ['active', false]);
  9070. * // => objects for ['barney', 'fred']
  9071. *
  9072. * // The `_.property` iteratee shorthand.
  9073. * _.takeWhile(users, 'active');
  9074. * // => []
  9075. */
  9076. function takeWhile(array, predicate) {
  9077. return (array && array.length)
  9078. ? baseWhile(array, getIteratee(predicate, 3))
  9079. : [];
  9080. }
  9081. /**
  9082. * Creates an array of unique values, in order, from all given arrays using
  9083. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9084. * for equality comparisons.
  9085. *
  9086. * @static
  9087. * @memberOf _
  9088. * @since 0.1.0
  9089. * @category Array
  9090. * @param {...Array} [arrays] The arrays to inspect.
  9091. * @returns {Array} Returns the new array of combined values.
  9092. * @example
  9093. *
  9094. * _.union([2], [1, 2]);
  9095. * // => [2, 1]
  9096. */
  9097. var union = baseRest(function(arrays) {
  9098. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9099. });
  9100. /**
  9101. * This method is like `_.union` except that it accepts `iteratee` which is
  9102. * invoked for each element of each `arrays` to generate the criterion by
  9103. * which uniqueness is computed. Result values are chosen from the first
  9104. * array in which the value occurs. The iteratee is invoked with one argument:
  9105. * (value).
  9106. *
  9107. * @static
  9108. * @memberOf _
  9109. * @since 4.0.0
  9110. * @category Array
  9111. * @param {...Array} [arrays] The arrays to inspect.
  9112. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9113. * @returns {Array} Returns the new array of combined values.
  9114. * @example
  9115. *
  9116. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9117. * // => [2.1, 1.2]
  9118. *
  9119. * // The `_.property` iteratee shorthand.
  9120. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9121. * // => [{ 'x': 1 }, { 'x': 2 }]
  9122. */
  9123. var unionBy = baseRest(function(arrays) {
  9124. var iteratee = last(arrays);
  9125. if (isArrayLikeObject(iteratee)) {
  9126. iteratee = undefined;
  9127. }
  9128. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9129. });
  9130. /**
  9131. * This method is like `_.union` except that it accepts `comparator` which
  9132. * is invoked to compare elements of `arrays`. Result values are chosen from
  9133. * the first array in which the value occurs. The comparator is invoked
  9134. * with two arguments: (arrVal, othVal).
  9135. *
  9136. * @static
  9137. * @memberOf _
  9138. * @since 4.0.0
  9139. * @category Array
  9140. * @param {...Array} [arrays] The arrays to inspect.
  9141. * @param {Function} [comparator] The comparator invoked per element.
  9142. * @returns {Array} Returns the new array of combined values.
  9143. * @example
  9144. *
  9145. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9146. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9147. *
  9148. * _.unionWith(objects, others, _.isEqual);
  9149. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9150. */
  9151. var unionWith = baseRest(function(arrays) {
  9152. var comparator = last(arrays);
  9153. comparator = typeof comparator == 'function' ? comparator : undefined;
  9154. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9155. });
  9156. /**
  9157. * Creates a duplicate-free version of an array, using
  9158. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9159. * for equality comparisons, in which only the first occurrence of each element
  9160. * is kept. The order of result values is determined by the order they occur
  9161. * in the array.
  9162. *
  9163. * @static
  9164. * @memberOf _
  9165. * @since 0.1.0
  9166. * @category Array
  9167. * @param {Array} array The array to inspect.
  9168. * @returns {Array} Returns the new duplicate free array.
  9169. * @example
  9170. *
  9171. * _.uniq([2, 1, 2]);
  9172. * // => [2, 1]
  9173. */
  9174. function uniq(array) {
  9175. return (array && array.length) ? baseUniq(array) : [];
  9176. }
  9177. /**
  9178. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9179. * invoked for each element in `array` to generate the criterion by which
  9180. * uniqueness is computed. The order of result values is determined by the
  9181. * order they occur in the array. The iteratee is invoked with one argument:
  9182. * (value).
  9183. *
  9184. * @static
  9185. * @memberOf _
  9186. * @since 4.0.0
  9187. * @category Array
  9188. * @param {Array} array The array to inspect.
  9189. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9190. * @returns {Array} Returns the new duplicate free array.
  9191. * @example
  9192. *
  9193. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9194. * // => [2.1, 1.2]
  9195. *
  9196. * // The `_.property` iteratee shorthand.
  9197. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9198. * // => [{ 'x': 1 }, { 'x': 2 }]
  9199. */
  9200. function uniqBy(array, iteratee) {
  9201. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9202. }
  9203. /**
  9204. * This method is like `_.uniq` except that it accepts `comparator` which
  9205. * is invoked to compare elements of `array`. The order of result values is
  9206. * determined by the order they occur in the array.The comparator is invoked
  9207. * with two arguments: (arrVal, othVal).
  9208. *
  9209. * @static
  9210. * @memberOf _
  9211. * @since 4.0.0
  9212. * @category Array
  9213. * @param {Array} array The array to inspect.
  9214. * @param {Function} [comparator] The comparator invoked per element.
  9215. * @returns {Array} Returns the new duplicate free array.
  9216. * @example
  9217. *
  9218. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9219. *
  9220. * _.uniqWith(objects, _.isEqual);
  9221. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9222. */
  9223. function uniqWith(array, comparator) {
  9224. comparator = typeof comparator == 'function' ? comparator : undefined;
  9225. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9226. }
  9227. /**
  9228. * This method is like `_.zip` except that it accepts an array of grouped
  9229. * elements and creates an array regrouping the elements to their pre-zip
  9230. * configuration.
  9231. *
  9232. * @static
  9233. * @memberOf _
  9234. * @since 1.2.0
  9235. * @category Array
  9236. * @param {Array} array The array of grouped elements to process.
  9237. * @returns {Array} Returns the new array of regrouped elements.
  9238. * @example
  9239. *
  9240. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9241. * // => [['a', 1, true], ['b', 2, false]]
  9242. *
  9243. * _.unzip(zipped);
  9244. * // => [['a', 'b'], [1, 2], [true, false]]
  9245. */
  9246. function unzip(array) {
  9247. if (!(array && array.length)) {
  9248. return [];
  9249. }
  9250. var length = 0;
  9251. array = arrayFilter(array, function(group) {
  9252. if (isArrayLikeObject(group)) {
  9253. length = nativeMax(group.length, length);
  9254. return true;
  9255. }
  9256. });
  9257. return baseTimes(length, function(index) {
  9258. return arrayMap(array, baseProperty(index));
  9259. });
  9260. }
  9261. /**
  9262. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9263. * how regrouped values should be combined. The iteratee is invoked with the
  9264. * elements of each group: (...group).
  9265. *
  9266. * @static
  9267. * @memberOf _
  9268. * @since 3.8.0
  9269. * @category Array
  9270. * @param {Array} array The array of grouped elements to process.
  9271. * @param {Function} [iteratee=_.identity] The function to combine
  9272. * regrouped values.
  9273. * @returns {Array} Returns the new array of regrouped elements.
  9274. * @example
  9275. *
  9276. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9277. * // => [[1, 10, 100], [2, 20, 200]]
  9278. *
  9279. * _.unzipWith(zipped, _.add);
  9280. * // => [3, 30, 300]
  9281. */
  9282. function unzipWith(array, iteratee) {
  9283. if (!(array && array.length)) {
  9284. return [];
  9285. }
  9286. var result = unzip(array);
  9287. if (iteratee == null) {
  9288. return result;
  9289. }
  9290. return arrayMap(result, function(group) {
  9291. return apply(iteratee, undefined, group);
  9292. });
  9293. }
  9294. /**
  9295. * Creates an array excluding all given values using
  9296. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9297. * for equality comparisons.
  9298. *
  9299. * **Note:** Unlike `_.pull`, this method returns a new array.
  9300. *
  9301. * @static
  9302. * @memberOf _
  9303. * @since 0.1.0
  9304. * @category Array
  9305. * @param {Array} array The array to inspect.
  9306. * @param {...*} [values] The values to exclude.
  9307. * @returns {Array} Returns the new array of filtered values.
  9308. * @see _.difference, _.xor
  9309. * @example
  9310. *
  9311. * _.without([2, 1, 2, 3], 1, 2);
  9312. * // => [3]
  9313. */
  9314. var without = baseRest(function(array, values) {
  9315. return isArrayLikeObject(array)
  9316. ? baseDifference(array, values)
  9317. : [];
  9318. });
  9319. /**
  9320. * Creates an array of unique values that is the
  9321. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9322. * of the given arrays. The order of result values is determined by the order
  9323. * they occur in the arrays.
  9324. *
  9325. * @static
  9326. * @memberOf _
  9327. * @since 2.4.0
  9328. * @category Array
  9329. * @param {...Array} [arrays] The arrays to inspect.
  9330. * @returns {Array} Returns the new array of filtered values.
  9331. * @see _.difference, _.without
  9332. * @example
  9333. *
  9334. * _.xor([2, 1], [2, 3]);
  9335. * // => [1, 3]
  9336. */
  9337. var xor = baseRest(function(arrays) {
  9338. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9339. });
  9340. /**
  9341. * This method is like `_.xor` except that it accepts `iteratee` which is
  9342. * invoked for each element of each `arrays` to generate the criterion by
  9343. * which by which they're compared. The order of result values is determined
  9344. * by the order they occur in the arrays. The iteratee is invoked with one
  9345. * argument: (value).
  9346. *
  9347. * @static
  9348. * @memberOf _
  9349. * @since 4.0.0
  9350. * @category Array
  9351. * @param {...Array} [arrays] The arrays to inspect.
  9352. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9353. * @returns {Array} Returns the new array of filtered values.
  9354. * @example
  9355. *
  9356. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9357. * // => [1.2, 3.4]
  9358. *
  9359. * // The `_.property` iteratee shorthand.
  9360. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9361. * // => [{ 'x': 2 }]
  9362. */
  9363. var xorBy = baseRest(function(arrays) {
  9364. var iteratee = last(arrays);
  9365. if (isArrayLikeObject(iteratee)) {
  9366. iteratee = undefined;
  9367. }
  9368. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9369. });
  9370. /**
  9371. * This method is like `_.xor` except that it accepts `comparator` which is
  9372. * invoked to compare elements of `arrays`. The order of result values is
  9373. * determined by the order they occur in the arrays. The comparator is invoked
  9374. * with two arguments: (arrVal, othVal).
  9375. *
  9376. * @static
  9377. * @memberOf _
  9378. * @since 4.0.0
  9379. * @category Array
  9380. * @param {...Array} [arrays] The arrays to inspect.
  9381. * @param {Function} [comparator] The comparator invoked per element.
  9382. * @returns {Array} Returns the new array of filtered values.
  9383. * @example
  9384. *
  9385. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9386. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9387. *
  9388. * _.xorWith(objects, others, _.isEqual);
  9389. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9390. */
  9391. var xorWith = baseRest(function(arrays) {
  9392. var comparator = last(arrays);
  9393. comparator = typeof comparator == 'function' ? comparator : undefined;
  9394. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9395. });
  9396. /**
  9397. * Creates an array of grouped elements, the first of which contains the
  9398. * first elements of the given arrays, the second of which contains the
  9399. * second elements of the given arrays, and so on.
  9400. *
  9401. * @static
  9402. * @memberOf _
  9403. * @since 0.1.0
  9404. * @category Array
  9405. * @param {...Array} [arrays] The arrays to process.
  9406. * @returns {Array} Returns the new array of grouped elements.
  9407. * @example
  9408. *
  9409. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9410. * // => [['a', 1, true], ['b', 2, false]]
  9411. */
  9412. var zip = baseRest(unzip);
  9413. /**
  9414. * This method is like `_.fromPairs` except that it accepts two arrays,
  9415. * one of property identifiers and one of corresponding values.
  9416. *
  9417. * @static
  9418. * @memberOf _
  9419. * @since 0.4.0
  9420. * @category Array
  9421. * @param {Array} [props=[]] The property identifiers.
  9422. * @param {Array} [values=[]] The property values.
  9423. * @returns {Object} Returns the new object.
  9424. * @example
  9425. *
  9426. * _.zipObject(['a', 'b'], [1, 2]);
  9427. * // => { 'a': 1, 'b': 2 }
  9428. */
  9429. function zipObject(props, values) {
  9430. return baseZipObject(props || [], values || [], assignValue);
  9431. }
  9432. /**
  9433. * This method is like `_.zipObject` except that it supports property paths.
  9434. *
  9435. * @static
  9436. * @memberOf _
  9437. * @since 4.1.0
  9438. * @category Array
  9439. * @param {Array} [props=[]] The property identifiers.
  9440. * @param {Array} [values=[]] The property values.
  9441. * @returns {Object} Returns the new object.
  9442. * @example
  9443. *
  9444. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9445. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9446. */
  9447. function zipObjectDeep(props, values) {
  9448. return baseZipObject(props || [], values || [], baseSet);
  9449. }
  9450. /**
  9451. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9452. * how grouped values should be combined. The iteratee is invoked with the
  9453. * elements of each group: (...group).
  9454. *
  9455. * @static
  9456. * @memberOf _
  9457. * @since 3.8.0
  9458. * @category Array
  9459. * @param {...Array} [arrays] The arrays to process.
  9460. * @param {Function} [iteratee=_.identity] The function to combine
  9461. * grouped values.
  9462. * @returns {Array} Returns the new array of grouped elements.
  9463. * @example
  9464. *
  9465. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9466. * return a + b + c;
  9467. * });
  9468. * // => [111, 222]
  9469. */
  9470. var zipWith = baseRest(function(arrays) {
  9471. var length = arrays.length,
  9472. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9473. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9474. return unzipWith(arrays, iteratee);
  9475. });
  9476. /*------------------------------------------------------------------------*/
  9477. /**
  9478. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9479. * chain sequences enabled. The result of such sequences must be unwrapped
  9480. * with `_#value`.
  9481. *
  9482. * @static
  9483. * @memberOf _
  9484. * @since 1.3.0
  9485. * @category Seq
  9486. * @param {*} value The value to wrap.
  9487. * @returns {Object} Returns the new `lodash` wrapper instance.
  9488. * @example
  9489. *
  9490. * var users = [
  9491. * { 'user': 'barney', 'age': 36 },
  9492. * { 'user': 'fred', 'age': 40 },
  9493. * { 'user': 'pebbles', 'age': 1 }
  9494. * ];
  9495. *
  9496. * var youngest = _
  9497. * .chain(users)
  9498. * .sortBy('age')
  9499. * .map(function(o) {
  9500. * return o.user + ' is ' + o.age;
  9501. * })
  9502. * .head()
  9503. * .value();
  9504. * // => 'pebbles is 1'
  9505. */
  9506. function chain(value) {
  9507. var result = lodash(value);
  9508. result.__chain__ = true;
  9509. return result;
  9510. }
  9511. /**
  9512. * This method invokes `interceptor` and returns `value`. The interceptor
  9513. * is invoked with one argument; (value). The purpose of this method is to
  9514. * "tap into" a method chain sequence in order to modify intermediate results.
  9515. *
  9516. * @static
  9517. * @memberOf _
  9518. * @since 0.1.0
  9519. * @category Seq
  9520. * @param {*} value The value to provide to `interceptor`.
  9521. * @param {Function} interceptor The function to invoke.
  9522. * @returns {*} Returns `value`.
  9523. * @example
  9524. *
  9525. * _([1, 2, 3])
  9526. * .tap(function(array) {
  9527. * // Mutate input array.
  9528. * array.pop();
  9529. * })
  9530. * .reverse()
  9531. * .value();
  9532. * // => [2, 1]
  9533. */
  9534. function tap(value, interceptor) {
  9535. interceptor(value);
  9536. return value;
  9537. }
  9538. /**
  9539. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9540. * The purpose of this method is to "pass thru" values replacing intermediate
  9541. * results in a method chain sequence.
  9542. *
  9543. * @static
  9544. * @memberOf _
  9545. * @since 3.0.0
  9546. * @category Seq
  9547. * @param {*} value The value to provide to `interceptor`.
  9548. * @param {Function} interceptor The function to invoke.
  9549. * @returns {*} Returns the result of `interceptor`.
  9550. * @example
  9551. *
  9552. * _(' abc ')
  9553. * .chain()
  9554. * .trim()
  9555. * .thru(function(value) {
  9556. * return [value];
  9557. * })
  9558. * .value();
  9559. * // => ['abc']
  9560. */
  9561. function thru(value, interceptor) {
  9562. return interceptor(value);
  9563. }
  9564. /**
  9565. * This method is the wrapper version of `_.at`.
  9566. *
  9567. * @name at
  9568. * @memberOf _
  9569. * @since 1.0.0
  9570. * @category Seq
  9571. * @param {...(string|string[])} [paths] The property paths to pick.
  9572. * @returns {Object} Returns the new `lodash` wrapper instance.
  9573. * @example
  9574. *
  9575. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9576. *
  9577. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9578. * // => [3, 4]
  9579. */
  9580. var wrapperAt = flatRest(function(paths) {
  9581. var length = paths.length,
  9582. start = length ? paths[0] : 0,
  9583. value = this.__wrapped__,
  9584. interceptor = function(object) { return baseAt(object, paths); };
  9585. if (length > 1 || this.__actions__.length ||
  9586. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9587. return this.thru(interceptor);
  9588. }
  9589. value = value.slice(start, +start + (length ? 1 : 0));
  9590. value.__actions__.push({
  9591. 'func': thru,
  9592. 'args': [interceptor],
  9593. 'thisArg': undefined
  9594. });
  9595. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9596. if (length && !array.length) {
  9597. array.push(undefined);
  9598. }
  9599. return array;
  9600. });
  9601. });
  9602. /**
  9603. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9604. *
  9605. * @name chain
  9606. * @memberOf _
  9607. * @since 0.1.0
  9608. * @category Seq
  9609. * @returns {Object} Returns the new `lodash` wrapper instance.
  9610. * @example
  9611. *
  9612. * var users = [
  9613. * { 'user': 'barney', 'age': 36 },
  9614. * { 'user': 'fred', 'age': 40 }
  9615. * ];
  9616. *
  9617. * // A sequence without explicit chaining.
  9618. * _(users).head();
  9619. * // => { 'user': 'barney', 'age': 36 }
  9620. *
  9621. * // A sequence with explicit chaining.
  9622. * _(users)
  9623. * .chain()
  9624. * .head()
  9625. * .pick('user')
  9626. * .value();
  9627. * // => { 'user': 'barney' }
  9628. */
  9629. function wrapperChain() {
  9630. return chain(this);
  9631. }
  9632. /**
  9633. * Executes the chain sequence and returns the wrapped result.
  9634. *
  9635. * @name commit
  9636. * @memberOf _
  9637. * @since 3.2.0
  9638. * @category Seq
  9639. * @returns {Object} Returns the new `lodash` wrapper instance.
  9640. * @example
  9641. *
  9642. * var array = [1, 2];
  9643. * var wrapped = _(array).push(3);
  9644. *
  9645. * console.log(array);
  9646. * // => [1, 2]
  9647. *
  9648. * wrapped = wrapped.commit();
  9649. * console.log(array);
  9650. * // => [1, 2, 3]
  9651. *
  9652. * wrapped.last();
  9653. * // => 3
  9654. *
  9655. * console.log(array);
  9656. * // => [1, 2, 3]
  9657. */
  9658. function wrapperCommit() {
  9659. return new LodashWrapper(this.value(), this.__chain__);
  9660. }
  9661. /**
  9662. * Gets the next value on a wrapped object following the
  9663. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9664. *
  9665. * @name next
  9666. * @memberOf _
  9667. * @since 4.0.0
  9668. * @category Seq
  9669. * @returns {Object} Returns the next iterator value.
  9670. * @example
  9671. *
  9672. * var wrapped = _([1, 2]);
  9673. *
  9674. * wrapped.next();
  9675. * // => { 'done': false, 'value': 1 }
  9676. *
  9677. * wrapped.next();
  9678. * // => { 'done': false, 'value': 2 }
  9679. *
  9680. * wrapped.next();
  9681. * // => { 'done': true, 'value': undefined }
  9682. */
  9683. function wrapperNext() {
  9684. if (this.__values__ === undefined) {
  9685. this.__values__ = toArray(this.value());
  9686. }
  9687. var done = this.__index__ >= this.__values__.length,
  9688. value = done ? undefined : this.__values__[this.__index__++];
  9689. return { 'done': done, 'value': value };
  9690. }
  9691. /**
  9692. * Enables the wrapper to be iterable.
  9693. *
  9694. * @name Symbol.iterator
  9695. * @memberOf _
  9696. * @since 4.0.0
  9697. * @category Seq
  9698. * @returns {Object} Returns the wrapper object.
  9699. * @example
  9700. *
  9701. * var wrapped = _([1, 2]);
  9702. *
  9703. * wrapped[Symbol.iterator]() === wrapped;
  9704. * // => true
  9705. *
  9706. * Array.from(wrapped);
  9707. * // => [1, 2]
  9708. */
  9709. function wrapperToIterator() {
  9710. return this;
  9711. }
  9712. /**
  9713. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9714. *
  9715. * @name plant
  9716. * @memberOf _
  9717. * @since 3.2.0
  9718. * @category Seq
  9719. * @param {*} value The value to plant.
  9720. * @returns {Object} Returns the new `lodash` wrapper instance.
  9721. * @example
  9722. *
  9723. * function square(n) {
  9724. * return n * n;
  9725. * }
  9726. *
  9727. * var wrapped = _([1, 2]).map(square);
  9728. * var other = wrapped.plant([3, 4]);
  9729. *
  9730. * other.value();
  9731. * // => [9, 16]
  9732. *
  9733. * wrapped.value();
  9734. * // => [1, 4]
  9735. */
  9736. function wrapperPlant(value) {
  9737. var result,
  9738. parent = this;
  9739. while (parent instanceof baseLodash) {
  9740. var clone = wrapperClone(parent);
  9741. clone.__index__ = 0;
  9742. clone.__values__ = undefined;
  9743. if (result) {
  9744. previous.__wrapped__ = clone;
  9745. } else {
  9746. result = clone;
  9747. }
  9748. var previous = clone;
  9749. parent = parent.__wrapped__;
  9750. }
  9751. previous.__wrapped__ = value;
  9752. return result;
  9753. }
  9754. /**
  9755. * This method is the wrapper version of `_.reverse`.
  9756. *
  9757. * **Note:** This method mutates the wrapped array.
  9758. *
  9759. * @name reverse
  9760. * @memberOf _
  9761. * @since 0.1.0
  9762. * @category Seq
  9763. * @returns {Object} Returns the new `lodash` wrapper instance.
  9764. * @example
  9765. *
  9766. * var array = [1, 2, 3];
  9767. *
  9768. * _(array).reverse().value()
  9769. * // => [3, 2, 1]
  9770. *
  9771. * console.log(array);
  9772. * // => [3, 2, 1]
  9773. */
  9774. function wrapperReverse() {
  9775. var value = this.__wrapped__;
  9776. if (value instanceof LazyWrapper) {
  9777. var wrapped = value;
  9778. if (this.__actions__.length) {
  9779. wrapped = new LazyWrapper(this);
  9780. }
  9781. wrapped = wrapped.reverse();
  9782. wrapped.__actions__.push({
  9783. 'func': thru,
  9784. 'args': [reverse],
  9785. 'thisArg': undefined
  9786. });
  9787. return new LodashWrapper(wrapped, this.__chain__);
  9788. }
  9789. return this.thru(reverse);
  9790. }
  9791. /**
  9792. * Executes the chain sequence to resolve the unwrapped value.
  9793. *
  9794. * @name value
  9795. * @memberOf _
  9796. * @since 0.1.0
  9797. * @alias toJSON, valueOf
  9798. * @category Seq
  9799. * @returns {*} Returns the resolved unwrapped value.
  9800. * @example
  9801. *
  9802. * _([1, 2, 3]).value();
  9803. * // => [1, 2, 3]
  9804. */
  9805. function wrapperValue() {
  9806. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9807. }
  9808. /*------------------------------------------------------------------------*/
  9809. /**
  9810. * Creates an object composed of keys generated from the results of running
  9811. * each element of `collection` thru `iteratee`. The corresponding value of
  9812. * each key is the number of times the key was returned by `iteratee`. The
  9813. * iteratee is invoked with one argument: (value).
  9814. *
  9815. * @static
  9816. * @memberOf _
  9817. * @since 0.5.0
  9818. * @category Collection
  9819. * @param {Array|Object} collection The collection to iterate over.
  9820. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9821. * @returns {Object} Returns the composed aggregate object.
  9822. * @example
  9823. *
  9824. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9825. * // => { '4': 1, '6': 2 }
  9826. *
  9827. * // The `_.property` iteratee shorthand.
  9828. * _.countBy(['one', 'two', 'three'], 'length');
  9829. * // => { '3': 2, '5': 1 }
  9830. */
  9831. var countBy = createAggregator(function(result, value, key) {
  9832. if (hasOwnProperty.call(result, key)) {
  9833. ++result[key];
  9834. } else {
  9835. baseAssignValue(result, key, 1);
  9836. }
  9837. });
  9838. /**
  9839. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9840. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9841. * invoked with three arguments: (value, index|key, collection).
  9842. *
  9843. * **Note:** This method returns `true` for
  9844. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9845. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9846. * elements of empty collections.
  9847. *
  9848. * @static
  9849. * @memberOf _
  9850. * @since 0.1.0
  9851. * @category Collection
  9852. * @param {Array|Object} collection The collection to iterate over.
  9853. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9854. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9855. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9856. * else `false`.
  9857. * @example
  9858. *
  9859. * _.every([true, 1, null, 'yes'], Boolean);
  9860. * // => false
  9861. *
  9862. * var users = [
  9863. * { 'user': 'barney', 'age': 36, 'active': false },
  9864. * { 'user': 'fred', 'age': 40, 'active': false }
  9865. * ];
  9866. *
  9867. * // The `_.matches` iteratee shorthand.
  9868. * _.every(users, { 'user': 'barney', 'active': false });
  9869. * // => false
  9870. *
  9871. * // The `_.matchesProperty` iteratee shorthand.
  9872. * _.every(users, ['active', false]);
  9873. * // => true
  9874. *
  9875. * // The `_.property` iteratee shorthand.
  9876. * _.every(users, 'active');
  9877. * // => false
  9878. */
  9879. function every(collection, predicate, guard) {
  9880. var func = isArray(collection) ? arrayEvery : baseEvery;
  9881. if (guard && isIterateeCall(collection, predicate, guard)) {
  9882. predicate = undefined;
  9883. }
  9884. return func(collection, getIteratee(predicate, 3));
  9885. }
  9886. /**
  9887. * Iterates over elements of `collection`, returning an array of all elements
  9888. * `predicate` returns truthy for. The predicate is invoked with three
  9889. * arguments: (value, index|key, collection).
  9890. *
  9891. * **Note:** Unlike `_.remove`, this method returns a new array.
  9892. *
  9893. * @static
  9894. * @memberOf _
  9895. * @since 0.1.0
  9896. * @category Collection
  9897. * @param {Array|Object} collection The collection to iterate over.
  9898. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9899. * @returns {Array} Returns the new filtered array.
  9900. * @see _.reject
  9901. * @example
  9902. *
  9903. * var users = [
  9904. * { 'user': 'barney', 'age': 36, 'active': true },
  9905. * { 'user': 'fred', 'age': 40, 'active': false }
  9906. * ];
  9907. *
  9908. * _.filter(users, function(o) { return !o.active; });
  9909. * // => objects for ['fred']
  9910. *
  9911. * // The `_.matches` iteratee shorthand.
  9912. * _.filter(users, { 'age': 36, 'active': true });
  9913. * // => objects for ['barney']
  9914. *
  9915. * // The `_.matchesProperty` iteratee shorthand.
  9916. * _.filter(users, ['active', false]);
  9917. * // => objects for ['fred']
  9918. *
  9919. * // The `_.property` iteratee shorthand.
  9920. * _.filter(users, 'active');
  9921. * // => objects for ['barney']
  9922. *
  9923. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9924. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9925. * // => objects for ['fred', 'barney']
  9926. */
  9927. function filter(collection, predicate) {
  9928. var func = isArray(collection) ? arrayFilter : baseFilter;
  9929. return func(collection, getIteratee(predicate, 3));
  9930. }
  9931. /**
  9932. * Iterates over elements of `collection`, returning the first element
  9933. * `predicate` returns truthy for. The predicate is invoked with three
  9934. * arguments: (value, index|key, collection).
  9935. *
  9936. * @static
  9937. * @memberOf _
  9938. * @since 0.1.0
  9939. * @category Collection
  9940. * @param {Array|Object} collection The collection to inspect.
  9941. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9942. * @param {number} [fromIndex=0] The index to search from.
  9943. * @returns {*} Returns the matched element, else `undefined`.
  9944. * @example
  9945. *
  9946. * var users = [
  9947. * { 'user': 'barney', 'age': 36, 'active': true },
  9948. * { 'user': 'fred', 'age': 40, 'active': false },
  9949. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9950. * ];
  9951. *
  9952. * _.find(users, function(o) { return o.age < 40; });
  9953. * // => object for 'barney'
  9954. *
  9955. * // The `_.matches` iteratee shorthand.
  9956. * _.find(users, { 'age': 1, 'active': true });
  9957. * // => object for 'pebbles'
  9958. *
  9959. * // The `_.matchesProperty` iteratee shorthand.
  9960. * _.find(users, ['active', false]);
  9961. * // => object for 'fred'
  9962. *
  9963. * // The `_.property` iteratee shorthand.
  9964. * _.find(users, 'active');
  9965. * // => object for 'barney'
  9966. */
  9967. var find = createFind(findIndex);
  9968. /**
  9969. * This method is like `_.find` except that it iterates over elements of
  9970. * `collection` from right to left.
  9971. *
  9972. * @static
  9973. * @memberOf _
  9974. * @since 2.0.0
  9975. * @category Collection
  9976. * @param {Array|Object} collection The collection to inspect.
  9977. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9978. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9979. * @returns {*} Returns the matched element, else `undefined`.
  9980. * @example
  9981. *
  9982. * _.findLast([1, 2, 3, 4], function(n) {
  9983. * return n % 2 == 1;
  9984. * });
  9985. * // => 3
  9986. */
  9987. var findLast = createFind(findLastIndex);
  9988. /**
  9989. * Creates a flattened array of values by running each element in `collection`
  9990. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9991. * with three arguments: (value, index|key, collection).
  9992. *
  9993. * @static
  9994. * @memberOf _
  9995. * @since 4.0.0
  9996. * @category Collection
  9997. * @param {Array|Object} collection The collection to iterate over.
  9998. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9999. * @returns {Array} Returns the new flattened array.
  10000. * @example
  10001. *
  10002. * function duplicate(n) {
  10003. * return [n, n];
  10004. * }
  10005. *
  10006. * _.flatMap([1, 2], duplicate);
  10007. * // => [1, 1, 2, 2]
  10008. */
  10009. function flatMap(collection, iteratee) {
  10010. return baseFlatten(map(collection, iteratee), 1);
  10011. }
  10012. /**
  10013. * This method is like `_.flatMap` except that it recursively flattens the
  10014. * mapped results.
  10015. *
  10016. * @static
  10017. * @memberOf _
  10018. * @since 4.7.0
  10019. * @category Collection
  10020. * @param {Array|Object} collection The collection to iterate over.
  10021. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10022. * @returns {Array} Returns the new flattened array.
  10023. * @example
  10024. *
  10025. * function duplicate(n) {
  10026. * return [[[n, n]]];
  10027. * }
  10028. *
  10029. * _.flatMapDeep([1, 2], duplicate);
  10030. * // => [1, 1, 2, 2]
  10031. */
  10032. function flatMapDeep(collection, iteratee) {
  10033. return baseFlatten(map(collection, iteratee), INFINITY);
  10034. }
  10035. /**
  10036. * This method is like `_.flatMap` except that it recursively flattens the
  10037. * mapped results up to `depth` times.
  10038. *
  10039. * @static
  10040. * @memberOf _
  10041. * @since 4.7.0
  10042. * @category Collection
  10043. * @param {Array|Object} collection The collection to iterate over.
  10044. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10045. * @param {number} [depth=1] The maximum recursion depth.
  10046. * @returns {Array} Returns the new flattened array.
  10047. * @example
  10048. *
  10049. * function duplicate(n) {
  10050. * return [[[n, n]]];
  10051. * }
  10052. *
  10053. * _.flatMapDepth([1, 2], duplicate, 2);
  10054. * // => [[1, 1], [2, 2]]
  10055. */
  10056. function flatMapDepth(collection, iteratee, depth) {
  10057. depth = depth === undefined ? 1 : toInteger(depth);
  10058. return baseFlatten(map(collection, iteratee), depth);
  10059. }
  10060. /**
  10061. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10062. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10063. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10064. *
  10065. * **Note:** As with other "Collections" methods, objects with a "length"
  10066. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10067. * or `_.forOwn` for object iteration.
  10068. *
  10069. * @static
  10070. * @memberOf _
  10071. * @since 0.1.0
  10072. * @alias each
  10073. * @category Collection
  10074. * @param {Array|Object} collection The collection to iterate over.
  10075. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10076. * @returns {Array|Object} Returns `collection`.
  10077. * @see _.forEachRight
  10078. * @example
  10079. *
  10080. * _.forEach([1, 2], function(value) {
  10081. * console.log(value);
  10082. * });
  10083. * // => Logs `1` then `2`.
  10084. *
  10085. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10086. * console.log(key);
  10087. * });
  10088. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10089. */
  10090. function forEach(collection, iteratee) {
  10091. var func = isArray(collection) ? arrayEach : baseEach;
  10092. return func(collection, getIteratee(iteratee, 3));
  10093. }
  10094. /**
  10095. * This method is like `_.forEach` except that it iterates over elements of
  10096. * `collection` from right to left.
  10097. *
  10098. * @static
  10099. * @memberOf _
  10100. * @since 2.0.0
  10101. * @alias eachRight
  10102. * @category Collection
  10103. * @param {Array|Object} collection The collection to iterate over.
  10104. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10105. * @returns {Array|Object} Returns `collection`.
  10106. * @see _.forEach
  10107. * @example
  10108. *
  10109. * _.forEachRight([1, 2], function(value) {
  10110. * console.log(value);
  10111. * });
  10112. * // => Logs `2` then `1`.
  10113. */
  10114. function forEachRight(collection, iteratee) {
  10115. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10116. return func(collection, getIteratee(iteratee, 3));
  10117. }
  10118. /**
  10119. * Creates an object composed of keys generated from the results of running
  10120. * each element of `collection` thru `iteratee`. The order of grouped values
  10121. * is determined by the order they occur in `collection`. The corresponding
  10122. * value of each key is an array of elements responsible for generating the
  10123. * key. The iteratee is invoked with one argument: (value).
  10124. *
  10125. * @static
  10126. * @memberOf _
  10127. * @since 0.1.0
  10128. * @category Collection
  10129. * @param {Array|Object} collection The collection to iterate over.
  10130. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10131. * @returns {Object} Returns the composed aggregate object.
  10132. * @example
  10133. *
  10134. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10135. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10136. *
  10137. * // The `_.property` iteratee shorthand.
  10138. * _.groupBy(['one', 'two', 'three'], 'length');
  10139. * // => { '3': ['one', 'two'], '5': ['three'] }
  10140. */
  10141. var groupBy = createAggregator(function(result, value, key) {
  10142. if (hasOwnProperty.call(result, key)) {
  10143. result[key].push(value);
  10144. } else {
  10145. baseAssignValue(result, key, [value]);
  10146. }
  10147. });
  10148. /**
  10149. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10150. * checked for a substring of `value`, otherwise
  10151. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10152. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10153. * the offset from the end of `collection`.
  10154. *
  10155. * @static
  10156. * @memberOf _
  10157. * @since 0.1.0
  10158. * @category Collection
  10159. * @param {Array|Object|string} collection The collection to inspect.
  10160. * @param {*} value The value to search for.
  10161. * @param {number} [fromIndex=0] The index to search from.
  10162. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10163. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10164. * @example
  10165. *
  10166. * _.includes([1, 2, 3], 1);
  10167. * // => true
  10168. *
  10169. * _.includes([1, 2, 3], 1, 2);
  10170. * // => false
  10171. *
  10172. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10173. * // => true
  10174. *
  10175. * _.includes('abcd', 'bc');
  10176. * // => true
  10177. */
  10178. function includes(collection, value, fromIndex, guard) {
  10179. collection = isArrayLike(collection) ? collection : values(collection);
  10180. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10181. var length = collection.length;
  10182. if (fromIndex < 0) {
  10183. fromIndex = nativeMax(length + fromIndex, 0);
  10184. }
  10185. return isString(collection)
  10186. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10187. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10188. }
  10189. /**
  10190. * Invokes the method at `path` of each element in `collection`, returning
  10191. * an array of the results of each invoked method. Any additional arguments
  10192. * are provided to each invoked method. If `path` is a function, it's invoked
  10193. * for, and `this` bound to, each element in `collection`.
  10194. *
  10195. * @static
  10196. * @memberOf _
  10197. * @since 4.0.0
  10198. * @category Collection
  10199. * @param {Array|Object} collection The collection to iterate over.
  10200. * @param {Array|Function|string} path The path of the method to invoke or
  10201. * the function invoked per iteration.
  10202. * @param {...*} [args] The arguments to invoke each method with.
  10203. * @returns {Array} Returns the array of results.
  10204. * @example
  10205. *
  10206. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10207. * // => [[1, 5, 7], [1, 2, 3]]
  10208. *
  10209. * _.invokeMap([123, 456], String.prototype.split, '');
  10210. * // => [['1', '2', '3'], ['4', '5', '6']]
  10211. */
  10212. var invokeMap = baseRest(function(collection, path, args) {
  10213. var index = -1,
  10214. isFunc = typeof path == 'function',
  10215. result = isArrayLike(collection) ? Array(collection.length) : [];
  10216. baseEach(collection, function(value) {
  10217. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10218. });
  10219. return result;
  10220. });
  10221. /**
  10222. * Creates an object composed of keys generated from the results of running
  10223. * each element of `collection` thru `iteratee`. The corresponding value of
  10224. * each key is the last element responsible for generating the key. The
  10225. * iteratee is invoked with one argument: (value).
  10226. *
  10227. * @static
  10228. * @memberOf _
  10229. * @since 4.0.0
  10230. * @category Collection
  10231. * @param {Array|Object} collection The collection to iterate over.
  10232. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10233. * @returns {Object} Returns the composed aggregate object.
  10234. * @example
  10235. *
  10236. * var array = [
  10237. * { 'dir': 'left', 'code': 97 },
  10238. * { 'dir': 'right', 'code': 100 }
  10239. * ];
  10240. *
  10241. * _.keyBy(array, function(o) {
  10242. * return String.fromCharCode(o.code);
  10243. * });
  10244. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10245. *
  10246. * _.keyBy(array, 'dir');
  10247. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10248. */
  10249. var keyBy = createAggregator(function(result, value, key) {
  10250. baseAssignValue(result, key, value);
  10251. });
  10252. /**
  10253. * Creates an array of values by running each element in `collection` thru
  10254. * `iteratee`. The iteratee is invoked with three arguments:
  10255. * (value, index|key, collection).
  10256. *
  10257. * Many lodash methods are guarded to work as iteratees for methods like
  10258. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10259. *
  10260. * The guarded methods are:
  10261. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10262. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10263. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10264. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10265. *
  10266. * @static
  10267. * @memberOf _
  10268. * @since 0.1.0
  10269. * @category Collection
  10270. * @param {Array|Object} collection The collection to iterate over.
  10271. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10272. * @returns {Array} Returns the new mapped array.
  10273. * @example
  10274. *
  10275. * function square(n) {
  10276. * return n * n;
  10277. * }
  10278. *
  10279. * _.map([4, 8], square);
  10280. * // => [16, 64]
  10281. *
  10282. * _.map({ 'a': 4, 'b': 8 }, square);
  10283. * // => [16, 64] (iteration order is not guaranteed)
  10284. *
  10285. * var users = [
  10286. * { 'user': 'barney' },
  10287. * { 'user': 'fred' }
  10288. * ];
  10289. *
  10290. * // The `_.property` iteratee shorthand.
  10291. * _.map(users, 'user');
  10292. * // => ['barney', 'fred']
  10293. */
  10294. function map(collection, iteratee) {
  10295. var func = isArray(collection) ? arrayMap : baseMap;
  10296. return func(collection, getIteratee(iteratee, 3));
  10297. }
  10298. /**
  10299. * This method is like `_.sortBy` except that it allows specifying the sort
  10300. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10301. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10302. * descending or "asc" for ascending sort order of corresponding values.
  10303. *
  10304. * @static
  10305. * @memberOf _
  10306. * @since 4.0.0
  10307. * @category Collection
  10308. * @param {Array|Object} collection The collection to iterate over.
  10309. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10310. * The iteratees to sort by.
  10311. * @param {string[]} [orders] The sort orders of `iteratees`.
  10312. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10313. * @returns {Array} Returns the new sorted array.
  10314. * @example
  10315. *
  10316. * var users = [
  10317. * { 'user': 'fred', 'age': 48 },
  10318. * { 'user': 'barney', 'age': 34 },
  10319. * { 'user': 'fred', 'age': 40 },
  10320. * { 'user': 'barney', 'age': 36 }
  10321. * ];
  10322. *
  10323. * // Sort by `user` in ascending order and by `age` in descending order.
  10324. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10325. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10326. */
  10327. function orderBy(collection, iteratees, orders, guard) {
  10328. if (collection == null) {
  10329. return [];
  10330. }
  10331. if (!isArray(iteratees)) {
  10332. iteratees = iteratees == null ? [] : [iteratees];
  10333. }
  10334. orders = guard ? undefined : orders;
  10335. if (!isArray(orders)) {
  10336. orders = orders == null ? [] : [orders];
  10337. }
  10338. return baseOrderBy(collection, iteratees, orders);
  10339. }
  10340. /**
  10341. * Creates an array of elements split into two groups, the first of which
  10342. * contains elements `predicate` returns truthy for, the second of which
  10343. * contains elements `predicate` returns falsey for. The predicate is
  10344. * invoked with one argument: (value).
  10345. *
  10346. * @static
  10347. * @memberOf _
  10348. * @since 3.0.0
  10349. * @category Collection
  10350. * @param {Array|Object} collection The collection to iterate over.
  10351. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10352. * @returns {Array} Returns the array of grouped elements.
  10353. * @example
  10354. *
  10355. * var users = [
  10356. * { 'user': 'barney', 'age': 36, 'active': false },
  10357. * { 'user': 'fred', 'age': 40, 'active': true },
  10358. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10359. * ];
  10360. *
  10361. * _.partition(users, function(o) { return o.active; });
  10362. * // => objects for [['fred'], ['barney', 'pebbles']]
  10363. *
  10364. * // The `_.matches` iteratee shorthand.
  10365. * _.partition(users, { 'age': 1, 'active': false });
  10366. * // => objects for [['pebbles'], ['barney', 'fred']]
  10367. *
  10368. * // The `_.matchesProperty` iteratee shorthand.
  10369. * _.partition(users, ['active', false]);
  10370. * // => objects for [['barney', 'pebbles'], ['fred']]
  10371. *
  10372. * // The `_.property` iteratee shorthand.
  10373. * _.partition(users, 'active');
  10374. * // => objects for [['fred'], ['barney', 'pebbles']]
  10375. */
  10376. var partition = createAggregator(function(result, value, key) {
  10377. result[key ? 0 : 1].push(value);
  10378. }, function() { return [[], []]; });
  10379. /**
  10380. * Reduces `collection` to a value which is the accumulated result of running
  10381. * each element in `collection` thru `iteratee`, where each successive
  10382. * invocation is supplied the return value of the previous. If `accumulator`
  10383. * is not given, the first element of `collection` is used as the initial
  10384. * value. The iteratee is invoked with four arguments:
  10385. * (accumulator, value, index|key, collection).
  10386. *
  10387. * Many lodash methods are guarded to work as iteratees for methods like
  10388. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10389. *
  10390. * The guarded methods are:
  10391. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10392. * and `sortBy`
  10393. *
  10394. * @static
  10395. * @memberOf _
  10396. * @since 0.1.0
  10397. * @category Collection
  10398. * @param {Array|Object} collection The collection to iterate over.
  10399. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10400. * @param {*} [accumulator] The initial value.
  10401. * @returns {*} Returns the accumulated value.
  10402. * @see _.reduceRight
  10403. * @example
  10404. *
  10405. * _.reduce([1, 2], function(sum, n) {
  10406. * return sum + n;
  10407. * }, 0);
  10408. * // => 3
  10409. *
  10410. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10411. * (result[value] || (result[value] = [])).push(key);
  10412. * return result;
  10413. * }, {});
  10414. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10415. */
  10416. function reduce(collection, iteratee, accumulator) {
  10417. var func = isArray(collection) ? arrayReduce : baseReduce,
  10418. initAccum = arguments.length < 3;
  10419. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10420. }
  10421. /**
  10422. * This method is like `_.reduce` except that it iterates over elements of
  10423. * `collection` from right to left.
  10424. *
  10425. * @static
  10426. * @memberOf _
  10427. * @since 0.1.0
  10428. * @category Collection
  10429. * @param {Array|Object} collection The collection to iterate over.
  10430. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10431. * @param {*} [accumulator] The initial value.
  10432. * @returns {*} Returns the accumulated value.
  10433. * @see _.reduce
  10434. * @example
  10435. *
  10436. * var array = [[0, 1], [2, 3], [4, 5]];
  10437. *
  10438. * _.reduceRight(array, function(flattened, other) {
  10439. * return flattened.concat(other);
  10440. * }, []);
  10441. * // => [4, 5, 2, 3, 0, 1]
  10442. */
  10443. function reduceRight(collection, iteratee, accumulator) {
  10444. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10445. initAccum = arguments.length < 3;
  10446. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10447. }
  10448. /**
  10449. * The opposite of `_.filter`; this method returns the elements of `collection`
  10450. * that `predicate` does **not** return truthy for.
  10451. *
  10452. * @static
  10453. * @memberOf _
  10454. * @since 0.1.0
  10455. * @category Collection
  10456. * @param {Array|Object} collection The collection to iterate over.
  10457. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10458. * @returns {Array} Returns the new filtered array.
  10459. * @see _.filter
  10460. * @example
  10461. *
  10462. * var users = [
  10463. * { 'user': 'barney', 'age': 36, 'active': false },
  10464. * { 'user': 'fred', 'age': 40, 'active': true }
  10465. * ];
  10466. *
  10467. * _.reject(users, function(o) { return !o.active; });
  10468. * // => objects for ['fred']
  10469. *
  10470. * // The `_.matches` iteratee shorthand.
  10471. * _.reject(users, { 'age': 40, 'active': true });
  10472. * // => objects for ['barney']
  10473. *
  10474. * // The `_.matchesProperty` iteratee shorthand.
  10475. * _.reject(users, ['active', false]);
  10476. * // => objects for ['fred']
  10477. *
  10478. * // The `_.property` iteratee shorthand.
  10479. * _.reject(users, 'active');
  10480. * // => objects for ['barney']
  10481. */
  10482. function reject(collection, predicate) {
  10483. var func = isArray(collection) ? arrayFilter : baseFilter;
  10484. return func(collection, negate(getIteratee(predicate, 3)));
  10485. }
  10486. /**
  10487. * Gets a random element from `collection`.
  10488. *
  10489. * @static
  10490. * @memberOf _
  10491. * @since 2.0.0
  10492. * @category Collection
  10493. * @param {Array|Object} collection The collection to sample.
  10494. * @returns {*} Returns the random element.
  10495. * @example
  10496. *
  10497. * _.sample([1, 2, 3, 4]);
  10498. * // => 2
  10499. */
  10500. function sample(collection) {
  10501. var func = isArray(collection) ? arraySample : baseSample;
  10502. return func(collection);
  10503. }
  10504. /**
  10505. * Gets `n` random elements at unique keys from `collection` up to the
  10506. * size of `collection`.
  10507. *
  10508. * @static
  10509. * @memberOf _
  10510. * @since 4.0.0
  10511. * @category Collection
  10512. * @param {Array|Object} collection The collection to sample.
  10513. * @param {number} [n=1] The number of elements to sample.
  10514. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10515. * @returns {Array} Returns the random elements.
  10516. * @example
  10517. *
  10518. * _.sampleSize([1, 2, 3], 2);
  10519. * // => [3, 1]
  10520. *
  10521. * _.sampleSize([1, 2, 3], 4);
  10522. * // => [2, 3, 1]
  10523. */
  10524. function sampleSize(collection, n, guard) {
  10525. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10526. n = 1;
  10527. } else {
  10528. n = toInteger(n);
  10529. }
  10530. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10531. return func(collection, n);
  10532. }
  10533. /**
  10534. * Creates an array of shuffled values, using a version of the
  10535. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10536. *
  10537. * @static
  10538. * @memberOf _
  10539. * @since 0.1.0
  10540. * @category Collection
  10541. * @param {Array|Object} collection The collection to shuffle.
  10542. * @returns {Array} Returns the new shuffled array.
  10543. * @example
  10544. *
  10545. * _.shuffle([1, 2, 3, 4]);
  10546. * // => [4, 1, 3, 2]
  10547. */
  10548. function shuffle(collection) {
  10549. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10550. return func(collection);
  10551. }
  10552. /**
  10553. * Gets the size of `collection` by returning its length for array-like
  10554. * values or the number of own enumerable string keyed properties for objects.
  10555. *
  10556. * @static
  10557. * @memberOf _
  10558. * @since 0.1.0
  10559. * @category Collection
  10560. * @param {Array|Object|string} collection The collection to inspect.
  10561. * @returns {number} Returns the collection size.
  10562. * @example
  10563. *
  10564. * _.size([1, 2, 3]);
  10565. * // => 3
  10566. *
  10567. * _.size({ 'a': 1, 'b': 2 });
  10568. * // => 2
  10569. *
  10570. * _.size('pebbles');
  10571. * // => 7
  10572. */
  10573. function size(collection) {
  10574. if (collection == null) {
  10575. return 0;
  10576. }
  10577. if (isArrayLike(collection)) {
  10578. return isString(collection) ? stringSize(collection) : collection.length;
  10579. }
  10580. var tag = getTag(collection);
  10581. if (tag == mapTag || tag == setTag) {
  10582. return collection.size;
  10583. }
  10584. return baseKeys(collection).length;
  10585. }
  10586. /**
  10587. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10588. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10589. * invoked with three arguments: (value, index|key, collection).
  10590. *
  10591. * @static
  10592. * @memberOf _
  10593. * @since 0.1.0
  10594. * @category Collection
  10595. * @param {Array|Object} collection The collection to iterate over.
  10596. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10597. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10598. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10599. * else `false`.
  10600. * @example
  10601. *
  10602. * _.some([null, 0, 'yes', false], Boolean);
  10603. * // => true
  10604. *
  10605. * var users = [
  10606. * { 'user': 'barney', 'active': true },
  10607. * { 'user': 'fred', 'active': false }
  10608. * ];
  10609. *
  10610. * // The `_.matches` iteratee shorthand.
  10611. * _.some(users, { 'user': 'barney', 'active': false });
  10612. * // => false
  10613. *
  10614. * // The `_.matchesProperty` iteratee shorthand.
  10615. * _.some(users, ['active', false]);
  10616. * // => true
  10617. *
  10618. * // The `_.property` iteratee shorthand.
  10619. * _.some(users, 'active');
  10620. * // => true
  10621. */
  10622. function some(collection, predicate, guard) {
  10623. var func = isArray(collection) ? arraySome : baseSome;
  10624. if (guard && isIterateeCall(collection, predicate, guard)) {
  10625. predicate = undefined;
  10626. }
  10627. return func(collection, getIteratee(predicate, 3));
  10628. }
  10629. /**
  10630. * Creates an array of elements, sorted in ascending order by the results of
  10631. * running each element in a collection thru each iteratee. This method
  10632. * performs a stable sort, that is, it preserves the original sort order of
  10633. * equal elements. The iteratees are invoked with one argument: (value).
  10634. *
  10635. * @static
  10636. * @memberOf _
  10637. * @since 0.1.0
  10638. * @category Collection
  10639. * @param {Array|Object} collection The collection to iterate over.
  10640. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10641. * The iteratees to sort by.
  10642. * @returns {Array} Returns the new sorted array.
  10643. * @example
  10644. *
  10645. * var users = [
  10646. * { 'user': 'fred', 'age': 48 },
  10647. * { 'user': 'barney', 'age': 36 },
  10648. * { 'user': 'fred', 'age': 30 },
  10649. * { 'user': 'barney', 'age': 34 }
  10650. * ];
  10651. *
  10652. * _.sortBy(users, [function(o) { return o.user; }]);
  10653. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10654. *
  10655. * _.sortBy(users, ['user', 'age']);
  10656. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10657. */
  10658. var sortBy = baseRest(function(collection, iteratees) {
  10659. if (collection == null) {
  10660. return [];
  10661. }
  10662. var length = iteratees.length;
  10663. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10664. iteratees = [];
  10665. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10666. iteratees = [iteratees[0]];
  10667. }
  10668. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10669. });
  10670. /*------------------------------------------------------------------------*/
  10671. /**
  10672. * Gets the timestamp of the number of milliseconds that have elapsed since
  10673. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10674. *
  10675. * @static
  10676. * @memberOf _
  10677. * @since 2.4.0
  10678. * @category Date
  10679. * @returns {number} Returns the timestamp.
  10680. * @example
  10681. *
  10682. * _.defer(function(stamp) {
  10683. * console.log(_.now() - stamp);
  10684. * }, _.now());
  10685. * // => Logs the number of milliseconds it took for the deferred invocation.
  10686. */
  10687. var now = ctxNow || function() {
  10688. return root.Date.now();
  10689. };
  10690. /*------------------------------------------------------------------------*/
  10691. /**
  10692. * The opposite of `_.before`; this method creates a function that invokes
  10693. * `func` once it's called `n` or more times.
  10694. *
  10695. * @static
  10696. * @memberOf _
  10697. * @since 0.1.0
  10698. * @category Function
  10699. * @param {number} n The number of calls before `func` is invoked.
  10700. * @param {Function} func The function to restrict.
  10701. * @returns {Function} Returns the new restricted function.
  10702. * @example
  10703. *
  10704. * var saves = ['profile', 'settings'];
  10705. *
  10706. * var done = _.after(saves.length, function() {
  10707. * console.log('done saving!');
  10708. * });
  10709. *
  10710. * _.forEach(saves, function(type) {
  10711. * asyncSave({ 'type': type, 'complete': done });
  10712. * });
  10713. * // => Logs 'done saving!' after the two async saves have completed.
  10714. */
  10715. function after(n, func) {
  10716. if (typeof func != 'function') {
  10717. throw new TypeError(FUNC_ERROR_TEXT);
  10718. }
  10719. n = toInteger(n);
  10720. return function() {
  10721. if (--n < 1) {
  10722. return func.apply(this, arguments);
  10723. }
  10724. };
  10725. }
  10726. /**
  10727. * Creates a function that invokes `func`, with up to `n` arguments,
  10728. * ignoring any additional arguments.
  10729. *
  10730. * @static
  10731. * @memberOf _
  10732. * @since 3.0.0
  10733. * @category Function
  10734. * @param {Function} func The function to cap arguments for.
  10735. * @param {number} [n=func.length] The arity cap.
  10736. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10737. * @returns {Function} Returns the new capped function.
  10738. * @example
  10739. *
  10740. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10741. * // => [6, 8, 10]
  10742. */
  10743. function ary(func, n, guard) {
  10744. n = guard ? undefined : n;
  10745. n = (func && n == null) ? func.length : n;
  10746. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10747. }
  10748. /**
  10749. * Creates a function that invokes `func`, with the `this` binding and arguments
  10750. * of the created function, while it's called less than `n` times. Subsequent
  10751. * calls to the created function return the result of the last `func` invocation.
  10752. *
  10753. * @static
  10754. * @memberOf _
  10755. * @since 3.0.0
  10756. * @category Function
  10757. * @param {number} n The number of calls at which `func` is no longer invoked.
  10758. * @param {Function} func The function to restrict.
  10759. * @returns {Function} Returns the new restricted function.
  10760. * @example
  10761. *
  10762. * jQuery(element).on('click', _.before(5, addContactToList));
  10763. * // => Allows adding up to 4 contacts to the list.
  10764. */
  10765. function before(n, func) {
  10766. var result;
  10767. if (typeof func != 'function') {
  10768. throw new TypeError(FUNC_ERROR_TEXT);
  10769. }
  10770. n = toInteger(n);
  10771. return function() {
  10772. if (--n > 0) {
  10773. result = func.apply(this, arguments);
  10774. }
  10775. if (n <= 1) {
  10776. func = undefined;
  10777. }
  10778. return result;
  10779. };
  10780. }
  10781. /**
  10782. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10783. * and `partials` prepended to the arguments it receives.
  10784. *
  10785. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10786. * may be used as a placeholder for partially applied arguments.
  10787. *
  10788. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10789. * property of bound functions.
  10790. *
  10791. * @static
  10792. * @memberOf _
  10793. * @since 0.1.0
  10794. * @category Function
  10795. * @param {Function} func The function to bind.
  10796. * @param {*} thisArg The `this` binding of `func`.
  10797. * @param {...*} [partials] The arguments to be partially applied.
  10798. * @returns {Function} Returns the new bound function.
  10799. * @example
  10800. *
  10801. * function greet(greeting, punctuation) {
  10802. * return greeting + ' ' + this.user + punctuation;
  10803. * }
  10804. *
  10805. * var object = { 'user': 'fred' };
  10806. *
  10807. * var bound = _.bind(greet, object, 'hi');
  10808. * bound('!');
  10809. * // => 'hi fred!'
  10810. *
  10811. * // Bound with placeholders.
  10812. * var bound = _.bind(greet, object, _, '!');
  10813. * bound('hi');
  10814. * // => 'hi fred!'
  10815. */
  10816. var bind = baseRest(function(func, thisArg, partials) {
  10817. var bitmask = WRAP_BIND_FLAG;
  10818. if (partials.length) {
  10819. var holders = replaceHolders(partials, getHolder(bind));
  10820. bitmask |= WRAP_PARTIAL_FLAG;
  10821. }
  10822. return createWrap(func, bitmask, thisArg, partials, holders);
  10823. });
  10824. /**
  10825. * Creates a function that invokes the method at `object[key]` with `partials`
  10826. * prepended to the arguments it receives.
  10827. *
  10828. * This method differs from `_.bind` by allowing bound functions to reference
  10829. * methods that may be redefined or don't yet exist. See
  10830. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10831. * for more details.
  10832. *
  10833. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10834. * builds, may be used as a placeholder for partially applied arguments.
  10835. *
  10836. * @static
  10837. * @memberOf _
  10838. * @since 0.10.0
  10839. * @category Function
  10840. * @param {Object} object The object to invoke the method on.
  10841. * @param {string} key The key of the method.
  10842. * @param {...*} [partials] The arguments to be partially applied.
  10843. * @returns {Function} Returns the new bound function.
  10844. * @example
  10845. *
  10846. * var object = {
  10847. * 'user': 'fred',
  10848. * 'greet': function(greeting, punctuation) {
  10849. * return greeting + ' ' + this.user + punctuation;
  10850. * }
  10851. * };
  10852. *
  10853. * var bound = _.bindKey(object, 'greet', 'hi');
  10854. * bound('!');
  10855. * // => 'hi fred!'
  10856. *
  10857. * object.greet = function(greeting, punctuation) {
  10858. * return greeting + 'ya ' + this.user + punctuation;
  10859. * };
  10860. *
  10861. * bound('!');
  10862. * // => 'hiya fred!'
  10863. *
  10864. * // Bound with placeholders.
  10865. * var bound = _.bindKey(object, 'greet', _, '!');
  10866. * bound('hi');
  10867. * // => 'hiya fred!'
  10868. */
  10869. var bindKey = baseRest(function(object, key, partials) {
  10870. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10871. if (partials.length) {
  10872. var holders = replaceHolders(partials, getHolder(bindKey));
  10873. bitmask |= WRAP_PARTIAL_FLAG;
  10874. }
  10875. return createWrap(key, bitmask, object, partials, holders);
  10876. });
  10877. /**
  10878. * Creates a function that accepts arguments of `func` and either invokes
  10879. * `func` returning its result, if at least `arity` number of arguments have
  10880. * been provided, or returns a function that accepts the remaining `func`
  10881. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10882. * is not sufficient.
  10883. *
  10884. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10885. * may be used as a placeholder for provided arguments.
  10886. *
  10887. * **Note:** This method doesn't set the "length" property of curried functions.
  10888. *
  10889. * @static
  10890. * @memberOf _
  10891. * @since 2.0.0
  10892. * @category Function
  10893. * @param {Function} func The function to curry.
  10894. * @param {number} [arity=func.length] The arity of `func`.
  10895. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10896. * @returns {Function} Returns the new curried function.
  10897. * @example
  10898. *
  10899. * var abc = function(a, b, c) {
  10900. * return [a, b, c];
  10901. * };
  10902. *
  10903. * var curried = _.curry(abc);
  10904. *
  10905. * curried(1)(2)(3);
  10906. * // => [1, 2, 3]
  10907. *
  10908. * curried(1, 2)(3);
  10909. * // => [1, 2, 3]
  10910. *
  10911. * curried(1, 2, 3);
  10912. * // => [1, 2, 3]
  10913. *
  10914. * // Curried with placeholders.
  10915. * curried(1)(_, 3)(2);
  10916. * // => [1, 2, 3]
  10917. */
  10918. function curry(func, arity, guard) {
  10919. arity = guard ? undefined : arity;
  10920. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10921. result.placeholder = curry.placeholder;
  10922. return result;
  10923. }
  10924. /**
  10925. * This method is like `_.curry` except that arguments are applied to `func`
  10926. * in the manner of `_.partialRight` instead of `_.partial`.
  10927. *
  10928. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10929. * builds, may be used as a placeholder for provided arguments.
  10930. *
  10931. * **Note:** This method doesn't set the "length" property of curried functions.
  10932. *
  10933. * @static
  10934. * @memberOf _
  10935. * @since 3.0.0
  10936. * @category Function
  10937. * @param {Function} func The function to curry.
  10938. * @param {number} [arity=func.length] The arity of `func`.
  10939. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10940. * @returns {Function} Returns the new curried function.
  10941. * @example
  10942. *
  10943. * var abc = function(a, b, c) {
  10944. * return [a, b, c];
  10945. * };
  10946. *
  10947. * var curried = _.curryRight(abc);
  10948. *
  10949. * curried(3)(2)(1);
  10950. * // => [1, 2, 3]
  10951. *
  10952. * curried(2, 3)(1);
  10953. * // => [1, 2, 3]
  10954. *
  10955. * curried(1, 2, 3);
  10956. * // => [1, 2, 3]
  10957. *
  10958. * // Curried with placeholders.
  10959. * curried(3)(1, _)(2);
  10960. * // => [1, 2, 3]
  10961. */
  10962. function curryRight(func, arity, guard) {
  10963. arity = guard ? undefined : arity;
  10964. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10965. result.placeholder = curryRight.placeholder;
  10966. return result;
  10967. }
  10968. /**
  10969. * Creates a debounced function that delays invoking `func` until after `wait`
  10970. * milliseconds have elapsed since the last time the debounced function was
  10971. * invoked. The debounced function comes with a `cancel` method to cancel
  10972. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10973. * Provide `options` to indicate whether `func` should be invoked on the
  10974. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10975. * with the last arguments provided to the debounced function. Subsequent
  10976. * calls to the debounced function return the result of the last `func`
  10977. * invocation.
  10978. *
  10979. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10980. * invoked on the trailing edge of the timeout only if the debounced function
  10981. * is invoked more than once during the `wait` timeout.
  10982. *
  10983. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10984. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10985. *
  10986. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10987. * for details over the differences between `_.debounce` and `_.throttle`.
  10988. *
  10989. * @static
  10990. * @memberOf _
  10991. * @since 0.1.0
  10992. * @category Function
  10993. * @param {Function} func The function to debounce.
  10994. * @param {number} [wait=0] The number of milliseconds to delay.
  10995. * @param {Object} [options={}] The options object.
  10996. * @param {boolean} [options.leading=false]
  10997. * Specify invoking on the leading edge of the timeout.
  10998. * @param {number} [options.maxWait]
  10999. * The maximum time `func` is allowed to be delayed before it's invoked.
  11000. * @param {boolean} [options.trailing=true]
  11001. * Specify invoking on the trailing edge of the timeout.
  11002. * @returns {Function} Returns the new debounced function.
  11003. * @example
  11004. *
  11005. * // Avoid costly calculations while the window size is in flux.
  11006. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  11007. *
  11008. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  11009. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  11010. * 'leading': true,
  11011. * 'trailing': false
  11012. * }));
  11013. *
  11014. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  11015. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  11016. * var source = new EventSource('/stream');
  11017. * jQuery(source).on('message', debounced);
  11018. *
  11019. * // Cancel the trailing debounced invocation.
  11020. * jQuery(window).on('popstate', debounced.cancel);
  11021. */
  11022. function debounce(func, wait, options) {
  11023. var lastArgs,
  11024. lastThis,
  11025. maxWait,
  11026. result,
  11027. timerId,
  11028. lastCallTime,
  11029. lastInvokeTime = 0,
  11030. leading = false,
  11031. maxing = false,
  11032. trailing = true;
  11033. if (typeof func != 'function') {
  11034. throw new TypeError(FUNC_ERROR_TEXT);
  11035. }
  11036. wait = toNumber(wait) || 0;
  11037. if (isObject(options)) {
  11038. leading = !!options.leading;
  11039. maxing = 'maxWait' in options;
  11040. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  11041. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11042. }
  11043. function invokeFunc(time) {
  11044. var args = lastArgs,
  11045. thisArg = lastThis;
  11046. lastArgs = lastThis = undefined;
  11047. lastInvokeTime = time;
  11048. result = func.apply(thisArg, args);
  11049. return result;
  11050. }
  11051. function leadingEdge(time) {
  11052. // Reset any `maxWait` timer.
  11053. lastInvokeTime = time;
  11054. // Start the timer for the trailing edge.
  11055. timerId = setTimeout(timerExpired, wait);
  11056. // Invoke the leading edge.
  11057. return leading ? invokeFunc(time) : result;
  11058. }
  11059. function remainingWait(time) {
  11060. var timeSinceLastCall = time - lastCallTime,
  11061. timeSinceLastInvoke = time - lastInvokeTime,
  11062. timeWaiting = wait - timeSinceLastCall;
  11063. return maxing
  11064. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11065. : timeWaiting;
  11066. }
  11067. function shouldInvoke(time) {
  11068. var timeSinceLastCall = time - lastCallTime,
  11069. timeSinceLastInvoke = time - lastInvokeTime;
  11070. // Either this is the first call, activity has stopped and we're at the
  11071. // trailing edge, the system time has gone backwards and we're treating
  11072. // it as the trailing edge, or we've hit the `maxWait` limit.
  11073. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11074. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11075. }
  11076. function timerExpired() {
  11077. var time = now();
  11078. if (shouldInvoke(time)) {
  11079. return trailingEdge(time);
  11080. }
  11081. // Restart the timer.
  11082. timerId = setTimeout(timerExpired, remainingWait(time));
  11083. }
  11084. function trailingEdge(time) {
  11085. timerId = undefined;
  11086. // Only invoke if we have `lastArgs` which means `func` has been
  11087. // debounced at least once.
  11088. if (trailing && lastArgs) {
  11089. return invokeFunc(time);
  11090. }
  11091. lastArgs = lastThis = undefined;
  11092. return result;
  11093. }
  11094. function cancel() {
  11095. if (timerId !== undefined) {
  11096. clearTimeout(timerId);
  11097. }
  11098. lastInvokeTime = 0;
  11099. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11100. }
  11101. function flush() {
  11102. return timerId === undefined ? result : trailingEdge(now());
  11103. }
  11104. function debounced() {
  11105. var time = now(),
  11106. isInvoking = shouldInvoke(time);
  11107. lastArgs = arguments;
  11108. lastThis = this;
  11109. lastCallTime = time;
  11110. if (isInvoking) {
  11111. if (timerId === undefined) {
  11112. return leadingEdge(lastCallTime);
  11113. }
  11114. if (maxing) {
  11115. // Handle invocations in a tight loop.
  11116. clearTimeout(timerId);
  11117. timerId = setTimeout(timerExpired, wait);
  11118. return invokeFunc(lastCallTime);
  11119. }
  11120. }
  11121. if (timerId === undefined) {
  11122. timerId = setTimeout(timerExpired, wait);
  11123. }
  11124. return result;
  11125. }
  11126. debounced.cancel = cancel;
  11127. debounced.flush = flush;
  11128. return debounced;
  11129. }
  11130. /**
  11131. * Defers invoking the `func` until the current call stack has cleared. Any
  11132. * additional arguments are provided to `func` when it's invoked.
  11133. *
  11134. * @static
  11135. * @memberOf _
  11136. * @since 0.1.0
  11137. * @category Function
  11138. * @param {Function} func The function to defer.
  11139. * @param {...*} [args] The arguments to invoke `func` with.
  11140. * @returns {number} Returns the timer id.
  11141. * @example
  11142. *
  11143. * _.defer(function(text) {
  11144. * console.log(text);
  11145. * }, 'deferred');
  11146. * // => Logs 'deferred' after one millisecond.
  11147. */
  11148. var defer = baseRest(function(func, args) {
  11149. return baseDelay(func, 1, args);
  11150. });
  11151. /**
  11152. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11153. * provided to `func` when it's invoked.
  11154. *
  11155. * @static
  11156. * @memberOf _
  11157. * @since 0.1.0
  11158. * @category Function
  11159. * @param {Function} func The function to delay.
  11160. * @param {number} wait The number of milliseconds to delay invocation.
  11161. * @param {...*} [args] The arguments to invoke `func` with.
  11162. * @returns {number} Returns the timer id.
  11163. * @example
  11164. *
  11165. * _.delay(function(text) {
  11166. * console.log(text);
  11167. * }, 1000, 'later');
  11168. * // => Logs 'later' after one second.
  11169. */
  11170. var delay = baseRest(function(func, wait, args) {
  11171. return baseDelay(func, toNumber(wait) || 0, args);
  11172. });
  11173. /**
  11174. * Creates a function that invokes `func` with arguments reversed.
  11175. *
  11176. * @static
  11177. * @memberOf _
  11178. * @since 4.0.0
  11179. * @category Function
  11180. * @param {Function} func The function to flip arguments for.
  11181. * @returns {Function} Returns the new flipped function.
  11182. * @example
  11183. *
  11184. * var flipped = _.flip(function() {
  11185. * return _.toArray(arguments);
  11186. * });
  11187. *
  11188. * flipped('a', 'b', 'c', 'd');
  11189. * // => ['d', 'c', 'b', 'a']
  11190. */
  11191. function flip(func) {
  11192. return createWrap(func, WRAP_FLIP_FLAG);
  11193. }
  11194. /**
  11195. * Creates a function that memoizes the result of `func`. If `resolver` is
  11196. * provided, it determines the cache key for storing the result based on the
  11197. * arguments provided to the memoized function. By default, the first argument
  11198. * provided to the memoized function is used as the map cache key. The `func`
  11199. * is invoked with the `this` binding of the memoized function.
  11200. *
  11201. * **Note:** The cache is exposed as the `cache` property on the memoized
  11202. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11203. * constructor with one whose instances implement the
  11204. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11205. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11206. *
  11207. * @static
  11208. * @memberOf _
  11209. * @since 0.1.0
  11210. * @category Function
  11211. * @param {Function} func The function to have its output memoized.
  11212. * @param {Function} [resolver] The function to resolve the cache key.
  11213. * @returns {Function} Returns the new memoized function.
  11214. * @example
  11215. *
  11216. * var object = { 'a': 1, 'b': 2 };
  11217. * var other = { 'c': 3, 'd': 4 };
  11218. *
  11219. * var values = _.memoize(_.values);
  11220. * values(object);
  11221. * // => [1, 2]
  11222. *
  11223. * values(other);
  11224. * // => [3, 4]
  11225. *
  11226. * object.a = 2;
  11227. * values(object);
  11228. * // => [1, 2]
  11229. *
  11230. * // Modify the result cache.
  11231. * values.cache.set(object, ['a', 'b']);
  11232. * values(object);
  11233. * // => ['a', 'b']
  11234. *
  11235. * // Replace `_.memoize.Cache`.
  11236. * _.memoize.Cache = WeakMap;
  11237. */
  11238. function memoize(func, resolver) {
  11239. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11240. throw new TypeError(FUNC_ERROR_TEXT);
  11241. }
  11242. var memoized = function() {
  11243. var args = arguments,
  11244. key = resolver ? resolver.apply(this, args) : args[0],
  11245. cache = memoized.cache;
  11246. if (cache.has(key)) {
  11247. return cache.get(key);
  11248. }
  11249. var result = func.apply(this, args);
  11250. memoized.cache = cache.set(key, result) || cache;
  11251. return result;
  11252. };
  11253. memoized.cache = new (memoize.Cache || MapCache);
  11254. return memoized;
  11255. }
  11256. // Expose `MapCache`.
  11257. memoize.Cache = MapCache;
  11258. /**
  11259. * Creates a function that negates the result of the predicate `func`. The
  11260. * `func` predicate is invoked with the `this` binding and arguments of the
  11261. * created function.
  11262. *
  11263. * @static
  11264. * @memberOf _
  11265. * @since 3.0.0
  11266. * @category Function
  11267. * @param {Function} predicate The predicate to negate.
  11268. * @returns {Function} Returns the new negated function.
  11269. * @example
  11270. *
  11271. * function isEven(n) {
  11272. * return n % 2 == 0;
  11273. * }
  11274. *
  11275. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11276. * // => [1, 3, 5]
  11277. */
  11278. function negate(predicate) {
  11279. if (typeof predicate != 'function') {
  11280. throw new TypeError(FUNC_ERROR_TEXT);
  11281. }
  11282. return function() {
  11283. var args = arguments;
  11284. switch (args.length) {
  11285. case 0: return !predicate.call(this);
  11286. case 1: return !predicate.call(this, args[0]);
  11287. case 2: return !predicate.call(this, args[0], args[1]);
  11288. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11289. }
  11290. return !predicate.apply(this, args);
  11291. };
  11292. }
  11293. /**
  11294. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11295. * to the function return the value of the first invocation. The `func` is
  11296. * invoked with the `this` binding and arguments of the created function.
  11297. *
  11298. * @static
  11299. * @memberOf _
  11300. * @since 0.1.0
  11301. * @category Function
  11302. * @param {Function} func The function to restrict.
  11303. * @returns {Function} Returns the new restricted function.
  11304. * @example
  11305. *
  11306. * var initialize = _.once(createApplication);
  11307. * initialize();
  11308. * initialize();
  11309. * // => `createApplication` is invoked once
  11310. */
  11311. function once(func) {
  11312. return before(2, func);
  11313. }
  11314. /**
  11315. * Creates a function that invokes `func` with its arguments transformed.
  11316. *
  11317. * @static
  11318. * @since 4.0.0
  11319. * @memberOf _
  11320. * @category Function
  11321. * @param {Function} func The function to wrap.
  11322. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11323. * The argument transforms.
  11324. * @returns {Function} Returns the new function.
  11325. * @example
  11326. *
  11327. * function doubled(n) {
  11328. * return n * 2;
  11329. * }
  11330. *
  11331. * function square(n) {
  11332. * return n * n;
  11333. * }
  11334. *
  11335. * var func = _.overArgs(function(x, y) {
  11336. * return [x, y];
  11337. * }, [square, doubled]);
  11338. *
  11339. * func(9, 3);
  11340. * // => [81, 6]
  11341. *
  11342. * func(10, 5);
  11343. * // => [100, 10]
  11344. */
  11345. var overArgs = castRest(function(func, transforms) {
  11346. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11347. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11348. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11349. var funcsLength = transforms.length;
  11350. return baseRest(function(args) {
  11351. var index = -1,
  11352. length = nativeMin(args.length, funcsLength);
  11353. while (++index < length) {
  11354. args[index] = transforms[index].call(this, args[index]);
  11355. }
  11356. return apply(func, this, args);
  11357. });
  11358. });
  11359. /**
  11360. * Creates a function that invokes `func` with `partials` prepended to the
  11361. * arguments it receives. This method is like `_.bind` except it does **not**
  11362. * alter the `this` binding.
  11363. *
  11364. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11365. * builds, may be used as a placeholder for partially applied arguments.
  11366. *
  11367. * **Note:** This method doesn't set the "length" property of partially
  11368. * applied functions.
  11369. *
  11370. * @static
  11371. * @memberOf _
  11372. * @since 0.2.0
  11373. * @category Function
  11374. * @param {Function} func The function to partially apply arguments to.
  11375. * @param {...*} [partials] The arguments to be partially applied.
  11376. * @returns {Function} Returns the new partially applied function.
  11377. * @example
  11378. *
  11379. * function greet(greeting, name) {
  11380. * return greeting + ' ' + name;
  11381. * }
  11382. *
  11383. * var sayHelloTo = _.partial(greet, 'hello');
  11384. * sayHelloTo('fred');
  11385. * // => 'hello fred'
  11386. *
  11387. * // Partially applied with placeholders.
  11388. * var greetFred = _.partial(greet, _, 'fred');
  11389. * greetFred('hi');
  11390. * // => 'hi fred'
  11391. */
  11392. var partial = baseRest(function(func, partials) {
  11393. var holders = replaceHolders(partials, getHolder(partial));
  11394. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11395. });
  11396. /**
  11397. * This method is like `_.partial` except that partially applied arguments
  11398. * are appended to the arguments it receives.
  11399. *
  11400. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11401. * builds, may be used as a placeholder for partially applied arguments.
  11402. *
  11403. * **Note:** This method doesn't set the "length" property of partially
  11404. * applied functions.
  11405. *
  11406. * @static
  11407. * @memberOf _
  11408. * @since 1.0.0
  11409. * @category Function
  11410. * @param {Function} func The function to partially apply arguments to.
  11411. * @param {...*} [partials] The arguments to be partially applied.
  11412. * @returns {Function} Returns the new partially applied function.
  11413. * @example
  11414. *
  11415. * function greet(greeting, name) {
  11416. * return greeting + ' ' + name;
  11417. * }
  11418. *
  11419. * var greetFred = _.partialRight(greet, 'fred');
  11420. * greetFred('hi');
  11421. * // => 'hi fred'
  11422. *
  11423. * // Partially applied with placeholders.
  11424. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11425. * sayHelloTo('fred');
  11426. * // => 'hello fred'
  11427. */
  11428. var partialRight = baseRest(function(func, partials) {
  11429. var holders = replaceHolders(partials, getHolder(partialRight));
  11430. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11431. });
  11432. /**
  11433. * Creates a function that invokes `func` with arguments arranged according
  11434. * to the specified `indexes` where the argument value at the first index is
  11435. * provided as the first argument, the argument value at the second index is
  11436. * provided as the second argument, and so on.
  11437. *
  11438. * @static
  11439. * @memberOf _
  11440. * @since 3.0.0
  11441. * @category Function
  11442. * @param {Function} func The function to rearrange arguments for.
  11443. * @param {...(number|number[])} indexes The arranged argument indexes.
  11444. * @returns {Function} Returns the new function.
  11445. * @example
  11446. *
  11447. * var rearged = _.rearg(function(a, b, c) {
  11448. * return [a, b, c];
  11449. * }, [2, 0, 1]);
  11450. *
  11451. * rearged('b', 'c', 'a')
  11452. * // => ['a', 'b', 'c']
  11453. */
  11454. var rearg = flatRest(function(func, indexes) {
  11455. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11456. });
  11457. /**
  11458. * Creates a function that invokes `func` with the `this` binding of the
  11459. * created function and arguments from `start` and beyond provided as
  11460. * an array.
  11461. *
  11462. * **Note:** This method is based on the
  11463. * [rest parameter](https://mdn.io/rest_parameters).
  11464. *
  11465. * @static
  11466. * @memberOf _
  11467. * @since 4.0.0
  11468. * @category Function
  11469. * @param {Function} func The function to apply a rest parameter to.
  11470. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11471. * @returns {Function} Returns the new function.
  11472. * @example
  11473. *
  11474. * var say = _.rest(function(what, names) {
  11475. * return what + ' ' + _.initial(names).join(', ') +
  11476. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11477. * });
  11478. *
  11479. * say('hello', 'fred', 'barney', 'pebbles');
  11480. * // => 'hello fred, barney, & pebbles'
  11481. */
  11482. function rest(func, start) {
  11483. if (typeof func != 'function') {
  11484. throw new TypeError(FUNC_ERROR_TEXT);
  11485. }
  11486. start = start === undefined ? start : toInteger(start);
  11487. return baseRest(func, start);
  11488. }
  11489. /**
  11490. * Creates a function that invokes `func` with the `this` binding of the
  11491. * create function and an array of arguments much like
  11492. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11493. *
  11494. * **Note:** This method is based on the
  11495. * [spread operator](https://mdn.io/spread_operator).
  11496. *
  11497. * @static
  11498. * @memberOf _
  11499. * @since 3.2.0
  11500. * @category Function
  11501. * @param {Function} func The function to spread arguments over.
  11502. * @param {number} [start=0] The start position of the spread.
  11503. * @returns {Function} Returns the new function.
  11504. * @example
  11505. *
  11506. * var say = _.spread(function(who, what) {
  11507. * return who + ' says ' + what;
  11508. * });
  11509. *
  11510. * say(['fred', 'hello']);
  11511. * // => 'fred says hello'
  11512. *
  11513. * var numbers = Promise.all([
  11514. * Promise.resolve(40),
  11515. * Promise.resolve(36)
  11516. * ]);
  11517. *
  11518. * numbers.then(_.spread(function(x, y) {
  11519. * return x + y;
  11520. * }));
  11521. * // => a Promise of 76
  11522. */
  11523. function spread(func, start) {
  11524. if (typeof func != 'function') {
  11525. throw new TypeError(FUNC_ERROR_TEXT);
  11526. }
  11527. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11528. return baseRest(function(args) {
  11529. var array = args[start],
  11530. otherArgs = castSlice(args, 0, start);
  11531. if (array) {
  11532. arrayPush(otherArgs, array);
  11533. }
  11534. return apply(func, this, otherArgs);
  11535. });
  11536. }
  11537. /**
  11538. * Creates a throttled function that only invokes `func` at most once per
  11539. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11540. * method to cancel delayed `func` invocations and a `flush` method to
  11541. * immediately invoke them. Provide `options` to indicate whether `func`
  11542. * should be invoked on the leading and/or trailing edge of the `wait`
  11543. * timeout. The `func` is invoked with the last arguments provided to the
  11544. * throttled function. Subsequent calls to the throttled function return the
  11545. * result of the last `func` invocation.
  11546. *
  11547. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11548. * invoked on the trailing edge of the timeout only if the throttled function
  11549. * is invoked more than once during the `wait` timeout.
  11550. *
  11551. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11552. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11553. *
  11554. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11555. * for details over the differences between `_.throttle` and `_.debounce`.
  11556. *
  11557. * @static
  11558. * @memberOf _
  11559. * @since 0.1.0
  11560. * @category Function
  11561. * @param {Function} func The function to throttle.
  11562. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11563. * @param {Object} [options={}] The options object.
  11564. * @param {boolean} [options.leading=true]
  11565. * Specify invoking on the leading edge of the timeout.
  11566. * @param {boolean} [options.trailing=true]
  11567. * Specify invoking on the trailing edge of the timeout.
  11568. * @returns {Function} Returns the new throttled function.
  11569. * @example
  11570. *
  11571. * // Avoid excessively updating the position while scrolling.
  11572. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11573. *
  11574. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11575. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11576. * jQuery(element).on('click', throttled);
  11577. *
  11578. * // Cancel the trailing throttled invocation.
  11579. * jQuery(window).on('popstate', throttled.cancel);
  11580. */
  11581. function throttle(func, wait, options) {
  11582. var leading = true,
  11583. trailing = true;
  11584. if (typeof func != 'function') {
  11585. throw new TypeError(FUNC_ERROR_TEXT);
  11586. }
  11587. if (isObject(options)) {
  11588. leading = 'leading' in options ? !!options.leading : leading;
  11589. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11590. }
  11591. return debounce(func, wait, {
  11592. 'leading': leading,
  11593. 'maxWait': wait,
  11594. 'trailing': trailing
  11595. });
  11596. }
  11597. /**
  11598. * Creates a function that accepts up to one argument, ignoring any
  11599. * additional arguments.
  11600. *
  11601. * @static
  11602. * @memberOf _
  11603. * @since 4.0.0
  11604. * @category Function
  11605. * @param {Function} func The function to cap arguments for.
  11606. * @returns {Function} Returns the new capped function.
  11607. * @example
  11608. *
  11609. * _.map(['6', '8', '10'], _.unary(parseInt));
  11610. * // => [6, 8, 10]
  11611. */
  11612. function unary(func) {
  11613. return ary(func, 1);
  11614. }
  11615. /**
  11616. * Creates a function that provides `value` to `wrapper` as its first
  11617. * argument. Any additional arguments provided to the function are appended
  11618. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11619. * binding of the created function.
  11620. *
  11621. * @static
  11622. * @memberOf _
  11623. * @since 0.1.0
  11624. * @category Function
  11625. * @param {*} value The value to wrap.
  11626. * @param {Function} [wrapper=identity] The wrapper function.
  11627. * @returns {Function} Returns the new function.
  11628. * @example
  11629. *
  11630. * var p = _.wrap(_.escape, function(func, text) {
  11631. * return '<p>' + func(text) + '</p>';
  11632. * });
  11633. *
  11634. * p('fred, barney, & pebbles');
  11635. * // => '<p>fred, barney, &amp; pebbles</p>'
  11636. */
  11637. function wrap(value, wrapper) {
  11638. return partial(castFunction(wrapper), value);
  11639. }
  11640. /*------------------------------------------------------------------------*/
  11641. /**
  11642. * Casts `value` as an array if it's not one.
  11643. *
  11644. * @static
  11645. * @memberOf _
  11646. * @since 4.4.0
  11647. * @category Lang
  11648. * @param {*} value The value to inspect.
  11649. * @returns {Array} Returns the cast array.
  11650. * @example
  11651. *
  11652. * _.castArray(1);
  11653. * // => [1]
  11654. *
  11655. * _.castArray({ 'a': 1 });
  11656. * // => [{ 'a': 1 }]
  11657. *
  11658. * _.castArray('abc');
  11659. * // => ['abc']
  11660. *
  11661. * _.castArray(null);
  11662. * // => [null]
  11663. *
  11664. * _.castArray(undefined);
  11665. * // => [undefined]
  11666. *
  11667. * _.castArray();
  11668. * // => []
  11669. *
  11670. * var array = [1, 2, 3];
  11671. * console.log(_.castArray(array) === array);
  11672. * // => true
  11673. */
  11674. function castArray() {
  11675. if (!arguments.length) {
  11676. return [];
  11677. }
  11678. var value = arguments[0];
  11679. return isArray(value) ? value : [value];
  11680. }
  11681. /**
  11682. * Creates a shallow clone of `value`.
  11683. *
  11684. * **Note:** This method is loosely based on the
  11685. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11686. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11687. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11688. * arrays. The own enumerable properties of `arguments` objects are cloned
  11689. * as plain objects. An empty object is returned for uncloneable values such
  11690. * as error objects, functions, DOM nodes, and WeakMaps.
  11691. *
  11692. * @static
  11693. * @memberOf _
  11694. * @since 0.1.0
  11695. * @category Lang
  11696. * @param {*} value The value to clone.
  11697. * @returns {*} Returns the cloned value.
  11698. * @see _.cloneDeep
  11699. * @example
  11700. *
  11701. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11702. *
  11703. * var shallow = _.clone(objects);
  11704. * console.log(shallow[0] === objects[0]);
  11705. * // => true
  11706. */
  11707. function clone(value) {
  11708. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11709. }
  11710. /**
  11711. * This method is like `_.clone` except that it accepts `customizer` which
  11712. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11713. * cloning is handled by the method instead. The `customizer` is invoked with
  11714. * up to four arguments; (value [, index|key, object, stack]).
  11715. *
  11716. * @static
  11717. * @memberOf _
  11718. * @since 4.0.0
  11719. * @category Lang
  11720. * @param {*} value The value to clone.
  11721. * @param {Function} [customizer] The function to customize cloning.
  11722. * @returns {*} Returns the cloned value.
  11723. * @see _.cloneDeepWith
  11724. * @example
  11725. *
  11726. * function customizer(value) {
  11727. * if (_.isElement(value)) {
  11728. * return value.cloneNode(false);
  11729. * }
  11730. * }
  11731. *
  11732. * var el = _.cloneWith(document.body, customizer);
  11733. *
  11734. * console.log(el === document.body);
  11735. * // => false
  11736. * console.log(el.nodeName);
  11737. * // => 'BODY'
  11738. * console.log(el.childNodes.length);
  11739. * // => 0
  11740. */
  11741. function cloneWith(value, customizer) {
  11742. customizer = typeof customizer == 'function' ? customizer : undefined;
  11743. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11744. }
  11745. /**
  11746. * This method is like `_.clone` except that it recursively clones `value`.
  11747. *
  11748. * @static
  11749. * @memberOf _
  11750. * @since 1.0.0
  11751. * @category Lang
  11752. * @param {*} value The value to recursively clone.
  11753. * @returns {*} Returns the deep cloned value.
  11754. * @see _.clone
  11755. * @example
  11756. *
  11757. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11758. *
  11759. * var deep = _.cloneDeep(objects);
  11760. * console.log(deep[0] === objects[0]);
  11761. * // => false
  11762. */
  11763. function cloneDeep(value) {
  11764. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11765. }
  11766. /**
  11767. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11768. *
  11769. * @static
  11770. * @memberOf _
  11771. * @since 4.0.0
  11772. * @category Lang
  11773. * @param {*} value The value to recursively clone.
  11774. * @param {Function} [customizer] The function to customize cloning.
  11775. * @returns {*} Returns the deep cloned value.
  11776. * @see _.cloneWith
  11777. * @example
  11778. *
  11779. * function customizer(value) {
  11780. * if (_.isElement(value)) {
  11781. * return value.cloneNode(true);
  11782. * }
  11783. * }
  11784. *
  11785. * var el = _.cloneDeepWith(document.body, customizer);
  11786. *
  11787. * console.log(el === document.body);
  11788. * // => false
  11789. * console.log(el.nodeName);
  11790. * // => 'BODY'
  11791. * console.log(el.childNodes.length);
  11792. * // => 20
  11793. */
  11794. function cloneDeepWith(value, customizer) {
  11795. customizer = typeof customizer == 'function' ? customizer : undefined;
  11796. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11797. }
  11798. /**
  11799. * Checks if `object` conforms to `source` by invoking the predicate
  11800. * properties of `source` with the corresponding property values of `object`.
  11801. *
  11802. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11803. * partially applied.
  11804. *
  11805. * @static
  11806. * @memberOf _
  11807. * @since 4.14.0
  11808. * @category Lang
  11809. * @param {Object} object The object to inspect.
  11810. * @param {Object} source The object of property predicates to conform to.
  11811. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11812. * @example
  11813. *
  11814. * var object = { 'a': 1, 'b': 2 };
  11815. *
  11816. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11817. * // => true
  11818. *
  11819. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11820. * // => false
  11821. */
  11822. function conformsTo(object, source) {
  11823. return source == null || baseConformsTo(object, source, keys(source));
  11824. }
  11825. /**
  11826. * Performs a
  11827. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11828. * comparison between two values to determine if they are equivalent.
  11829. *
  11830. * @static
  11831. * @memberOf _
  11832. * @since 4.0.0
  11833. * @category Lang
  11834. * @param {*} value The value to compare.
  11835. * @param {*} other The other value to compare.
  11836. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11837. * @example
  11838. *
  11839. * var object = { 'a': 1 };
  11840. * var other = { 'a': 1 };
  11841. *
  11842. * _.eq(object, object);
  11843. * // => true
  11844. *
  11845. * _.eq(object, other);
  11846. * // => false
  11847. *
  11848. * _.eq('a', 'a');
  11849. * // => true
  11850. *
  11851. * _.eq('a', Object('a'));
  11852. * // => false
  11853. *
  11854. * _.eq(NaN, NaN);
  11855. * // => true
  11856. */
  11857. function eq(value, other) {
  11858. return value === other || (value !== value && other !== other);
  11859. }
  11860. /**
  11861. * Checks if `value` is greater than `other`.
  11862. *
  11863. * @static
  11864. * @memberOf _
  11865. * @since 3.9.0
  11866. * @category Lang
  11867. * @param {*} value The value to compare.
  11868. * @param {*} other The other value to compare.
  11869. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11870. * else `false`.
  11871. * @see _.lt
  11872. * @example
  11873. *
  11874. * _.gt(3, 1);
  11875. * // => true
  11876. *
  11877. * _.gt(3, 3);
  11878. * // => false
  11879. *
  11880. * _.gt(1, 3);
  11881. * // => false
  11882. */
  11883. var gt = createRelationalOperation(baseGt);
  11884. /**
  11885. * Checks if `value` is greater than or equal to `other`.
  11886. *
  11887. * @static
  11888. * @memberOf _
  11889. * @since 3.9.0
  11890. * @category Lang
  11891. * @param {*} value The value to compare.
  11892. * @param {*} other The other value to compare.
  11893. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11894. * `other`, else `false`.
  11895. * @see _.lte
  11896. * @example
  11897. *
  11898. * _.gte(3, 1);
  11899. * // => true
  11900. *
  11901. * _.gte(3, 3);
  11902. * // => true
  11903. *
  11904. * _.gte(1, 3);
  11905. * // => false
  11906. */
  11907. var gte = createRelationalOperation(function(value, other) {
  11908. return value >= other;
  11909. });
  11910. /**
  11911. * Checks if `value` is likely an `arguments` object.
  11912. *
  11913. * @static
  11914. * @memberOf _
  11915. * @since 0.1.0
  11916. * @category Lang
  11917. * @param {*} value The value to check.
  11918. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11919. * else `false`.
  11920. * @example
  11921. *
  11922. * _.isArguments(function() { return arguments; }());
  11923. * // => true
  11924. *
  11925. * _.isArguments([1, 2, 3]);
  11926. * // => false
  11927. */
  11928. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11929. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11930. !propertyIsEnumerable.call(value, 'callee');
  11931. };
  11932. /**
  11933. * Checks if `value` is classified as an `Array` object.
  11934. *
  11935. * @static
  11936. * @memberOf _
  11937. * @since 0.1.0
  11938. * @category Lang
  11939. * @param {*} value The value to check.
  11940. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11941. * @example
  11942. *
  11943. * _.isArray([1, 2, 3]);
  11944. * // => true
  11945. *
  11946. * _.isArray(document.body.children);
  11947. * // => false
  11948. *
  11949. * _.isArray('abc');
  11950. * // => false
  11951. *
  11952. * _.isArray(_.noop);
  11953. * // => false
  11954. */
  11955. var isArray = Array.isArray;
  11956. /**
  11957. * Checks if `value` is classified as an `ArrayBuffer` object.
  11958. *
  11959. * @static
  11960. * @memberOf _
  11961. * @since 4.3.0
  11962. * @category Lang
  11963. * @param {*} value The value to check.
  11964. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11965. * @example
  11966. *
  11967. * _.isArrayBuffer(new ArrayBuffer(2));
  11968. * // => true
  11969. *
  11970. * _.isArrayBuffer(new Array(2));
  11971. * // => false
  11972. */
  11973. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11974. /**
  11975. * Checks if `value` is array-like. A value is considered array-like if it's
  11976. * not a function and has a `value.length` that's an integer greater than or
  11977. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11978. *
  11979. * @static
  11980. * @memberOf _
  11981. * @since 4.0.0
  11982. * @category Lang
  11983. * @param {*} value The value to check.
  11984. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11985. * @example
  11986. *
  11987. * _.isArrayLike([1, 2, 3]);
  11988. * // => true
  11989. *
  11990. * _.isArrayLike(document.body.children);
  11991. * // => true
  11992. *
  11993. * _.isArrayLike('abc');
  11994. * // => true
  11995. *
  11996. * _.isArrayLike(_.noop);
  11997. * // => false
  11998. */
  11999. function isArrayLike(value) {
  12000. return value != null && isLength(value.length) && !isFunction(value);
  12001. }
  12002. /**
  12003. * This method is like `_.isArrayLike` except that it also checks if `value`
  12004. * is an object.
  12005. *
  12006. * @static
  12007. * @memberOf _
  12008. * @since 4.0.0
  12009. * @category Lang
  12010. * @param {*} value The value to check.
  12011. * @returns {boolean} Returns `true` if `value` is an array-like object,
  12012. * else `false`.
  12013. * @example
  12014. *
  12015. * _.isArrayLikeObject([1, 2, 3]);
  12016. * // => true
  12017. *
  12018. * _.isArrayLikeObject(document.body.children);
  12019. * // => true
  12020. *
  12021. * _.isArrayLikeObject('abc');
  12022. * // => false
  12023. *
  12024. * _.isArrayLikeObject(_.noop);
  12025. * // => false
  12026. */
  12027. function isArrayLikeObject(value) {
  12028. return isObjectLike(value) && isArrayLike(value);
  12029. }
  12030. /**
  12031. * Checks if `value` is classified as a boolean primitive or object.
  12032. *
  12033. * @static
  12034. * @memberOf _
  12035. * @since 0.1.0
  12036. * @category Lang
  12037. * @param {*} value The value to check.
  12038. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  12039. * @example
  12040. *
  12041. * _.isBoolean(false);
  12042. * // => true
  12043. *
  12044. * _.isBoolean(null);
  12045. * // => false
  12046. */
  12047. function isBoolean(value) {
  12048. return value === true || value === false ||
  12049. (isObjectLike(value) && baseGetTag(value) == boolTag);
  12050. }
  12051. /**
  12052. * Checks if `value` is a buffer.
  12053. *
  12054. * @static
  12055. * @memberOf _
  12056. * @since 4.3.0
  12057. * @category Lang
  12058. * @param {*} value The value to check.
  12059. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12060. * @example
  12061. *
  12062. * _.isBuffer(new Buffer(2));
  12063. * // => true
  12064. *
  12065. * _.isBuffer(new Uint8Array(2));
  12066. * // => false
  12067. */
  12068. var isBuffer = nativeIsBuffer || stubFalse;
  12069. /**
  12070. * Checks if `value` is classified as a `Date` object.
  12071. *
  12072. * @static
  12073. * @memberOf _
  12074. * @since 0.1.0
  12075. * @category Lang
  12076. * @param {*} value The value to check.
  12077. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12078. * @example
  12079. *
  12080. * _.isDate(new Date);
  12081. * // => true
  12082. *
  12083. * _.isDate('Mon April 23 2012');
  12084. * // => false
  12085. */
  12086. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12087. /**
  12088. * Checks if `value` is likely a DOM element.
  12089. *
  12090. * @static
  12091. * @memberOf _
  12092. * @since 0.1.0
  12093. * @category Lang
  12094. * @param {*} value The value to check.
  12095. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12096. * @example
  12097. *
  12098. * _.isElement(document.body);
  12099. * // => true
  12100. *
  12101. * _.isElement('<body>');
  12102. * // => false
  12103. */
  12104. function isElement(value) {
  12105. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12106. }
  12107. /**
  12108. * Checks if `value` is an empty object, collection, map, or set.
  12109. *
  12110. * Objects are considered empty if they have no own enumerable string keyed
  12111. * properties.
  12112. *
  12113. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12114. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12115. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12116. *
  12117. * @static
  12118. * @memberOf _
  12119. * @since 0.1.0
  12120. * @category Lang
  12121. * @param {*} value The value to check.
  12122. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12123. * @example
  12124. *
  12125. * _.isEmpty(null);
  12126. * // => true
  12127. *
  12128. * _.isEmpty(true);
  12129. * // => true
  12130. *
  12131. * _.isEmpty(1);
  12132. * // => true
  12133. *
  12134. * _.isEmpty([1, 2, 3]);
  12135. * // => false
  12136. *
  12137. * _.isEmpty({ 'a': 1 });
  12138. * // => false
  12139. */
  12140. function isEmpty(value) {
  12141. if (value == null) {
  12142. return true;
  12143. }
  12144. if (isArrayLike(value) &&
  12145. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12146. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12147. return !value.length;
  12148. }
  12149. var tag = getTag(value);
  12150. if (tag == mapTag || tag == setTag) {
  12151. return !value.size;
  12152. }
  12153. if (isPrototype(value)) {
  12154. return !baseKeys(value).length;
  12155. }
  12156. for (var key in value) {
  12157. if (hasOwnProperty.call(value, key)) {
  12158. return false;
  12159. }
  12160. }
  12161. return true;
  12162. }
  12163. /**
  12164. * Performs a deep comparison between two values to determine if they are
  12165. * equivalent.
  12166. *
  12167. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12168. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12169. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12170. * by their own, not inherited, enumerable properties. Functions and DOM
  12171. * nodes are compared by strict equality, i.e. `===`.
  12172. *
  12173. * @static
  12174. * @memberOf _
  12175. * @since 0.1.0
  12176. * @category Lang
  12177. * @param {*} value The value to compare.
  12178. * @param {*} other The other value to compare.
  12179. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12180. * @example
  12181. *
  12182. * var object = { 'a': 1 };
  12183. * var other = { 'a': 1 };
  12184. *
  12185. * _.isEqual(object, other);
  12186. * // => true
  12187. *
  12188. * object === other;
  12189. * // => false
  12190. */
  12191. function isEqual(value, other) {
  12192. return baseIsEqual(value, other);
  12193. }
  12194. /**
  12195. * This method is like `_.isEqual` except that it accepts `customizer` which
  12196. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12197. * are handled by the method instead. The `customizer` is invoked with up to
  12198. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12199. *
  12200. * @static
  12201. * @memberOf _
  12202. * @since 4.0.0
  12203. * @category Lang
  12204. * @param {*} value The value to compare.
  12205. * @param {*} other The other value to compare.
  12206. * @param {Function} [customizer] The function to customize comparisons.
  12207. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12208. * @example
  12209. *
  12210. * function isGreeting(value) {
  12211. * return /^h(?:i|ello)$/.test(value);
  12212. * }
  12213. *
  12214. * function customizer(objValue, othValue) {
  12215. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12216. * return true;
  12217. * }
  12218. * }
  12219. *
  12220. * var array = ['hello', 'goodbye'];
  12221. * var other = ['hi', 'goodbye'];
  12222. *
  12223. * _.isEqualWith(array, other, customizer);
  12224. * // => true
  12225. */
  12226. function isEqualWith(value, other, customizer) {
  12227. customizer = typeof customizer == 'function' ? customizer : undefined;
  12228. var result = customizer ? customizer(value, other) : undefined;
  12229. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12230. }
  12231. /**
  12232. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12233. * `SyntaxError`, `TypeError`, or `URIError` object.
  12234. *
  12235. * @static
  12236. * @memberOf _
  12237. * @since 3.0.0
  12238. * @category Lang
  12239. * @param {*} value The value to check.
  12240. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12241. * @example
  12242. *
  12243. * _.isError(new Error);
  12244. * // => true
  12245. *
  12246. * _.isError(Error);
  12247. * // => false
  12248. */
  12249. function isError(value) {
  12250. if (!isObjectLike(value)) {
  12251. return false;
  12252. }
  12253. var tag = baseGetTag(value);
  12254. return tag == errorTag || tag == domExcTag ||
  12255. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12256. }
  12257. /**
  12258. * Checks if `value` is a finite primitive number.
  12259. *
  12260. * **Note:** This method is based on
  12261. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12262. *
  12263. * @static
  12264. * @memberOf _
  12265. * @since 0.1.0
  12266. * @category Lang
  12267. * @param {*} value The value to check.
  12268. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12269. * @example
  12270. *
  12271. * _.isFinite(3);
  12272. * // => true
  12273. *
  12274. * _.isFinite(Number.MIN_VALUE);
  12275. * // => true
  12276. *
  12277. * _.isFinite(Infinity);
  12278. * // => false
  12279. *
  12280. * _.isFinite('3');
  12281. * // => false
  12282. */
  12283. function isFinite(value) {
  12284. return typeof value == 'number' && nativeIsFinite(value);
  12285. }
  12286. /**
  12287. * Checks if `value` is classified as a `Function` object.
  12288. *
  12289. * @static
  12290. * @memberOf _
  12291. * @since 0.1.0
  12292. * @category Lang
  12293. * @param {*} value The value to check.
  12294. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12295. * @example
  12296. *
  12297. * _.isFunction(_);
  12298. * // => true
  12299. *
  12300. * _.isFunction(/abc/);
  12301. * // => false
  12302. */
  12303. function isFunction(value) {
  12304. if (!isObject(value)) {
  12305. return false;
  12306. }
  12307. // The use of `Object#toString` avoids issues with the `typeof` operator
  12308. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12309. var tag = baseGetTag(value);
  12310. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12311. }
  12312. /**
  12313. * Checks if `value` is an integer.
  12314. *
  12315. * **Note:** This method is based on
  12316. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12317. *
  12318. * @static
  12319. * @memberOf _
  12320. * @since 4.0.0
  12321. * @category Lang
  12322. * @param {*} value The value to check.
  12323. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12324. * @example
  12325. *
  12326. * _.isInteger(3);
  12327. * // => true
  12328. *
  12329. * _.isInteger(Number.MIN_VALUE);
  12330. * // => false
  12331. *
  12332. * _.isInteger(Infinity);
  12333. * // => false
  12334. *
  12335. * _.isInteger('3');
  12336. * // => false
  12337. */
  12338. function isInteger(value) {
  12339. return typeof value == 'number' && value == toInteger(value);
  12340. }
  12341. /**
  12342. * Checks if `value` is a valid array-like length.
  12343. *
  12344. * **Note:** This method is loosely based on
  12345. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12346. *
  12347. * @static
  12348. * @memberOf _
  12349. * @since 4.0.0
  12350. * @category Lang
  12351. * @param {*} value The value to check.
  12352. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12353. * @example
  12354. *
  12355. * _.isLength(3);
  12356. * // => true
  12357. *
  12358. * _.isLength(Number.MIN_VALUE);
  12359. * // => false
  12360. *
  12361. * _.isLength(Infinity);
  12362. * // => false
  12363. *
  12364. * _.isLength('3');
  12365. * // => false
  12366. */
  12367. function isLength(value) {
  12368. return typeof value == 'number' &&
  12369. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12370. }
  12371. /**
  12372. * Checks if `value` is the
  12373. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12374. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12375. *
  12376. * @static
  12377. * @memberOf _
  12378. * @since 0.1.0
  12379. * @category Lang
  12380. * @param {*} value The value to check.
  12381. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12382. * @example
  12383. *
  12384. * _.isObject({});
  12385. * // => true
  12386. *
  12387. * _.isObject([1, 2, 3]);
  12388. * // => true
  12389. *
  12390. * _.isObject(_.noop);
  12391. * // => true
  12392. *
  12393. * _.isObject(null);
  12394. * // => false
  12395. */
  12396. function isObject(value) {
  12397. var type = typeof value;
  12398. return value != null && (type == 'object' || type == 'function');
  12399. }
  12400. /**
  12401. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12402. * and has a `typeof` result of "object".
  12403. *
  12404. * @static
  12405. * @memberOf _
  12406. * @since 4.0.0
  12407. * @category Lang
  12408. * @param {*} value The value to check.
  12409. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12410. * @example
  12411. *
  12412. * _.isObjectLike({});
  12413. * // => true
  12414. *
  12415. * _.isObjectLike([1, 2, 3]);
  12416. * // => true
  12417. *
  12418. * _.isObjectLike(_.noop);
  12419. * // => false
  12420. *
  12421. * _.isObjectLike(null);
  12422. * // => false
  12423. */
  12424. function isObjectLike(value) {
  12425. return value != null && typeof value == 'object';
  12426. }
  12427. /**
  12428. * Checks if `value` is classified as a `Map` object.
  12429. *
  12430. * @static
  12431. * @memberOf _
  12432. * @since 4.3.0
  12433. * @category Lang
  12434. * @param {*} value The value to check.
  12435. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12436. * @example
  12437. *
  12438. * _.isMap(new Map);
  12439. * // => true
  12440. *
  12441. * _.isMap(new WeakMap);
  12442. * // => false
  12443. */
  12444. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12445. /**
  12446. * Performs a partial deep comparison between `object` and `source` to
  12447. * determine if `object` contains equivalent property values.
  12448. *
  12449. * **Note:** This method is equivalent to `_.matches` when `source` is
  12450. * partially applied.
  12451. *
  12452. * Partial comparisons will match empty array and empty object `source`
  12453. * values against any array or object value, respectively. See `_.isEqual`
  12454. * for a list of supported value comparisons.
  12455. *
  12456. * @static
  12457. * @memberOf _
  12458. * @since 3.0.0
  12459. * @category Lang
  12460. * @param {Object} object The object to inspect.
  12461. * @param {Object} source The object of property values to match.
  12462. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12463. * @example
  12464. *
  12465. * var object = { 'a': 1, 'b': 2 };
  12466. *
  12467. * _.isMatch(object, { 'b': 2 });
  12468. * // => true
  12469. *
  12470. * _.isMatch(object, { 'b': 1 });
  12471. * // => false
  12472. */
  12473. function isMatch(object, source) {
  12474. return object === source || baseIsMatch(object, source, getMatchData(source));
  12475. }
  12476. /**
  12477. * This method is like `_.isMatch` except that it accepts `customizer` which
  12478. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12479. * are handled by the method instead. The `customizer` is invoked with five
  12480. * arguments: (objValue, srcValue, index|key, object, source).
  12481. *
  12482. * @static
  12483. * @memberOf _
  12484. * @since 4.0.0
  12485. * @category Lang
  12486. * @param {Object} object The object to inspect.
  12487. * @param {Object} source The object of property values to match.
  12488. * @param {Function} [customizer] The function to customize comparisons.
  12489. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12490. * @example
  12491. *
  12492. * function isGreeting(value) {
  12493. * return /^h(?:i|ello)$/.test(value);
  12494. * }
  12495. *
  12496. * function customizer(objValue, srcValue) {
  12497. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12498. * return true;
  12499. * }
  12500. * }
  12501. *
  12502. * var object = { 'greeting': 'hello' };
  12503. * var source = { 'greeting': 'hi' };
  12504. *
  12505. * _.isMatchWith(object, source, customizer);
  12506. * // => true
  12507. */
  12508. function isMatchWith(object, source, customizer) {
  12509. customizer = typeof customizer == 'function' ? customizer : undefined;
  12510. return baseIsMatch(object, source, getMatchData(source), customizer);
  12511. }
  12512. /**
  12513. * Checks if `value` is `NaN`.
  12514. *
  12515. * **Note:** This method is based on
  12516. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12517. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12518. * `undefined` and other non-number values.
  12519. *
  12520. * @static
  12521. * @memberOf _
  12522. * @since 0.1.0
  12523. * @category Lang
  12524. * @param {*} value The value to check.
  12525. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12526. * @example
  12527. *
  12528. * _.isNaN(NaN);
  12529. * // => true
  12530. *
  12531. * _.isNaN(new Number(NaN));
  12532. * // => true
  12533. *
  12534. * isNaN(undefined);
  12535. * // => true
  12536. *
  12537. * _.isNaN(undefined);
  12538. * // => false
  12539. */
  12540. function isNaN(value) {
  12541. // An `NaN` primitive is the only value that is not equal to itself.
  12542. // Perform the `toStringTag` check first to avoid errors with some
  12543. // ActiveX objects in IE.
  12544. return isNumber(value) && value != +value;
  12545. }
  12546. /**
  12547. * Checks if `value` is a pristine native function.
  12548. *
  12549. * **Note:** This method can't reliably detect native functions in the presence
  12550. * of the core-js package because core-js circumvents this kind of detection.
  12551. * Despite multiple requests, the core-js maintainer has made it clear: any
  12552. * attempt to fix the detection will be obstructed. As a result, we're left
  12553. * with little choice but to throw an error. Unfortunately, this also affects
  12554. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12555. * which rely on core-js.
  12556. *
  12557. * @static
  12558. * @memberOf _
  12559. * @since 3.0.0
  12560. * @category Lang
  12561. * @param {*} value The value to check.
  12562. * @returns {boolean} Returns `true` if `value` is a native function,
  12563. * else `false`.
  12564. * @example
  12565. *
  12566. * _.isNative(Array.prototype.push);
  12567. * // => true
  12568. *
  12569. * _.isNative(_);
  12570. * // => false
  12571. */
  12572. function isNative(value) {
  12573. if (isMaskable(value)) {
  12574. throw new Error(CORE_ERROR_TEXT);
  12575. }
  12576. return baseIsNative(value);
  12577. }
  12578. /**
  12579. * Checks if `value` is `null`.
  12580. *
  12581. * @static
  12582. * @memberOf _
  12583. * @since 0.1.0
  12584. * @category Lang
  12585. * @param {*} value The value to check.
  12586. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12587. * @example
  12588. *
  12589. * _.isNull(null);
  12590. * // => true
  12591. *
  12592. * _.isNull(void 0);
  12593. * // => false
  12594. */
  12595. function isNull(value) {
  12596. return value === null;
  12597. }
  12598. /**
  12599. * Checks if `value` is `null` or `undefined`.
  12600. *
  12601. * @static
  12602. * @memberOf _
  12603. * @since 4.0.0
  12604. * @category Lang
  12605. * @param {*} value The value to check.
  12606. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12607. * @example
  12608. *
  12609. * _.isNil(null);
  12610. * // => true
  12611. *
  12612. * _.isNil(void 0);
  12613. * // => true
  12614. *
  12615. * _.isNil(NaN);
  12616. * // => false
  12617. */
  12618. function isNil(value) {
  12619. return value == null;
  12620. }
  12621. /**
  12622. * Checks if `value` is classified as a `Number` primitive or object.
  12623. *
  12624. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12625. * classified as numbers, use the `_.isFinite` method.
  12626. *
  12627. * @static
  12628. * @memberOf _
  12629. * @since 0.1.0
  12630. * @category Lang
  12631. * @param {*} value The value to check.
  12632. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12633. * @example
  12634. *
  12635. * _.isNumber(3);
  12636. * // => true
  12637. *
  12638. * _.isNumber(Number.MIN_VALUE);
  12639. * // => true
  12640. *
  12641. * _.isNumber(Infinity);
  12642. * // => true
  12643. *
  12644. * _.isNumber('3');
  12645. * // => false
  12646. */
  12647. function isNumber(value) {
  12648. return typeof value == 'number' ||
  12649. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12650. }
  12651. /**
  12652. * Checks if `value` is a plain object, that is, an object created by the
  12653. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12654. *
  12655. * @static
  12656. * @memberOf _
  12657. * @since 0.8.0
  12658. * @category Lang
  12659. * @param {*} value The value to check.
  12660. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12661. * @example
  12662. *
  12663. * function Foo() {
  12664. * this.a = 1;
  12665. * }
  12666. *
  12667. * _.isPlainObject(new Foo);
  12668. * // => false
  12669. *
  12670. * _.isPlainObject([1, 2, 3]);
  12671. * // => false
  12672. *
  12673. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12674. * // => true
  12675. *
  12676. * _.isPlainObject(Object.create(null));
  12677. * // => true
  12678. */
  12679. function isPlainObject(value) {
  12680. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12681. return false;
  12682. }
  12683. var proto = getPrototype(value);
  12684. if (proto === null) {
  12685. return true;
  12686. }
  12687. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12688. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12689. funcToString.call(Ctor) == objectCtorString;
  12690. }
  12691. /**
  12692. * Checks if `value` is classified as a `RegExp` object.
  12693. *
  12694. * @static
  12695. * @memberOf _
  12696. * @since 0.1.0
  12697. * @category Lang
  12698. * @param {*} value The value to check.
  12699. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12700. * @example
  12701. *
  12702. * _.isRegExp(/abc/);
  12703. * // => true
  12704. *
  12705. * _.isRegExp('/abc/');
  12706. * // => false
  12707. */
  12708. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12709. /**
  12710. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12711. * double precision number which isn't the result of a rounded unsafe integer.
  12712. *
  12713. * **Note:** This method is based on
  12714. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12715. *
  12716. * @static
  12717. * @memberOf _
  12718. * @since 4.0.0
  12719. * @category Lang
  12720. * @param {*} value The value to check.
  12721. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12722. * @example
  12723. *
  12724. * _.isSafeInteger(3);
  12725. * // => true
  12726. *
  12727. * _.isSafeInteger(Number.MIN_VALUE);
  12728. * // => false
  12729. *
  12730. * _.isSafeInteger(Infinity);
  12731. * // => false
  12732. *
  12733. * _.isSafeInteger('3');
  12734. * // => false
  12735. */
  12736. function isSafeInteger(value) {
  12737. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12738. }
  12739. /**
  12740. * Checks if `value` is classified as a `Set` object.
  12741. *
  12742. * @static
  12743. * @memberOf _
  12744. * @since 4.3.0
  12745. * @category Lang
  12746. * @param {*} value The value to check.
  12747. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12748. * @example
  12749. *
  12750. * _.isSet(new Set);
  12751. * // => true
  12752. *
  12753. * _.isSet(new WeakSet);
  12754. * // => false
  12755. */
  12756. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12757. /**
  12758. * Checks if `value` is classified as a `String` primitive or object.
  12759. *
  12760. * @static
  12761. * @since 0.1.0
  12762. * @memberOf _
  12763. * @category Lang
  12764. * @param {*} value The value to check.
  12765. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12766. * @example
  12767. *
  12768. * _.isString('abc');
  12769. * // => true
  12770. *
  12771. * _.isString(1);
  12772. * // => false
  12773. */
  12774. function isString(value) {
  12775. return typeof value == 'string' ||
  12776. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12777. }
  12778. /**
  12779. * Checks if `value` is classified as a `Symbol` primitive or object.
  12780. *
  12781. * @static
  12782. * @memberOf _
  12783. * @since 4.0.0
  12784. * @category Lang
  12785. * @param {*} value The value to check.
  12786. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12787. * @example
  12788. *
  12789. * _.isSymbol(Symbol.iterator);
  12790. * // => true
  12791. *
  12792. * _.isSymbol('abc');
  12793. * // => false
  12794. */
  12795. function isSymbol(value) {
  12796. return typeof value == 'symbol' ||
  12797. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12798. }
  12799. /**
  12800. * Checks if `value` is classified as a typed array.
  12801. *
  12802. * @static
  12803. * @memberOf _
  12804. * @since 3.0.0
  12805. * @category Lang
  12806. * @param {*} value The value to check.
  12807. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12808. * @example
  12809. *
  12810. * _.isTypedArray(new Uint8Array);
  12811. * // => true
  12812. *
  12813. * _.isTypedArray([]);
  12814. * // => false
  12815. */
  12816. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12817. /**
  12818. * Checks if `value` is `undefined`.
  12819. *
  12820. * @static
  12821. * @since 0.1.0
  12822. * @memberOf _
  12823. * @category Lang
  12824. * @param {*} value The value to check.
  12825. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12826. * @example
  12827. *
  12828. * _.isUndefined(void 0);
  12829. * // => true
  12830. *
  12831. * _.isUndefined(null);
  12832. * // => false
  12833. */
  12834. function isUndefined(value) {
  12835. return value === undefined;
  12836. }
  12837. /**
  12838. * Checks if `value` is classified as a `WeakMap` object.
  12839. *
  12840. * @static
  12841. * @memberOf _
  12842. * @since 4.3.0
  12843. * @category Lang
  12844. * @param {*} value The value to check.
  12845. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12846. * @example
  12847. *
  12848. * _.isWeakMap(new WeakMap);
  12849. * // => true
  12850. *
  12851. * _.isWeakMap(new Map);
  12852. * // => false
  12853. */
  12854. function isWeakMap(value) {
  12855. return isObjectLike(value) && getTag(value) == weakMapTag;
  12856. }
  12857. /**
  12858. * Checks if `value` is classified as a `WeakSet` object.
  12859. *
  12860. * @static
  12861. * @memberOf _
  12862. * @since 4.3.0
  12863. * @category Lang
  12864. * @param {*} value The value to check.
  12865. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12866. * @example
  12867. *
  12868. * _.isWeakSet(new WeakSet);
  12869. * // => true
  12870. *
  12871. * _.isWeakSet(new Set);
  12872. * // => false
  12873. */
  12874. function isWeakSet(value) {
  12875. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12876. }
  12877. /**
  12878. * Checks if `value` is less than `other`.
  12879. *
  12880. * @static
  12881. * @memberOf _
  12882. * @since 3.9.0
  12883. * @category Lang
  12884. * @param {*} value The value to compare.
  12885. * @param {*} other The other value to compare.
  12886. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12887. * else `false`.
  12888. * @see _.gt
  12889. * @example
  12890. *
  12891. * _.lt(1, 3);
  12892. * // => true
  12893. *
  12894. * _.lt(3, 3);
  12895. * // => false
  12896. *
  12897. * _.lt(3, 1);
  12898. * // => false
  12899. */
  12900. var lt = createRelationalOperation(baseLt);
  12901. /**
  12902. * Checks if `value` is less than or equal to `other`.
  12903. *
  12904. * @static
  12905. * @memberOf _
  12906. * @since 3.9.0
  12907. * @category Lang
  12908. * @param {*} value The value to compare.
  12909. * @param {*} other The other value to compare.
  12910. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12911. * `other`, else `false`.
  12912. * @see _.gte
  12913. * @example
  12914. *
  12915. * _.lte(1, 3);
  12916. * // => true
  12917. *
  12918. * _.lte(3, 3);
  12919. * // => true
  12920. *
  12921. * _.lte(3, 1);
  12922. * // => false
  12923. */
  12924. var lte = createRelationalOperation(function(value, other) {
  12925. return value <= other;
  12926. });
  12927. /**
  12928. * Converts `value` to an array.
  12929. *
  12930. * @static
  12931. * @since 0.1.0
  12932. * @memberOf _
  12933. * @category Lang
  12934. * @param {*} value The value to convert.
  12935. * @returns {Array} Returns the converted array.
  12936. * @example
  12937. *
  12938. * _.toArray({ 'a': 1, 'b': 2 });
  12939. * // => [1, 2]
  12940. *
  12941. * _.toArray('abc');
  12942. * // => ['a', 'b', 'c']
  12943. *
  12944. * _.toArray(1);
  12945. * // => []
  12946. *
  12947. * _.toArray(null);
  12948. * // => []
  12949. */
  12950. function toArray(value) {
  12951. if (!value) {
  12952. return [];
  12953. }
  12954. if (isArrayLike(value)) {
  12955. return isString(value) ? stringToArray(value) : copyArray(value);
  12956. }
  12957. if (symIterator && value[symIterator]) {
  12958. return iteratorToArray(value[symIterator]());
  12959. }
  12960. var tag = getTag(value),
  12961. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12962. return func(value);
  12963. }
  12964. /**
  12965. * Converts `value` to a finite number.
  12966. *
  12967. * @static
  12968. * @memberOf _
  12969. * @since 4.12.0
  12970. * @category Lang
  12971. * @param {*} value The value to convert.
  12972. * @returns {number} Returns the converted number.
  12973. * @example
  12974. *
  12975. * _.toFinite(3.2);
  12976. * // => 3.2
  12977. *
  12978. * _.toFinite(Number.MIN_VALUE);
  12979. * // => 5e-324
  12980. *
  12981. * _.toFinite(Infinity);
  12982. * // => 1.7976931348623157e+308
  12983. *
  12984. * _.toFinite('3.2');
  12985. * // => 3.2
  12986. */
  12987. function toFinite(value) {
  12988. if (!value) {
  12989. return value === 0 ? value : 0;
  12990. }
  12991. value = toNumber(value);
  12992. if (value === INFINITY || value === -INFINITY) {
  12993. var sign = (value < 0 ? -1 : 1);
  12994. return sign * MAX_INTEGER;
  12995. }
  12996. return value === value ? value : 0;
  12997. }
  12998. /**
  12999. * Converts `value` to an integer.
  13000. *
  13001. * **Note:** This method is loosely based on
  13002. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  13003. *
  13004. * @static
  13005. * @memberOf _
  13006. * @since 4.0.0
  13007. * @category Lang
  13008. * @param {*} value The value to convert.
  13009. * @returns {number} Returns the converted integer.
  13010. * @example
  13011. *
  13012. * _.toInteger(3.2);
  13013. * // => 3
  13014. *
  13015. * _.toInteger(Number.MIN_VALUE);
  13016. * // => 0
  13017. *
  13018. * _.toInteger(Infinity);
  13019. * // => 1.7976931348623157e+308
  13020. *
  13021. * _.toInteger('3.2');
  13022. * // => 3
  13023. */
  13024. function toInteger(value) {
  13025. var result = toFinite(value),
  13026. remainder = result % 1;
  13027. return result === result ? (remainder ? result - remainder : result) : 0;
  13028. }
  13029. /**
  13030. * Converts `value` to an integer suitable for use as the length of an
  13031. * array-like object.
  13032. *
  13033. * **Note:** This method is based on
  13034. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  13035. *
  13036. * @static
  13037. * @memberOf _
  13038. * @since 4.0.0
  13039. * @category Lang
  13040. * @param {*} value The value to convert.
  13041. * @returns {number} Returns the converted integer.
  13042. * @example
  13043. *
  13044. * _.toLength(3.2);
  13045. * // => 3
  13046. *
  13047. * _.toLength(Number.MIN_VALUE);
  13048. * // => 0
  13049. *
  13050. * _.toLength(Infinity);
  13051. * // => 4294967295
  13052. *
  13053. * _.toLength('3.2');
  13054. * // => 3
  13055. */
  13056. function toLength(value) {
  13057. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13058. }
  13059. /**
  13060. * Converts `value` to a number.
  13061. *
  13062. * @static
  13063. * @memberOf _
  13064. * @since 4.0.0
  13065. * @category Lang
  13066. * @param {*} value The value to process.
  13067. * @returns {number} Returns the number.
  13068. * @example
  13069. *
  13070. * _.toNumber(3.2);
  13071. * // => 3.2
  13072. *
  13073. * _.toNumber(Number.MIN_VALUE);
  13074. * // => 5e-324
  13075. *
  13076. * _.toNumber(Infinity);
  13077. * // => Infinity
  13078. *
  13079. * _.toNumber('3.2');
  13080. * // => 3.2
  13081. */
  13082. function toNumber(value) {
  13083. if (typeof value == 'number') {
  13084. return value;
  13085. }
  13086. if (isSymbol(value)) {
  13087. return NAN;
  13088. }
  13089. if (isObject(value)) {
  13090. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13091. value = isObject(other) ? (other + '') : other;
  13092. }
  13093. if (typeof value != 'string') {
  13094. return value === 0 ? value : +value;
  13095. }
  13096. value = baseTrim(value);
  13097. var isBinary = reIsBinary.test(value);
  13098. return (isBinary || reIsOctal.test(value))
  13099. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13100. : (reIsBadHex.test(value) ? NAN : +value);
  13101. }
  13102. /**
  13103. * Converts `value` to a plain object flattening inherited enumerable string
  13104. * keyed properties of `value` to own properties of the plain object.
  13105. *
  13106. * @static
  13107. * @memberOf _
  13108. * @since 3.0.0
  13109. * @category Lang
  13110. * @param {*} value The value to convert.
  13111. * @returns {Object} Returns the converted plain object.
  13112. * @example
  13113. *
  13114. * function Foo() {
  13115. * this.b = 2;
  13116. * }
  13117. *
  13118. * Foo.prototype.c = 3;
  13119. *
  13120. * _.assign({ 'a': 1 }, new Foo);
  13121. * // => { 'a': 1, 'b': 2 }
  13122. *
  13123. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13124. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13125. */
  13126. function toPlainObject(value) {
  13127. return copyObject(value, keysIn(value));
  13128. }
  13129. /**
  13130. * Converts `value` to a safe integer. A safe integer can be compared and
  13131. * represented correctly.
  13132. *
  13133. * @static
  13134. * @memberOf _
  13135. * @since 4.0.0
  13136. * @category Lang
  13137. * @param {*} value The value to convert.
  13138. * @returns {number} Returns the converted integer.
  13139. * @example
  13140. *
  13141. * _.toSafeInteger(3.2);
  13142. * // => 3
  13143. *
  13144. * _.toSafeInteger(Number.MIN_VALUE);
  13145. * // => 0
  13146. *
  13147. * _.toSafeInteger(Infinity);
  13148. * // => 9007199254740991
  13149. *
  13150. * _.toSafeInteger('3.2');
  13151. * // => 3
  13152. */
  13153. function toSafeInteger(value) {
  13154. return value
  13155. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13156. : (value === 0 ? value : 0);
  13157. }
  13158. /**
  13159. * Converts `value` to a string. An empty string is returned for `null`
  13160. * and `undefined` values. The sign of `-0` is preserved.
  13161. *
  13162. * @static
  13163. * @memberOf _
  13164. * @since 4.0.0
  13165. * @category Lang
  13166. * @param {*} value The value to convert.
  13167. * @returns {string} Returns the converted string.
  13168. * @example
  13169. *
  13170. * _.toString(null);
  13171. * // => ''
  13172. *
  13173. * _.toString(-0);
  13174. * // => '-0'
  13175. *
  13176. * _.toString([1, 2, 3]);
  13177. * // => '1,2,3'
  13178. */
  13179. function toString(value) {
  13180. return value == null ? '' : baseToString(value);
  13181. }
  13182. /*------------------------------------------------------------------------*/
  13183. /**
  13184. * Assigns own enumerable string keyed properties of source objects to the
  13185. * destination object. Source objects are applied from left to right.
  13186. * Subsequent sources overwrite property assignments of previous sources.
  13187. *
  13188. * **Note:** This method mutates `object` and is loosely based on
  13189. * [`Object.assign`](https://mdn.io/Object/assign).
  13190. *
  13191. * @static
  13192. * @memberOf _
  13193. * @since 0.10.0
  13194. * @category Object
  13195. * @param {Object} object The destination object.
  13196. * @param {...Object} [sources] The source objects.
  13197. * @returns {Object} Returns `object`.
  13198. * @see _.assignIn
  13199. * @example
  13200. *
  13201. * function Foo() {
  13202. * this.a = 1;
  13203. * }
  13204. *
  13205. * function Bar() {
  13206. * this.c = 3;
  13207. * }
  13208. *
  13209. * Foo.prototype.b = 2;
  13210. * Bar.prototype.d = 4;
  13211. *
  13212. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13213. * // => { 'a': 1, 'c': 3 }
  13214. */
  13215. var assign = createAssigner(function(object, source) {
  13216. if (isPrototype(source) || isArrayLike(source)) {
  13217. copyObject(source, keys(source), object);
  13218. return;
  13219. }
  13220. for (var key in source) {
  13221. if (hasOwnProperty.call(source, key)) {
  13222. assignValue(object, key, source[key]);
  13223. }
  13224. }
  13225. });
  13226. /**
  13227. * This method is like `_.assign` except that it iterates over own and
  13228. * inherited source properties.
  13229. *
  13230. * **Note:** This method mutates `object`.
  13231. *
  13232. * @static
  13233. * @memberOf _
  13234. * @since 4.0.0
  13235. * @alias extend
  13236. * @category Object
  13237. * @param {Object} object The destination object.
  13238. * @param {...Object} [sources] The source objects.
  13239. * @returns {Object} Returns `object`.
  13240. * @see _.assign
  13241. * @example
  13242. *
  13243. * function Foo() {
  13244. * this.a = 1;
  13245. * }
  13246. *
  13247. * function Bar() {
  13248. * this.c = 3;
  13249. * }
  13250. *
  13251. * Foo.prototype.b = 2;
  13252. * Bar.prototype.d = 4;
  13253. *
  13254. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13255. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13256. */
  13257. var assignIn = createAssigner(function(object, source) {
  13258. copyObject(source, keysIn(source), object);
  13259. });
  13260. /**
  13261. * This method is like `_.assignIn` except that it accepts `customizer`
  13262. * which is invoked to produce the assigned values. If `customizer` returns
  13263. * `undefined`, assignment is handled by the method instead. The `customizer`
  13264. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13265. *
  13266. * **Note:** This method mutates `object`.
  13267. *
  13268. * @static
  13269. * @memberOf _
  13270. * @since 4.0.0
  13271. * @alias extendWith
  13272. * @category Object
  13273. * @param {Object} object The destination object.
  13274. * @param {...Object} sources The source objects.
  13275. * @param {Function} [customizer] The function to customize assigned values.
  13276. * @returns {Object} Returns `object`.
  13277. * @see _.assignWith
  13278. * @example
  13279. *
  13280. * function customizer(objValue, srcValue) {
  13281. * return _.isUndefined(objValue) ? srcValue : objValue;
  13282. * }
  13283. *
  13284. * var defaults = _.partialRight(_.assignInWith, customizer);
  13285. *
  13286. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13287. * // => { 'a': 1, 'b': 2 }
  13288. */
  13289. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13290. copyObject(source, keysIn(source), object, customizer);
  13291. });
  13292. /**
  13293. * This method is like `_.assign` except that it accepts `customizer`
  13294. * which is invoked to produce the assigned values. If `customizer` returns
  13295. * `undefined`, assignment is handled by the method instead. The `customizer`
  13296. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13297. *
  13298. * **Note:** This method mutates `object`.
  13299. *
  13300. * @static
  13301. * @memberOf _
  13302. * @since 4.0.0
  13303. * @category Object
  13304. * @param {Object} object The destination object.
  13305. * @param {...Object} sources The source objects.
  13306. * @param {Function} [customizer] The function to customize assigned values.
  13307. * @returns {Object} Returns `object`.
  13308. * @see _.assignInWith
  13309. * @example
  13310. *
  13311. * function customizer(objValue, srcValue) {
  13312. * return _.isUndefined(objValue) ? srcValue : objValue;
  13313. * }
  13314. *
  13315. * var defaults = _.partialRight(_.assignWith, customizer);
  13316. *
  13317. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13318. * // => { 'a': 1, 'b': 2 }
  13319. */
  13320. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13321. copyObject(source, keys(source), object, customizer);
  13322. });
  13323. /**
  13324. * Creates an array of values corresponding to `paths` of `object`.
  13325. *
  13326. * @static
  13327. * @memberOf _
  13328. * @since 1.0.0
  13329. * @category Object
  13330. * @param {Object} object The object to iterate over.
  13331. * @param {...(string|string[])} [paths] The property paths to pick.
  13332. * @returns {Array} Returns the picked values.
  13333. * @example
  13334. *
  13335. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13336. *
  13337. * _.at(object, ['a[0].b.c', 'a[1]']);
  13338. * // => [3, 4]
  13339. */
  13340. var at = flatRest(baseAt);
  13341. /**
  13342. * Creates an object that inherits from the `prototype` object. If a
  13343. * `properties` object is given, its own enumerable string keyed properties
  13344. * are assigned to the created object.
  13345. *
  13346. * @static
  13347. * @memberOf _
  13348. * @since 2.3.0
  13349. * @category Object
  13350. * @param {Object} prototype The object to inherit from.
  13351. * @param {Object} [properties] The properties to assign to the object.
  13352. * @returns {Object} Returns the new object.
  13353. * @example
  13354. *
  13355. * function Shape() {
  13356. * this.x = 0;
  13357. * this.y = 0;
  13358. * }
  13359. *
  13360. * function Circle() {
  13361. * Shape.call(this);
  13362. * }
  13363. *
  13364. * Circle.prototype = _.create(Shape.prototype, {
  13365. * 'constructor': Circle
  13366. * });
  13367. *
  13368. * var circle = new Circle;
  13369. * circle instanceof Circle;
  13370. * // => true
  13371. *
  13372. * circle instanceof Shape;
  13373. * // => true
  13374. */
  13375. function create(prototype, properties) {
  13376. var result = baseCreate(prototype);
  13377. return properties == null ? result : baseAssign(result, properties);
  13378. }
  13379. /**
  13380. * Assigns own and inherited enumerable string keyed properties of source
  13381. * objects to the destination object for all destination properties that
  13382. * resolve to `undefined`. Source objects are applied from left to right.
  13383. * Once a property is set, additional values of the same property are ignored.
  13384. *
  13385. * **Note:** This method mutates `object`.
  13386. *
  13387. * @static
  13388. * @since 0.1.0
  13389. * @memberOf _
  13390. * @category Object
  13391. * @param {Object} object The destination object.
  13392. * @param {...Object} [sources] The source objects.
  13393. * @returns {Object} Returns `object`.
  13394. * @see _.defaultsDeep
  13395. * @example
  13396. *
  13397. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13398. * // => { 'a': 1, 'b': 2 }
  13399. */
  13400. var defaults = baseRest(function(object, sources) {
  13401. object = Object(object);
  13402. var index = -1;
  13403. var length = sources.length;
  13404. var guard = length > 2 ? sources[2] : undefined;
  13405. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13406. length = 1;
  13407. }
  13408. while (++index < length) {
  13409. var source = sources[index];
  13410. var props = keysIn(source);
  13411. var propsIndex = -1;
  13412. var propsLength = props.length;
  13413. while (++propsIndex < propsLength) {
  13414. var key = props[propsIndex];
  13415. var value = object[key];
  13416. if (value === undefined ||
  13417. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13418. object[key] = source[key];
  13419. }
  13420. }
  13421. }
  13422. return object;
  13423. });
  13424. /**
  13425. * This method is like `_.defaults` except that it recursively assigns
  13426. * default properties.
  13427. *
  13428. * **Note:** This method mutates `object`.
  13429. *
  13430. * @static
  13431. * @memberOf _
  13432. * @since 3.10.0
  13433. * @category Object
  13434. * @param {Object} object The destination object.
  13435. * @param {...Object} [sources] The source objects.
  13436. * @returns {Object} Returns `object`.
  13437. * @see _.defaults
  13438. * @example
  13439. *
  13440. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13441. * // => { 'a': { 'b': 2, 'c': 3 } }
  13442. */
  13443. var defaultsDeep = baseRest(function(args) {
  13444. args.push(undefined, customDefaultsMerge);
  13445. return apply(mergeWith, undefined, args);
  13446. });
  13447. /**
  13448. * This method is like `_.find` except that it returns the key of the first
  13449. * element `predicate` returns truthy for instead of the element itself.
  13450. *
  13451. * @static
  13452. * @memberOf _
  13453. * @since 1.1.0
  13454. * @category Object
  13455. * @param {Object} object The object to inspect.
  13456. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13457. * @returns {string|undefined} Returns the key of the matched element,
  13458. * else `undefined`.
  13459. * @example
  13460. *
  13461. * var users = {
  13462. * 'barney': { 'age': 36, 'active': true },
  13463. * 'fred': { 'age': 40, 'active': false },
  13464. * 'pebbles': { 'age': 1, 'active': true }
  13465. * };
  13466. *
  13467. * _.findKey(users, function(o) { return o.age < 40; });
  13468. * // => 'barney' (iteration order is not guaranteed)
  13469. *
  13470. * // The `_.matches` iteratee shorthand.
  13471. * _.findKey(users, { 'age': 1, 'active': true });
  13472. * // => 'pebbles'
  13473. *
  13474. * // The `_.matchesProperty` iteratee shorthand.
  13475. * _.findKey(users, ['active', false]);
  13476. * // => 'fred'
  13477. *
  13478. * // The `_.property` iteratee shorthand.
  13479. * _.findKey(users, 'active');
  13480. * // => 'barney'
  13481. */
  13482. function findKey(object, predicate) {
  13483. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13484. }
  13485. /**
  13486. * This method is like `_.findKey` except that it iterates over elements of
  13487. * a collection in the opposite order.
  13488. *
  13489. * @static
  13490. * @memberOf _
  13491. * @since 2.0.0
  13492. * @category Object
  13493. * @param {Object} object The object to inspect.
  13494. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13495. * @returns {string|undefined} Returns the key of the matched element,
  13496. * else `undefined`.
  13497. * @example
  13498. *
  13499. * var users = {
  13500. * 'barney': { 'age': 36, 'active': true },
  13501. * 'fred': { 'age': 40, 'active': false },
  13502. * 'pebbles': { 'age': 1, 'active': true }
  13503. * };
  13504. *
  13505. * _.findLastKey(users, function(o) { return o.age < 40; });
  13506. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13507. *
  13508. * // The `_.matches` iteratee shorthand.
  13509. * _.findLastKey(users, { 'age': 36, 'active': true });
  13510. * // => 'barney'
  13511. *
  13512. * // The `_.matchesProperty` iteratee shorthand.
  13513. * _.findLastKey(users, ['active', false]);
  13514. * // => 'fred'
  13515. *
  13516. * // The `_.property` iteratee shorthand.
  13517. * _.findLastKey(users, 'active');
  13518. * // => 'pebbles'
  13519. */
  13520. function findLastKey(object, predicate) {
  13521. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13522. }
  13523. /**
  13524. * Iterates over own and inherited enumerable string keyed properties of an
  13525. * object and invokes `iteratee` for each property. The iteratee is invoked
  13526. * with three arguments: (value, key, object). Iteratee functions may exit
  13527. * iteration early by explicitly returning `false`.
  13528. *
  13529. * @static
  13530. * @memberOf _
  13531. * @since 0.3.0
  13532. * @category Object
  13533. * @param {Object} object The object to iterate over.
  13534. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13535. * @returns {Object} Returns `object`.
  13536. * @see _.forInRight
  13537. * @example
  13538. *
  13539. * function Foo() {
  13540. * this.a = 1;
  13541. * this.b = 2;
  13542. * }
  13543. *
  13544. * Foo.prototype.c = 3;
  13545. *
  13546. * _.forIn(new Foo, function(value, key) {
  13547. * console.log(key);
  13548. * });
  13549. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13550. */
  13551. function forIn(object, iteratee) {
  13552. return object == null
  13553. ? object
  13554. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13555. }
  13556. /**
  13557. * This method is like `_.forIn` except that it iterates over properties of
  13558. * `object` in the opposite order.
  13559. *
  13560. * @static
  13561. * @memberOf _
  13562. * @since 2.0.0
  13563. * @category Object
  13564. * @param {Object} object The object to iterate over.
  13565. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13566. * @returns {Object} Returns `object`.
  13567. * @see _.forIn
  13568. * @example
  13569. *
  13570. * function Foo() {
  13571. * this.a = 1;
  13572. * this.b = 2;
  13573. * }
  13574. *
  13575. * Foo.prototype.c = 3;
  13576. *
  13577. * _.forInRight(new Foo, function(value, key) {
  13578. * console.log(key);
  13579. * });
  13580. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13581. */
  13582. function forInRight(object, iteratee) {
  13583. return object == null
  13584. ? object
  13585. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13586. }
  13587. /**
  13588. * Iterates over own enumerable string keyed properties of an object and
  13589. * invokes `iteratee` for each property. The iteratee is invoked with three
  13590. * arguments: (value, key, object). Iteratee functions may exit iteration
  13591. * early by explicitly returning `false`.
  13592. *
  13593. * @static
  13594. * @memberOf _
  13595. * @since 0.3.0
  13596. * @category Object
  13597. * @param {Object} object The object to iterate over.
  13598. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13599. * @returns {Object} Returns `object`.
  13600. * @see _.forOwnRight
  13601. * @example
  13602. *
  13603. * function Foo() {
  13604. * this.a = 1;
  13605. * this.b = 2;
  13606. * }
  13607. *
  13608. * Foo.prototype.c = 3;
  13609. *
  13610. * _.forOwn(new Foo, function(value, key) {
  13611. * console.log(key);
  13612. * });
  13613. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13614. */
  13615. function forOwn(object, iteratee) {
  13616. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13617. }
  13618. /**
  13619. * This method is like `_.forOwn` except that it iterates over properties of
  13620. * `object` in the opposite order.
  13621. *
  13622. * @static
  13623. * @memberOf _
  13624. * @since 2.0.0
  13625. * @category Object
  13626. * @param {Object} object The object to iterate over.
  13627. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13628. * @returns {Object} Returns `object`.
  13629. * @see _.forOwn
  13630. * @example
  13631. *
  13632. * function Foo() {
  13633. * this.a = 1;
  13634. * this.b = 2;
  13635. * }
  13636. *
  13637. * Foo.prototype.c = 3;
  13638. *
  13639. * _.forOwnRight(new Foo, function(value, key) {
  13640. * console.log(key);
  13641. * });
  13642. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13643. */
  13644. function forOwnRight(object, iteratee) {
  13645. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13646. }
  13647. /**
  13648. * Creates an array of function property names from own enumerable properties
  13649. * of `object`.
  13650. *
  13651. * @static
  13652. * @since 0.1.0
  13653. * @memberOf _
  13654. * @category Object
  13655. * @param {Object} object The object to inspect.
  13656. * @returns {Array} Returns the function names.
  13657. * @see _.functionsIn
  13658. * @example
  13659. *
  13660. * function Foo() {
  13661. * this.a = _.constant('a');
  13662. * this.b = _.constant('b');
  13663. * }
  13664. *
  13665. * Foo.prototype.c = _.constant('c');
  13666. *
  13667. * _.functions(new Foo);
  13668. * // => ['a', 'b']
  13669. */
  13670. function functions(object) {
  13671. return object == null ? [] : baseFunctions(object, keys(object));
  13672. }
  13673. /**
  13674. * Creates an array of function property names from own and inherited
  13675. * enumerable properties of `object`.
  13676. *
  13677. * @static
  13678. * @memberOf _
  13679. * @since 4.0.0
  13680. * @category Object
  13681. * @param {Object} object The object to inspect.
  13682. * @returns {Array} Returns the function names.
  13683. * @see _.functions
  13684. * @example
  13685. *
  13686. * function Foo() {
  13687. * this.a = _.constant('a');
  13688. * this.b = _.constant('b');
  13689. * }
  13690. *
  13691. * Foo.prototype.c = _.constant('c');
  13692. *
  13693. * _.functionsIn(new Foo);
  13694. * // => ['a', 'b', 'c']
  13695. */
  13696. function functionsIn(object) {
  13697. return object == null ? [] : baseFunctions(object, keysIn(object));
  13698. }
  13699. /**
  13700. * Gets the value at `path` of `object`. If the resolved value is
  13701. * `undefined`, the `defaultValue` is returned in its place.
  13702. *
  13703. * @static
  13704. * @memberOf _
  13705. * @since 3.7.0
  13706. * @category Object
  13707. * @param {Object} object The object to query.
  13708. * @param {Array|string} path The path of the property to get.
  13709. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13710. * @returns {*} Returns the resolved value.
  13711. * @example
  13712. *
  13713. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13714. *
  13715. * _.get(object, 'a[0].b.c');
  13716. * // => 3
  13717. *
  13718. * _.get(object, ['a', '0', 'b', 'c']);
  13719. * // => 3
  13720. *
  13721. * _.get(object, 'a.b.c', 'default');
  13722. * // => 'default'
  13723. */
  13724. function get(object, path, defaultValue) {
  13725. var result = object == null ? undefined : baseGet(object, path);
  13726. return result === undefined ? defaultValue : result;
  13727. }
  13728. /**
  13729. * Checks if `path` is a direct property of `object`.
  13730. *
  13731. * @static
  13732. * @since 0.1.0
  13733. * @memberOf _
  13734. * @category Object
  13735. * @param {Object} object The object to query.
  13736. * @param {Array|string} path The path to check.
  13737. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13738. * @example
  13739. *
  13740. * var object = { 'a': { 'b': 2 } };
  13741. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13742. *
  13743. * _.has(object, 'a');
  13744. * // => true
  13745. *
  13746. * _.has(object, 'a.b');
  13747. * // => true
  13748. *
  13749. * _.has(object, ['a', 'b']);
  13750. * // => true
  13751. *
  13752. * _.has(other, 'a');
  13753. * // => false
  13754. */
  13755. function has(object, path) {
  13756. return object != null && hasPath(object, path, baseHas);
  13757. }
  13758. /**
  13759. * Checks if `path` is a direct or inherited property of `object`.
  13760. *
  13761. * @static
  13762. * @memberOf _
  13763. * @since 4.0.0
  13764. * @category Object
  13765. * @param {Object} object The object to query.
  13766. * @param {Array|string} path The path to check.
  13767. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13768. * @example
  13769. *
  13770. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13771. *
  13772. * _.hasIn(object, 'a');
  13773. * // => true
  13774. *
  13775. * _.hasIn(object, 'a.b');
  13776. * // => true
  13777. *
  13778. * _.hasIn(object, ['a', 'b']);
  13779. * // => true
  13780. *
  13781. * _.hasIn(object, 'b');
  13782. * // => false
  13783. */
  13784. function hasIn(object, path) {
  13785. return object != null && hasPath(object, path, baseHasIn);
  13786. }
  13787. /**
  13788. * Creates an object composed of the inverted keys and values of `object`.
  13789. * If `object` contains duplicate values, subsequent values overwrite
  13790. * property assignments of previous values.
  13791. *
  13792. * @static
  13793. * @memberOf _
  13794. * @since 0.7.0
  13795. * @category Object
  13796. * @param {Object} object The object to invert.
  13797. * @returns {Object} Returns the new inverted object.
  13798. * @example
  13799. *
  13800. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13801. *
  13802. * _.invert(object);
  13803. * // => { '1': 'c', '2': 'b' }
  13804. */
  13805. var invert = createInverter(function(result, value, key) {
  13806. if (value != null &&
  13807. typeof value.toString != 'function') {
  13808. value = nativeObjectToString.call(value);
  13809. }
  13810. result[value] = key;
  13811. }, constant(identity));
  13812. /**
  13813. * This method is like `_.invert` except that the inverted object is generated
  13814. * from the results of running each element of `object` thru `iteratee`. The
  13815. * corresponding inverted value of each inverted key is an array of keys
  13816. * responsible for generating the inverted value. The iteratee is invoked
  13817. * with one argument: (value).
  13818. *
  13819. * @static
  13820. * @memberOf _
  13821. * @since 4.1.0
  13822. * @category Object
  13823. * @param {Object} object The object to invert.
  13824. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13825. * @returns {Object} Returns the new inverted object.
  13826. * @example
  13827. *
  13828. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13829. *
  13830. * _.invertBy(object);
  13831. * // => { '1': ['a', 'c'], '2': ['b'] }
  13832. *
  13833. * _.invertBy(object, function(value) {
  13834. * return 'group' + value;
  13835. * });
  13836. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13837. */
  13838. var invertBy = createInverter(function(result, value, key) {
  13839. if (value != null &&
  13840. typeof value.toString != 'function') {
  13841. value = nativeObjectToString.call(value);
  13842. }
  13843. if (hasOwnProperty.call(result, value)) {
  13844. result[value].push(key);
  13845. } else {
  13846. result[value] = [key];
  13847. }
  13848. }, getIteratee);
  13849. /**
  13850. * Invokes the method at `path` of `object`.
  13851. *
  13852. * @static
  13853. * @memberOf _
  13854. * @since 4.0.0
  13855. * @category Object
  13856. * @param {Object} object The object to query.
  13857. * @param {Array|string} path The path of the method to invoke.
  13858. * @param {...*} [args] The arguments to invoke the method with.
  13859. * @returns {*} Returns the result of the invoked method.
  13860. * @example
  13861. *
  13862. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13863. *
  13864. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13865. * // => [2, 3]
  13866. */
  13867. var invoke = baseRest(baseInvoke);
  13868. /**
  13869. * Creates an array of the own enumerable property names of `object`.
  13870. *
  13871. * **Note:** Non-object values are coerced to objects. See the
  13872. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13873. * for more details.
  13874. *
  13875. * @static
  13876. * @since 0.1.0
  13877. * @memberOf _
  13878. * @category Object
  13879. * @param {Object} object The object to query.
  13880. * @returns {Array} Returns the array of property names.
  13881. * @example
  13882. *
  13883. * function Foo() {
  13884. * this.a = 1;
  13885. * this.b = 2;
  13886. * }
  13887. *
  13888. * Foo.prototype.c = 3;
  13889. *
  13890. * _.keys(new Foo);
  13891. * // => ['a', 'b'] (iteration order is not guaranteed)
  13892. *
  13893. * _.keys('hi');
  13894. * // => ['0', '1']
  13895. */
  13896. function keys(object) {
  13897. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13898. }
  13899. /**
  13900. * Creates an array of the own and inherited enumerable property names of `object`.
  13901. *
  13902. * **Note:** Non-object values are coerced to objects.
  13903. *
  13904. * @static
  13905. * @memberOf _
  13906. * @since 3.0.0
  13907. * @category Object
  13908. * @param {Object} object The object to query.
  13909. * @returns {Array} Returns the array of property names.
  13910. * @example
  13911. *
  13912. * function Foo() {
  13913. * this.a = 1;
  13914. * this.b = 2;
  13915. * }
  13916. *
  13917. * Foo.prototype.c = 3;
  13918. *
  13919. * _.keysIn(new Foo);
  13920. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13921. */
  13922. function keysIn(object) {
  13923. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13924. }
  13925. /**
  13926. * The opposite of `_.mapValues`; this method creates an object with the
  13927. * same values as `object` and keys generated by running each own enumerable
  13928. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13929. * with three arguments: (value, key, object).
  13930. *
  13931. * @static
  13932. * @memberOf _
  13933. * @since 3.8.0
  13934. * @category Object
  13935. * @param {Object} object The object to iterate over.
  13936. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13937. * @returns {Object} Returns the new mapped object.
  13938. * @see _.mapValues
  13939. * @example
  13940. *
  13941. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13942. * return key + value;
  13943. * });
  13944. * // => { 'a1': 1, 'b2': 2 }
  13945. */
  13946. function mapKeys(object, iteratee) {
  13947. var result = {};
  13948. iteratee = getIteratee(iteratee, 3);
  13949. baseForOwn(object, function(value, key, object) {
  13950. baseAssignValue(result, iteratee(value, key, object), value);
  13951. });
  13952. return result;
  13953. }
  13954. /**
  13955. * Creates an object with the same keys as `object` and values generated
  13956. * by running each own enumerable string keyed property of `object` thru
  13957. * `iteratee`. The iteratee is invoked with three arguments:
  13958. * (value, key, object).
  13959. *
  13960. * @static
  13961. * @memberOf _
  13962. * @since 2.4.0
  13963. * @category Object
  13964. * @param {Object} object The object to iterate over.
  13965. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13966. * @returns {Object} Returns the new mapped object.
  13967. * @see _.mapKeys
  13968. * @example
  13969. *
  13970. * var users = {
  13971. * 'fred': { 'user': 'fred', 'age': 40 },
  13972. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13973. * };
  13974. *
  13975. * _.mapValues(users, function(o) { return o.age; });
  13976. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13977. *
  13978. * // The `_.property` iteratee shorthand.
  13979. * _.mapValues(users, 'age');
  13980. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13981. */
  13982. function mapValues(object, iteratee) {
  13983. var result = {};
  13984. iteratee = getIteratee(iteratee, 3);
  13985. baseForOwn(object, function(value, key, object) {
  13986. baseAssignValue(result, key, iteratee(value, key, object));
  13987. });
  13988. return result;
  13989. }
  13990. /**
  13991. * This method is like `_.assign` except that it recursively merges own and
  13992. * inherited enumerable string keyed properties of source objects into the
  13993. * destination object. Source properties that resolve to `undefined` are
  13994. * skipped if a destination value exists. Array and plain object properties
  13995. * are merged recursively. Other objects and value types are overridden by
  13996. * assignment. Source objects are applied from left to right. Subsequent
  13997. * sources overwrite property assignments of previous sources.
  13998. *
  13999. * **Note:** This method mutates `object`.
  14000. *
  14001. * @static
  14002. * @memberOf _
  14003. * @since 0.5.0
  14004. * @category Object
  14005. * @param {Object} object The destination object.
  14006. * @param {...Object} [sources] The source objects.
  14007. * @returns {Object} Returns `object`.
  14008. * @example
  14009. *
  14010. * var object = {
  14011. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  14012. * };
  14013. *
  14014. * var other = {
  14015. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  14016. * };
  14017. *
  14018. * _.merge(object, other);
  14019. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  14020. */
  14021. var merge = createAssigner(function(object, source, srcIndex) {
  14022. baseMerge(object, source, srcIndex);
  14023. });
  14024. /**
  14025. * This method is like `_.merge` except that it accepts `customizer` which
  14026. * is invoked to produce the merged values of the destination and source
  14027. * properties. If `customizer` returns `undefined`, merging is handled by the
  14028. * method instead. The `customizer` is invoked with six arguments:
  14029. * (objValue, srcValue, key, object, source, stack).
  14030. *
  14031. * **Note:** This method mutates `object`.
  14032. *
  14033. * @static
  14034. * @memberOf _
  14035. * @since 4.0.0
  14036. * @category Object
  14037. * @param {Object} object The destination object.
  14038. * @param {...Object} sources The source objects.
  14039. * @param {Function} customizer The function to customize assigned values.
  14040. * @returns {Object} Returns `object`.
  14041. * @example
  14042. *
  14043. * function customizer(objValue, srcValue) {
  14044. * if (_.isArray(objValue)) {
  14045. * return objValue.concat(srcValue);
  14046. * }
  14047. * }
  14048. *
  14049. * var object = { 'a': [1], 'b': [2] };
  14050. * var other = { 'a': [3], 'b': [4] };
  14051. *
  14052. * _.mergeWith(object, other, customizer);
  14053. * // => { 'a': [1, 3], 'b': [2, 4] }
  14054. */
  14055. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14056. baseMerge(object, source, srcIndex, customizer);
  14057. });
  14058. /**
  14059. * The opposite of `_.pick`; this method creates an object composed of the
  14060. * own and inherited enumerable property paths of `object` that are not omitted.
  14061. *
  14062. * **Note:** This method is considerably slower than `_.pick`.
  14063. *
  14064. * @static
  14065. * @since 0.1.0
  14066. * @memberOf _
  14067. * @category Object
  14068. * @param {Object} object The source object.
  14069. * @param {...(string|string[])} [paths] The property paths to omit.
  14070. * @returns {Object} Returns the new object.
  14071. * @example
  14072. *
  14073. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14074. *
  14075. * _.omit(object, ['a', 'c']);
  14076. * // => { 'b': '2' }
  14077. */
  14078. var omit = flatRest(function(object, paths) {
  14079. var result = {};
  14080. if (object == null) {
  14081. return result;
  14082. }
  14083. var isDeep = false;
  14084. paths = arrayMap(paths, function(path) {
  14085. path = castPath(path, object);
  14086. isDeep || (isDeep = path.length > 1);
  14087. return path;
  14088. });
  14089. copyObject(object, getAllKeysIn(object), result);
  14090. if (isDeep) {
  14091. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14092. }
  14093. var length = paths.length;
  14094. while (length--) {
  14095. baseUnset(result, paths[length]);
  14096. }
  14097. return result;
  14098. });
  14099. /**
  14100. * The opposite of `_.pickBy`; this method creates an object composed of
  14101. * the own and inherited enumerable string keyed properties of `object` that
  14102. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14103. * arguments: (value, key).
  14104. *
  14105. * @static
  14106. * @memberOf _
  14107. * @since 4.0.0
  14108. * @category Object
  14109. * @param {Object} object The source object.
  14110. * @param {Function} [predicate=_.identity] The function invoked per property.
  14111. * @returns {Object} Returns the new object.
  14112. * @example
  14113. *
  14114. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14115. *
  14116. * _.omitBy(object, _.isNumber);
  14117. * // => { 'b': '2' }
  14118. */
  14119. function omitBy(object, predicate) {
  14120. return pickBy(object, negate(getIteratee(predicate)));
  14121. }
  14122. /**
  14123. * Creates an object composed of the picked `object` properties.
  14124. *
  14125. * @static
  14126. * @since 0.1.0
  14127. * @memberOf _
  14128. * @category Object
  14129. * @param {Object} object The source object.
  14130. * @param {...(string|string[])} [paths] The property paths to pick.
  14131. * @returns {Object} Returns the new object.
  14132. * @example
  14133. *
  14134. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14135. *
  14136. * _.pick(object, ['a', 'c']);
  14137. * // => { 'a': 1, 'c': 3 }
  14138. */
  14139. var pick = flatRest(function(object, paths) {
  14140. return object == null ? {} : basePick(object, paths);
  14141. });
  14142. /**
  14143. * Creates an object composed of the `object` properties `predicate` returns
  14144. * truthy for. The predicate is invoked with two arguments: (value, key).
  14145. *
  14146. * @static
  14147. * @memberOf _
  14148. * @since 4.0.0
  14149. * @category Object
  14150. * @param {Object} object The source object.
  14151. * @param {Function} [predicate=_.identity] The function invoked per property.
  14152. * @returns {Object} Returns the new object.
  14153. * @example
  14154. *
  14155. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14156. *
  14157. * _.pickBy(object, _.isNumber);
  14158. * // => { 'a': 1, 'c': 3 }
  14159. */
  14160. function pickBy(object, predicate) {
  14161. if (object == null) {
  14162. return {};
  14163. }
  14164. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14165. return [prop];
  14166. });
  14167. predicate = getIteratee(predicate);
  14168. return basePickBy(object, props, function(value, path) {
  14169. return predicate(value, path[0]);
  14170. });
  14171. }
  14172. /**
  14173. * This method is like `_.get` except that if the resolved value is a
  14174. * function it's invoked with the `this` binding of its parent object and
  14175. * its result is returned.
  14176. *
  14177. * @static
  14178. * @since 0.1.0
  14179. * @memberOf _
  14180. * @category Object
  14181. * @param {Object} object The object to query.
  14182. * @param {Array|string} path The path of the property to resolve.
  14183. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14184. * @returns {*} Returns the resolved value.
  14185. * @example
  14186. *
  14187. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14188. *
  14189. * _.result(object, 'a[0].b.c1');
  14190. * // => 3
  14191. *
  14192. * _.result(object, 'a[0].b.c2');
  14193. * // => 4
  14194. *
  14195. * _.result(object, 'a[0].b.c3', 'default');
  14196. * // => 'default'
  14197. *
  14198. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14199. * // => 'default'
  14200. */
  14201. function result(object, path, defaultValue) {
  14202. path = castPath(path, object);
  14203. var index = -1,
  14204. length = path.length;
  14205. // Ensure the loop is entered when path is empty.
  14206. if (!length) {
  14207. length = 1;
  14208. object = undefined;
  14209. }
  14210. while (++index < length) {
  14211. var value = object == null ? undefined : object[toKey(path[index])];
  14212. if (value === undefined) {
  14213. index = length;
  14214. value = defaultValue;
  14215. }
  14216. object = isFunction(value) ? value.call(object) : value;
  14217. }
  14218. return object;
  14219. }
  14220. /**
  14221. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14222. * it's created. Arrays are created for missing index properties while objects
  14223. * are created for all other missing properties. Use `_.setWith` to customize
  14224. * `path` creation.
  14225. *
  14226. * **Note:** This method mutates `object`.
  14227. *
  14228. * @static
  14229. * @memberOf _
  14230. * @since 3.7.0
  14231. * @category Object
  14232. * @param {Object} object The object to modify.
  14233. * @param {Array|string} path The path of the property to set.
  14234. * @param {*} value The value to set.
  14235. * @returns {Object} Returns `object`.
  14236. * @example
  14237. *
  14238. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14239. *
  14240. * _.set(object, 'a[0].b.c', 4);
  14241. * console.log(object.a[0].b.c);
  14242. * // => 4
  14243. *
  14244. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14245. * console.log(object.x[0].y.z);
  14246. * // => 5
  14247. */
  14248. function set(object, path, value) {
  14249. return object == null ? object : baseSet(object, path, value);
  14250. }
  14251. /**
  14252. * This method is like `_.set` except that it accepts `customizer` which is
  14253. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14254. * path creation is handled by the method instead. The `customizer` is invoked
  14255. * with three arguments: (nsValue, key, nsObject).
  14256. *
  14257. * **Note:** This method mutates `object`.
  14258. *
  14259. * @static
  14260. * @memberOf _
  14261. * @since 4.0.0
  14262. * @category Object
  14263. * @param {Object} object The object to modify.
  14264. * @param {Array|string} path The path of the property to set.
  14265. * @param {*} value The value to set.
  14266. * @param {Function} [customizer] The function to customize assigned values.
  14267. * @returns {Object} Returns `object`.
  14268. * @example
  14269. *
  14270. * var object = {};
  14271. *
  14272. * _.setWith(object, '[0][1]', 'a', Object);
  14273. * // => { '0': { '1': 'a' } }
  14274. */
  14275. function setWith(object, path, value, customizer) {
  14276. customizer = typeof customizer == 'function' ? customizer : undefined;
  14277. return object == null ? object : baseSet(object, path, value, customizer);
  14278. }
  14279. /**
  14280. * Creates an array of own enumerable string keyed-value pairs for `object`
  14281. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14282. * entries are returned.
  14283. *
  14284. * @static
  14285. * @memberOf _
  14286. * @since 4.0.0
  14287. * @alias entries
  14288. * @category Object
  14289. * @param {Object} object The object to query.
  14290. * @returns {Array} Returns the key-value pairs.
  14291. * @example
  14292. *
  14293. * function Foo() {
  14294. * this.a = 1;
  14295. * this.b = 2;
  14296. * }
  14297. *
  14298. * Foo.prototype.c = 3;
  14299. *
  14300. * _.toPairs(new Foo);
  14301. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14302. */
  14303. var toPairs = createToPairs(keys);
  14304. /**
  14305. * Creates an array of own and inherited enumerable string keyed-value pairs
  14306. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14307. * or set, its entries are returned.
  14308. *
  14309. * @static
  14310. * @memberOf _
  14311. * @since 4.0.0
  14312. * @alias entriesIn
  14313. * @category Object
  14314. * @param {Object} object The object to query.
  14315. * @returns {Array} Returns the key-value pairs.
  14316. * @example
  14317. *
  14318. * function Foo() {
  14319. * this.a = 1;
  14320. * this.b = 2;
  14321. * }
  14322. *
  14323. * Foo.prototype.c = 3;
  14324. *
  14325. * _.toPairsIn(new Foo);
  14326. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14327. */
  14328. var toPairsIn = createToPairs(keysIn);
  14329. /**
  14330. * An alternative to `_.reduce`; this method transforms `object` to a new
  14331. * `accumulator` object which is the result of running each of its own
  14332. * enumerable string keyed properties thru `iteratee`, with each invocation
  14333. * potentially mutating the `accumulator` object. If `accumulator` is not
  14334. * provided, a new object with the same `[[Prototype]]` will be used. The
  14335. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14336. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14337. *
  14338. * @static
  14339. * @memberOf _
  14340. * @since 1.3.0
  14341. * @category Object
  14342. * @param {Object} object The object to iterate over.
  14343. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14344. * @param {*} [accumulator] The custom accumulator value.
  14345. * @returns {*} Returns the accumulated value.
  14346. * @example
  14347. *
  14348. * _.transform([2, 3, 4], function(result, n) {
  14349. * result.push(n *= n);
  14350. * return n % 2 == 0;
  14351. * }, []);
  14352. * // => [4, 9]
  14353. *
  14354. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14355. * (result[value] || (result[value] = [])).push(key);
  14356. * }, {});
  14357. * // => { '1': ['a', 'c'], '2': ['b'] }
  14358. */
  14359. function transform(object, iteratee, accumulator) {
  14360. var isArr = isArray(object),
  14361. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14362. iteratee = getIteratee(iteratee, 4);
  14363. if (accumulator == null) {
  14364. var Ctor = object && object.constructor;
  14365. if (isArrLike) {
  14366. accumulator = isArr ? new Ctor : [];
  14367. }
  14368. else if (isObject(object)) {
  14369. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14370. }
  14371. else {
  14372. accumulator = {};
  14373. }
  14374. }
  14375. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14376. return iteratee(accumulator, value, index, object);
  14377. });
  14378. return accumulator;
  14379. }
  14380. /**
  14381. * Removes the property at `path` of `object`.
  14382. *
  14383. * **Note:** This method mutates `object`.
  14384. *
  14385. * @static
  14386. * @memberOf _
  14387. * @since 4.0.0
  14388. * @category Object
  14389. * @param {Object} object The object to modify.
  14390. * @param {Array|string} path The path of the property to unset.
  14391. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14392. * @example
  14393. *
  14394. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14395. * _.unset(object, 'a[0].b.c');
  14396. * // => true
  14397. *
  14398. * console.log(object);
  14399. * // => { 'a': [{ 'b': {} }] };
  14400. *
  14401. * _.unset(object, ['a', '0', 'b', 'c']);
  14402. * // => true
  14403. *
  14404. * console.log(object);
  14405. * // => { 'a': [{ 'b': {} }] };
  14406. */
  14407. function unset(object, path) {
  14408. return object == null ? true : baseUnset(object, path);
  14409. }
  14410. /**
  14411. * This method is like `_.set` except that accepts `updater` to produce the
  14412. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14413. * is invoked with one argument: (value).
  14414. *
  14415. * **Note:** This method mutates `object`.
  14416. *
  14417. * @static
  14418. * @memberOf _
  14419. * @since 4.6.0
  14420. * @category Object
  14421. * @param {Object} object The object to modify.
  14422. * @param {Array|string} path The path of the property to set.
  14423. * @param {Function} updater The function to produce the updated value.
  14424. * @returns {Object} Returns `object`.
  14425. * @example
  14426. *
  14427. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14428. *
  14429. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14430. * console.log(object.a[0].b.c);
  14431. * // => 9
  14432. *
  14433. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14434. * console.log(object.x[0].y.z);
  14435. * // => 0
  14436. */
  14437. function update(object, path, updater) {
  14438. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14439. }
  14440. /**
  14441. * This method is like `_.update` except that it accepts `customizer` which is
  14442. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14443. * path creation is handled by the method instead. The `customizer` is invoked
  14444. * with three arguments: (nsValue, key, nsObject).
  14445. *
  14446. * **Note:** This method mutates `object`.
  14447. *
  14448. * @static
  14449. * @memberOf _
  14450. * @since 4.6.0
  14451. * @category Object
  14452. * @param {Object} object The object to modify.
  14453. * @param {Array|string} path The path of the property to set.
  14454. * @param {Function} updater The function to produce the updated value.
  14455. * @param {Function} [customizer] The function to customize assigned values.
  14456. * @returns {Object} Returns `object`.
  14457. * @example
  14458. *
  14459. * var object = {};
  14460. *
  14461. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14462. * // => { '0': { '1': 'a' } }
  14463. */
  14464. function updateWith(object, path, updater, customizer) {
  14465. customizer = typeof customizer == 'function' ? customizer : undefined;
  14466. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14467. }
  14468. /**
  14469. * Creates an array of the own enumerable string keyed property values of `object`.
  14470. *
  14471. * **Note:** Non-object values are coerced to objects.
  14472. *
  14473. * @static
  14474. * @since 0.1.0
  14475. * @memberOf _
  14476. * @category Object
  14477. * @param {Object} object The object to query.
  14478. * @returns {Array} Returns the array of property values.
  14479. * @example
  14480. *
  14481. * function Foo() {
  14482. * this.a = 1;
  14483. * this.b = 2;
  14484. * }
  14485. *
  14486. * Foo.prototype.c = 3;
  14487. *
  14488. * _.values(new Foo);
  14489. * // => [1, 2] (iteration order is not guaranteed)
  14490. *
  14491. * _.values('hi');
  14492. * // => ['h', 'i']
  14493. */
  14494. function values(object) {
  14495. return object == null ? [] : baseValues(object, keys(object));
  14496. }
  14497. /**
  14498. * Creates an array of the own and inherited enumerable string keyed property
  14499. * values of `object`.
  14500. *
  14501. * **Note:** Non-object values are coerced to objects.
  14502. *
  14503. * @static
  14504. * @memberOf _
  14505. * @since 3.0.0
  14506. * @category Object
  14507. * @param {Object} object The object to query.
  14508. * @returns {Array} Returns the array of property values.
  14509. * @example
  14510. *
  14511. * function Foo() {
  14512. * this.a = 1;
  14513. * this.b = 2;
  14514. * }
  14515. *
  14516. * Foo.prototype.c = 3;
  14517. *
  14518. * _.valuesIn(new Foo);
  14519. * // => [1, 2, 3] (iteration order is not guaranteed)
  14520. */
  14521. function valuesIn(object) {
  14522. return object == null ? [] : baseValues(object, keysIn(object));
  14523. }
  14524. /*------------------------------------------------------------------------*/
  14525. /**
  14526. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14527. *
  14528. * @static
  14529. * @memberOf _
  14530. * @since 4.0.0
  14531. * @category Number
  14532. * @param {number} number The number to clamp.
  14533. * @param {number} [lower] The lower bound.
  14534. * @param {number} upper The upper bound.
  14535. * @returns {number} Returns the clamped number.
  14536. * @example
  14537. *
  14538. * _.clamp(-10, -5, 5);
  14539. * // => -5
  14540. *
  14541. * _.clamp(10, -5, 5);
  14542. * // => 5
  14543. */
  14544. function clamp(number, lower, upper) {
  14545. if (upper === undefined) {
  14546. upper = lower;
  14547. lower = undefined;
  14548. }
  14549. if (upper !== undefined) {
  14550. upper = toNumber(upper);
  14551. upper = upper === upper ? upper : 0;
  14552. }
  14553. if (lower !== undefined) {
  14554. lower = toNumber(lower);
  14555. lower = lower === lower ? lower : 0;
  14556. }
  14557. return baseClamp(toNumber(number), lower, upper);
  14558. }
  14559. /**
  14560. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14561. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14562. * If `start` is greater than `end` the params are swapped to support
  14563. * negative ranges.
  14564. *
  14565. * @static
  14566. * @memberOf _
  14567. * @since 3.3.0
  14568. * @category Number
  14569. * @param {number} number The number to check.
  14570. * @param {number} [start=0] The start of the range.
  14571. * @param {number} end The end of the range.
  14572. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14573. * @see _.range, _.rangeRight
  14574. * @example
  14575. *
  14576. * _.inRange(3, 2, 4);
  14577. * // => true
  14578. *
  14579. * _.inRange(4, 8);
  14580. * // => true
  14581. *
  14582. * _.inRange(4, 2);
  14583. * // => false
  14584. *
  14585. * _.inRange(2, 2);
  14586. * // => false
  14587. *
  14588. * _.inRange(1.2, 2);
  14589. * // => true
  14590. *
  14591. * _.inRange(5.2, 4);
  14592. * // => false
  14593. *
  14594. * _.inRange(-3, -2, -6);
  14595. * // => true
  14596. */
  14597. function inRange(number, start, end) {
  14598. start = toFinite(start);
  14599. if (end === undefined) {
  14600. end = start;
  14601. start = 0;
  14602. } else {
  14603. end = toFinite(end);
  14604. }
  14605. number = toNumber(number);
  14606. return baseInRange(number, start, end);
  14607. }
  14608. /**
  14609. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14610. * If only one argument is provided a number between `0` and the given number
  14611. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14612. * floats, a floating-point number is returned instead of an integer.
  14613. *
  14614. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14615. * floating-point values which can produce unexpected results.
  14616. *
  14617. * @static
  14618. * @memberOf _
  14619. * @since 0.7.0
  14620. * @category Number
  14621. * @param {number} [lower=0] The lower bound.
  14622. * @param {number} [upper=1] The upper bound.
  14623. * @param {boolean} [floating] Specify returning a floating-point number.
  14624. * @returns {number} Returns the random number.
  14625. * @example
  14626. *
  14627. * _.random(0, 5);
  14628. * // => an integer between 0 and 5
  14629. *
  14630. * _.random(5);
  14631. * // => also an integer between 0 and 5
  14632. *
  14633. * _.random(5, true);
  14634. * // => a floating-point number between 0 and 5
  14635. *
  14636. * _.random(1.2, 5.2);
  14637. * // => a floating-point number between 1.2 and 5.2
  14638. */
  14639. function random(lower, upper, floating) {
  14640. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14641. upper = floating = undefined;
  14642. }
  14643. if (floating === undefined) {
  14644. if (typeof upper == 'boolean') {
  14645. floating = upper;
  14646. upper = undefined;
  14647. }
  14648. else if (typeof lower == 'boolean') {
  14649. floating = lower;
  14650. lower = undefined;
  14651. }
  14652. }
  14653. if (lower === undefined && upper === undefined) {
  14654. lower = 0;
  14655. upper = 1;
  14656. }
  14657. else {
  14658. lower = toFinite(lower);
  14659. if (upper === undefined) {
  14660. upper = lower;
  14661. lower = 0;
  14662. } else {
  14663. upper = toFinite(upper);
  14664. }
  14665. }
  14666. if (lower > upper) {
  14667. var temp = lower;
  14668. lower = upper;
  14669. upper = temp;
  14670. }
  14671. if (floating || lower % 1 || upper % 1) {
  14672. var rand = nativeRandom();
  14673. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14674. }
  14675. return baseRandom(lower, upper);
  14676. }
  14677. /*------------------------------------------------------------------------*/
  14678. /**
  14679. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  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 camel cased string.
  14687. * @example
  14688. *
  14689. * _.camelCase('Foo Bar');
  14690. * // => 'fooBar'
  14691. *
  14692. * _.camelCase('--foo-bar--');
  14693. * // => 'fooBar'
  14694. *
  14695. * _.camelCase('__FOO_BAR__');
  14696. * // => 'fooBar'
  14697. */
  14698. var camelCase = createCompounder(function(result, word, index) {
  14699. word = word.toLowerCase();
  14700. return result + (index ? capitalize(word) : word);
  14701. });
  14702. /**
  14703. * Converts the first character of `string` to upper case and the remaining
  14704. * to lower case.
  14705. *
  14706. * @static
  14707. * @memberOf _
  14708. * @since 3.0.0
  14709. * @category String
  14710. * @param {string} [string=''] The string to capitalize.
  14711. * @returns {string} Returns the capitalized string.
  14712. * @example
  14713. *
  14714. * _.capitalize('FRED');
  14715. * // => 'Fred'
  14716. */
  14717. function capitalize(string) {
  14718. return upperFirst(toString(string).toLowerCase());
  14719. }
  14720. /**
  14721. * Deburrs `string` by converting
  14722. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14723. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14724. * letters to basic Latin letters and removing
  14725. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14726. *
  14727. * @static
  14728. * @memberOf _
  14729. * @since 3.0.0
  14730. * @category String
  14731. * @param {string} [string=''] The string to deburr.
  14732. * @returns {string} Returns the deburred string.
  14733. * @example
  14734. *
  14735. * _.deburr('déjà vu');
  14736. * // => 'deja vu'
  14737. */
  14738. function deburr(string) {
  14739. string = toString(string);
  14740. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14741. }
  14742. /**
  14743. * Checks if `string` ends with the given target string.
  14744. *
  14745. * @static
  14746. * @memberOf _
  14747. * @since 3.0.0
  14748. * @category String
  14749. * @param {string} [string=''] The string to inspect.
  14750. * @param {string} [target] The string to search for.
  14751. * @param {number} [position=string.length] The position to search up to.
  14752. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14753. * else `false`.
  14754. * @example
  14755. *
  14756. * _.endsWith('abc', 'c');
  14757. * // => true
  14758. *
  14759. * _.endsWith('abc', 'b');
  14760. * // => false
  14761. *
  14762. * _.endsWith('abc', 'b', 2);
  14763. * // => true
  14764. */
  14765. function endsWith(string, target, position) {
  14766. string = toString(string);
  14767. target = baseToString(target);
  14768. var length = string.length;
  14769. position = position === undefined
  14770. ? length
  14771. : baseClamp(toInteger(position), 0, length);
  14772. var end = position;
  14773. position -= target.length;
  14774. return position >= 0 && string.slice(position, end) == target;
  14775. }
  14776. /**
  14777. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14778. * corresponding HTML entities.
  14779. *
  14780. * **Note:** No other characters are escaped. To escape additional
  14781. * characters use a third-party library like [_he_](https://mths.be/he).
  14782. *
  14783. * Though the ">" character is escaped for symmetry, characters like
  14784. * ">" and "/" don't need escaping in HTML and have no special meaning
  14785. * unless they're part of a tag or unquoted attribute value. See
  14786. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14787. * (under "semi-related fun fact") for more details.
  14788. *
  14789. * When working with HTML you should always
  14790. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14791. * XSS vectors.
  14792. *
  14793. * @static
  14794. * @since 0.1.0
  14795. * @memberOf _
  14796. * @category String
  14797. * @param {string} [string=''] The string to escape.
  14798. * @returns {string} Returns the escaped string.
  14799. * @example
  14800. *
  14801. * _.escape('fred, barney, & pebbles');
  14802. * // => 'fred, barney, &amp; pebbles'
  14803. */
  14804. function escape(string) {
  14805. string = toString(string);
  14806. return (string && reHasUnescapedHtml.test(string))
  14807. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14808. : string;
  14809. }
  14810. /**
  14811. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14812. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14813. *
  14814. * @static
  14815. * @memberOf _
  14816. * @since 3.0.0
  14817. * @category String
  14818. * @param {string} [string=''] The string to escape.
  14819. * @returns {string} Returns the escaped string.
  14820. * @example
  14821. *
  14822. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14823. * // => '\[lodash\]\(https://lodash\.com/\)'
  14824. */
  14825. function escapeRegExp(string) {
  14826. string = toString(string);
  14827. return (string && reHasRegExpChar.test(string))
  14828. ? string.replace(reRegExpChar, '\\$&')
  14829. : string;
  14830. }
  14831. /**
  14832. * Converts `string` to
  14833. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14834. *
  14835. * @static
  14836. * @memberOf _
  14837. * @since 3.0.0
  14838. * @category String
  14839. * @param {string} [string=''] The string to convert.
  14840. * @returns {string} Returns the kebab cased string.
  14841. * @example
  14842. *
  14843. * _.kebabCase('Foo Bar');
  14844. * // => 'foo-bar'
  14845. *
  14846. * _.kebabCase('fooBar');
  14847. * // => 'foo-bar'
  14848. *
  14849. * _.kebabCase('__FOO_BAR__');
  14850. * // => 'foo-bar'
  14851. */
  14852. var kebabCase = createCompounder(function(result, word, index) {
  14853. return result + (index ? '-' : '') + word.toLowerCase();
  14854. });
  14855. /**
  14856. * Converts `string`, as space separated words, to lower case.
  14857. *
  14858. * @static
  14859. * @memberOf _
  14860. * @since 4.0.0
  14861. * @category String
  14862. * @param {string} [string=''] The string to convert.
  14863. * @returns {string} Returns the lower cased string.
  14864. * @example
  14865. *
  14866. * _.lowerCase('--Foo-Bar--');
  14867. * // => 'foo bar'
  14868. *
  14869. * _.lowerCase('fooBar');
  14870. * // => 'foo bar'
  14871. *
  14872. * _.lowerCase('__FOO_BAR__');
  14873. * // => 'foo bar'
  14874. */
  14875. var lowerCase = createCompounder(function(result, word, index) {
  14876. return result + (index ? ' ' : '') + word.toLowerCase();
  14877. });
  14878. /**
  14879. * Converts the first character of `string` to lower case.
  14880. *
  14881. * @static
  14882. * @memberOf _
  14883. * @since 4.0.0
  14884. * @category String
  14885. * @param {string} [string=''] The string to convert.
  14886. * @returns {string} Returns the converted string.
  14887. * @example
  14888. *
  14889. * _.lowerFirst('Fred');
  14890. * // => 'fred'
  14891. *
  14892. * _.lowerFirst('FRED');
  14893. * // => 'fRED'
  14894. */
  14895. var lowerFirst = createCaseFirst('toLowerCase');
  14896. /**
  14897. * Pads `string` on the left and right sides if it's shorter than `length`.
  14898. * Padding characters are truncated if they can't be evenly divided by `length`.
  14899. *
  14900. * @static
  14901. * @memberOf _
  14902. * @since 3.0.0
  14903. * @category String
  14904. * @param {string} [string=''] The string to pad.
  14905. * @param {number} [length=0] The padding length.
  14906. * @param {string} [chars=' '] The string used as padding.
  14907. * @returns {string} Returns the padded string.
  14908. * @example
  14909. *
  14910. * _.pad('abc', 8);
  14911. * // => ' abc '
  14912. *
  14913. * _.pad('abc', 8, '_-');
  14914. * // => '_-abc_-_'
  14915. *
  14916. * _.pad('abc', 3);
  14917. * // => 'abc'
  14918. */
  14919. function pad(string, length, chars) {
  14920. string = toString(string);
  14921. length = toInteger(length);
  14922. var strLength = length ? stringSize(string) : 0;
  14923. if (!length || strLength >= length) {
  14924. return string;
  14925. }
  14926. var mid = (length - strLength) / 2;
  14927. return (
  14928. createPadding(nativeFloor(mid), chars) +
  14929. string +
  14930. createPadding(nativeCeil(mid), chars)
  14931. );
  14932. }
  14933. /**
  14934. * Pads `string` on the right side if it's shorter than `length`. Padding
  14935. * characters are truncated if they exceed `length`.
  14936. *
  14937. * @static
  14938. * @memberOf _
  14939. * @since 4.0.0
  14940. * @category String
  14941. * @param {string} [string=''] The string to pad.
  14942. * @param {number} [length=0] The padding length.
  14943. * @param {string} [chars=' '] The string used as padding.
  14944. * @returns {string} Returns the padded string.
  14945. * @example
  14946. *
  14947. * _.padEnd('abc', 6);
  14948. * // => 'abc '
  14949. *
  14950. * _.padEnd('abc', 6, '_-');
  14951. * // => 'abc_-_'
  14952. *
  14953. * _.padEnd('abc', 3);
  14954. * // => 'abc'
  14955. */
  14956. function padEnd(string, length, chars) {
  14957. string = toString(string);
  14958. length = toInteger(length);
  14959. var strLength = length ? stringSize(string) : 0;
  14960. return (length && strLength < length)
  14961. ? (string + createPadding(length - strLength, chars))
  14962. : string;
  14963. }
  14964. /**
  14965. * Pads `string` on the left side if it's shorter than `length`. Padding
  14966. * characters are truncated if they exceed `length`.
  14967. *
  14968. * @static
  14969. * @memberOf _
  14970. * @since 4.0.0
  14971. * @category String
  14972. * @param {string} [string=''] The string to pad.
  14973. * @param {number} [length=0] The padding length.
  14974. * @param {string} [chars=' '] The string used as padding.
  14975. * @returns {string} Returns the padded string.
  14976. * @example
  14977. *
  14978. * _.padStart('abc', 6);
  14979. * // => ' abc'
  14980. *
  14981. * _.padStart('abc', 6, '_-');
  14982. * // => '_-_abc'
  14983. *
  14984. * _.padStart('abc', 3);
  14985. * // => 'abc'
  14986. */
  14987. function padStart(string, length, chars) {
  14988. string = toString(string);
  14989. length = toInteger(length);
  14990. var strLength = length ? stringSize(string) : 0;
  14991. return (length && strLength < length)
  14992. ? (createPadding(length - strLength, chars) + string)
  14993. : string;
  14994. }
  14995. /**
  14996. * Converts `string` to an integer of the specified radix. If `radix` is
  14997. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14998. * hexadecimal, in which case a `radix` of `16` is used.
  14999. *
  15000. * **Note:** This method aligns with the
  15001. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  15002. *
  15003. * @static
  15004. * @memberOf _
  15005. * @since 1.1.0
  15006. * @category String
  15007. * @param {string} string The string to convert.
  15008. * @param {number} [radix=10] The radix to interpret `value` by.
  15009. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15010. * @returns {number} Returns the converted integer.
  15011. * @example
  15012. *
  15013. * _.parseInt('08');
  15014. * // => 8
  15015. *
  15016. * _.map(['6', '08', '10'], _.parseInt);
  15017. * // => [6, 8, 10]
  15018. */
  15019. function parseInt(string, radix, guard) {
  15020. if (guard || radix == null) {
  15021. radix = 0;
  15022. } else if (radix) {
  15023. radix = +radix;
  15024. }
  15025. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  15026. }
  15027. /**
  15028. * Repeats the given string `n` times.
  15029. *
  15030. * @static
  15031. * @memberOf _
  15032. * @since 3.0.0
  15033. * @category String
  15034. * @param {string} [string=''] The string to repeat.
  15035. * @param {number} [n=1] The number of times to repeat the string.
  15036. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15037. * @returns {string} Returns the repeated string.
  15038. * @example
  15039. *
  15040. * _.repeat('*', 3);
  15041. * // => '***'
  15042. *
  15043. * _.repeat('abc', 2);
  15044. * // => 'abcabc'
  15045. *
  15046. * _.repeat('abc', 0);
  15047. * // => ''
  15048. */
  15049. function repeat(string, n, guard) {
  15050. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  15051. n = 1;
  15052. } else {
  15053. n = toInteger(n);
  15054. }
  15055. return baseRepeat(toString(string), n);
  15056. }
  15057. /**
  15058. * Replaces matches for `pattern` in `string` with `replacement`.
  15059. *
  15060. * **Note:** This method is based on
  15061. * [`String#replace`](https://mdn.io/String/replace).
  15062. *
  15063. * @static
  15064. * @memberOf _
  15065. * @since 4.0.0
  15066. * @category String
  15067. * @param {string} [string=''] The string to modify.
  15068. * @param {RegExp|string} pattern The pattern to replace.
  15069. * @param {Function|string} replacement The match replacement.
  15070. * @returns {string} Returns the modified string.
  15071. * @example
  15072. *
  15073. * _.replace('Hi Fred', 'Fred', 'Barney');
  15074. * // => 'Hi Barney'
  15075. */
  15076. function replace() {
  15077. var args = arguments,
  15078. string = toString(args[0]);
  15079. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15080. }
  15081. /**
  15082. * Converts `string` to
  15083. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15084. *
  15085. * @static
  15086. * @memberOf _
  15087. * @since 3.0.0
  15088. * @category String
  15089. * @param {string} [string=''] The string to convert.
  15090. * @returns {string} Returns the snake cased string.
  15091. * @example
  15092. *
  15093. * _.snakeCase('Foo Bar');
  15094. * // => 'foo_bar'
  15095. *
  15096. * _.snakeCase('fooBar');
  15097. * // => 'foo_bar'
  15098. *
  15099. * _.snakeCase('--FOO-BAR--');
  15100. * // => 'foo_bar'
  15101. */
  15102. var snakeCase = createCompounder(function(result, word, index) {
  15103. return result + (index ? '_' : '') + word.toLowerCase();
  15104. });
  15105. /**
  15106. * Splits `string` by `separator`.
  15107. *
  15108. * **Note:** This method is based on
  15109. * [`String#split`](https://mdn.io/String/split).
  15110. *
  15111. * @static
  15112. * @memberOf _
  15113. * @since 4.0.0
  15114. * @category String
  15115. * @param {string} [string=''] The string to split.
  15116. * @param {RegExp|string} separator The separator pattern to split by.
  15117. * @param {number} [limit] The length to truncate results to.
  15118. * @returns {Array} Returns the string segments.
  15119. * @example
  15120. *
  15121. * _.split('a-b-c', '-', 2);
  15122. * // => ['a', 'b']
  15123. */
  15124. function split(string, separator, limit) {
  15125. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15126. separator = limit = undefined;
  15127. }
  15128. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15129. if (!limit) {
  15130. return [];
  15131. }
  15132. string = toString(string);
  15133. if (string && (
  15134. typeof separator == 'string' ||
  15135. (separator != null && !isRegExp(separator))
  15136. )) {
  15137. separator = baseToString(separator);
  15138. if (!separator && hasUnicode(string)) {
  15139. return castSlice(stringToArray(string), 0, limit);
  15140. }
  15141. }
  15142. return string.split(separator, limit);
  15143. }
  15144. /**
  15145. * Converts `string` to
  15146. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15147. *
  15148. * @static
  15149. * @memberOf _
  15150. * @since 3.1.0
  15151. * @category String
  15152. * @param {string} [string=''] The string to convert.
  15153. * @returns {string} Returns the start cased string.
  15154. * @example
  15155. *
  15156. * _.startCase('--foo-bar--');
  15157. * // => 'Foo Bar'
  15158. *
  15159. * _.startCase('fooBar');
  15160. * // => 'Foo Bar'
  15161. *
  15162. * _.startCase('__FOO_BAR__');
  15163. * // => 'FOO BAR'
  15164. */
  15165. var startCase = createCompounder(function(result, word, index) {
  15166. return result + (index ? ' ' : '') + upperFirst(word);
  15167. });
  15168. /**
  15169. * Checks if `string` starts with the given target string.
  15170. *
  15171. * @static
  15172. * @memberOf _
  15173. * @since 3.0.0
  15174. * @category String
  15175. * @param {string} [string=''] The string to inspect.
  15176. * @param {string} [target] The string to search for.
  15177. * @param {number} [position=0] The position to search from.
  15178. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15179. * else `false`.
  15180. * @example
  15181. *
  15182. * _.startsWith('abc', 'a');
  15183. * // => true
  15184. *
  15185. * _.startsWith('abc', 'b');
  15186. * // => false
  15187. *
  15188. * _.startsWith('abc', 'b', 1);
  15189. * // => true
  15190. */
  15191. function startsWith(string, target, position) {
  15192. string = toString(string);
  15193. position = position == null
  15194. ? 0
  15195. : baseClamp(toInteger(position), 0, string.length);
  15196. target = baseToString(target);
  15197. return string.slice(position, position + target.length) == target;
  15198. }
  15199. /**
  15200. * Creates a compiled template function that can interpolate data properties
  15201. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15202. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15203. * properties may be accessed as free variables in the template. If a setting
  15204. * object is given, it takes precedence over `_.templateSettings` values.
  15205. *
  15206. * **Note:** In the development build `_.template` utilizes
  15207. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15208. * for easier debugging.
  15209. *
  15210. * For more information on precompiling templates see
  15211. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15212. *
  15213. * For more information on Chrome extension sandboxes see
  15214. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15215. *
  15216. * @static
  15217. * @since 0.1.0
  15218. * @memberOf _
  15219. * @category String
  15220. * @param {string} [string=''] The template string.
  15221. * @param {Object} [options={}] The options object.
  15222. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15223. * The HTML "escape" delimiter.
  15224. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15225. * The "evaluate" delimiter.
  15226. * @param {Object} [options.imports=_.templateSettings.imports]
  15227. * An object to import into the template as free variables.
  15228. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15229. * The "interpolate" delimiter.
  15230. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15231. * The sourceURL of the compiled template.
  15232. * @param {string} [options.variable='obj']
  15233. * The data object variable name.
  15234. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15235. * @returns {Function} Returns the compiled template function.
  15236. * @example
  15237. *
  15238. * // Use the "interpolate" delimiter to create a compiled template.
  15239. * var compiled = _.template('hello <%= user %>!');
  15240. * compiled({ 'user': 'fred' });
  15241. * // => 'hello fred!'
  15242. *
  15243. * // Use the HTML "escape" delimiter to escape data property values.
  15244. * var compiled = _.template('<b><%- value %></b>');
  15245. * compiled({ 'value': '<script>' });
  15246. * // => '<b>&lt;script&gt;</b>'
  15247. *
  15248. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15249. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15250. * compiled({ 'users': ['fred', 'barney'] });
  15251. * // => '<li>fred</li><li>barney</li>'
  15252. *
  15253. * // Use the internal `print` function in "evaluate" delimiters.
  15254. * var compiled = _.template('<% print("hello " + user); %>!');
  15255. * compiled({ 'user': 'barney' });
  15256. * // => 'hello barney!'
  15257. *
  15258. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15259. * // Disable support by replacing the "interpolate" delimiter.
  15260. * var compiled = _.template('hello ${ user }!');
  15261. * compiled({ 'user': 'pebbles' });
  15262. * // => 'hello pebbles!'
  15263. *
  15264. * // Use backslashes to treat delimiters as plain text.
  15265. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15266. * compiled({ 'value': 'ignored' });
  15267. * // => '<%- value %>'
  15268. *
  15269. * // Use the `imports` option to import `jQuery` as `jq`.
  15270. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15271. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15272. * compiled({ 'users': ['fred', 'barney'] });
  15273. * // => '<li>fred</li><li>barney</li>'
  15274. *
  15275. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15276. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15277. * compiled(data);
  15278. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15279. *
  15280. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15281. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15282. * compiled.source;
  15283. * // => function(data) {
  15284. * // var __t, __p = '';
  15285. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15286. * // return __p;
  15287. * // }
  15288. *
  15289. * // Use custom template delimiters.
  15290. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15291. * var compiled = _.template('hello {{ user }}!');
  15292. * compiled({ 'user': 'mustache' });
  15293. * // => 'hello mustache!'
  15294. *
  15295. * // Use the `source` property to inline compiled templates for meaningful
  15296. * // line numbers in error messages and stack traces.
  15297. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15298. * var JST = {\
  15299. * "main": ' + _.template(mainText).source + '\
  15300. * };\
  15301. * ');
  15302. */
  15303. function template(string, options, guard) {
  15304. // Based on John Resig's `tmpl` implementation
  15305. // (http://ejohn.org/blog/javascript-micro-templating/)
  15306. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15307. var settings = lodash.templateSettings;
  15308. if (guard && isIterateeCall(string, options, guard)) {
  15309. options = undefined;
  15310. }
  15311. string = toString(string);
  15312. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15313. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15314. importsKeys = keys(imports),
  15315. importsValues = baseValues(imports, importsKeys);
  15316. var isEscaping,
  15317. isEvaluating,
  15318. index = 0,
  15319. interpolate = options.interpolate || reNoMatch,
  15320. source = "__p += '";
  15321. // Compile the regexp to match each delimiter.
  15322. var reDelimiters = RegExp(
  15323. (options.escape || reNoMatch).source + '|' +
  15324. interpolate.source + '|' +
  15325. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15326. (options.evaluate || reNoMatch).source + '|$'
  15327. , 'g');
  15328. // Use a sourceURL for easier debugging.
  15329. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15330. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15331. // and escape the comment, thus injecting code that gets evaled.
  15332. var sourceURL = '//# sourceURL=' +
  15333. (hasOwnProperty.call(options, 'sourceURL')
  15334. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15335. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15336. ) + '\n';
  15337. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15338. interpolateValue || (interpolateValue = esTemplateValue);
  15339. // Escape characters that can't be included in string literals.
  15340. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15341. // Replace delimiters with snippets.
  15342. if (escapeValue) {
  15343. isEscaping = true;
  15344. source += "' +\n__e(" + escapeValue + ") +\n'";
  15345. }
  15346. if (evaluateValue) {
  15347. isEvaluating = true;
  15348. source += "';\n" + evaluateValue + ";\n__p += '";
  15349. }
  15350. if (interpolateValue) {
  15351. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15352. }
  15353. index = offset + match.length;
  15354. // The JS engine embedded in Adobe products needs `match` returned in
  15355. // order to produce the correct `offset` value.
  15356. return match;
  15357. });
  15358. source += "';\n";
  15359. // If `variable` is not specified wrap a with-statement around the generated
  15360. // code to add the data object to the top of the scope chain.
  15361. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15362. if (!variable) {
  15363. source = 'with (obj) {\n' + source + '\n}\n';
  15364. }
  15365. // Throw an error if a forbidden character was found in `variable`, to prevent
  15366. // potential command injection attacks.
  15367. else if (reForbiddenIdentifierChars.test(variable)) {
  15368. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15369. }
  15370. // Cleanup code by stripping empty strings.
  15371. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15372. .replace(reEmptyStringMiddle, '$1')
  15373. .replace(reEmptyStringTrailing, '$1;');
  15374. // Frame code as the function body.
  15375. source = 'function(' + (variable || 'obj') + ') {\n' +
  15376. (variable
  15377. ? ''
  15378. : 'obj || (obj = {});\n'
  15379. ) +
  15380. "var __t, __p = ''" +
  15381. (isEscaping
  15382. ? ', __e = _.escape'
  15383. : ''
  15384. ) +
  15385. (isEvaluating
  15386. ? ', __j = Array.prototype.join;\n' +
  15387. "function print() { __p += __j.call(arguments, '') }\n"
  15388. : ';\n'
  15389. ) +
  15390. source +
  15391. 'return __p\n}';
  15392. var result = attempt(function() {
  15393. return Function(importsKeys, sourceURL + 'return ' + source)
  15394. .apply(undefined, importsValues);
  15395. });
  15396. // Provide the compiled function's source by its `toString` method or
  15397. // the `source` property as a convenience for inlining compiled templates.
  15398. result.source = source;
  15399. if (isError(result)) {
  15400. throw result;
  15401. }
  15402. return result;
  15403. }
  15404. /**
  15405. * Converts `string`, as a whole, to lower case just like
  15406. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15407. *
  15408. * @static
  15409. * @memberOf _
  15410. * @since 4.0.0
  15411. * @category String
  15412. * @param {string} [string=''] The string to convert.
  15413. * @returns {string} Returns the lower cased string.
  15414. * @example
  15415. *
  15416. * _.toLower('--Foo-Bar--');
  15417. * // => '--foo-bar--'
  15418. *
  15419. * _.toLower('fooBar');
  15420. * // => 'foobar'
  15421. *
  15422. * _.toLower('__FOO_BAR__');
  15423. * // => '__foo_bar__'
  15424. */
  15425. function toLower(value) {
  15426. return toString(value).toLowerCase();
  15427. }
  15428. /**
  15429. * Converts `string`, as a whole, to upper case just like
  15430. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15431. *
  15432. * @static
  15433. * @memberOf _
  15434. * @since 4.0.0
  15435. * @category String
  15436. * @param {string} [string=''] The string to convert.
  15437. * @returns {string} Returns the upper cased string.
  15438. * @example
  15439. *
  15440. * _.toUpper('--foo-bar--');
  15441. * // => '--FOO-BAR--'
  15442. *
  15443. * _.toUpper('fooBar');
  15444. * // => 'FOOBAR'
  15445. *
  15446. * _.toUpper('__foo_bar__');
  15447. * // => '__FOO_BAR__'
  15448. */
  15449. function toUpper(value) {
  15450. return toString(value).toUpperCase();
  15451. }
  15452. /**
  15453. * Removes leading and trailing whitespace or specified characters from `string`.
  15454. *
  15455. * @static
  15456. * @memberOf _
  15457. * @since 3.0.0
  15458. * @category String
  15459. * @param {string} [string=''] The string to trim.
  15460. * @param {string} [chars=whitespace] The characters to trim.
  15461. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15462. * @returns {string} Returns the trimmed string.
  15463. * @example
  15464. *
  15465. * _.trim(' abc ');
  15466. * // => 'abc'
  15467. *
  15468. * _.trim('-_-abc-_-', '_-');
  15469. * // => 'abc'
  15470. *
  15471. * _.map([' foo ', ' bar '], _.trim);
  15472. * // => ['foo', 'bar']
  15473. */
  15474. function trim(string, chars, guard) {
  15475. string = toString(string);
  15476. if (string && (guard || chars === undefined)) {
  15477. return baseTrim(string);
  15478. }
  15479. if (!string || !(chars = baseToString(chars))) {
  15480. return string;
  15481. }
  15482. var strSymbols = stringToArray(string),
  15483. chrSymbols = stringToArray(chars),
  15484. start = charsStartIndex(strSymbols, chrSymbols),
  15485. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15486. return castSlice(strSymbols, start, end).join('');
  15487. }
  15488. /**
  15489. * Removes trailing whitespace or specified characters from `string`.
  15490. *
  15491. * @static
  15492. * @memberOf _
  15493. * @since 4.0.0
  15494. * @category String
  15495. * @param {string} [string=''] The string to trim.
  15496. * @param {string} [chars=whitespace] The characters to trim.
  15497. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15498. * @returns {string} Returns the trimmed string.
  15499. * @example
  15500. *
  15501. * _.trimEnd(' abc ');
  15502. * // => ' abc'
  15503. *
  15504. * _.trimEnd('-_-abc-_-', '_-');
  15505. * // => '-_-abc'
  15506. */
  15507. function trimEnd(string, chars, guard) {
  15508. string = toString(string);
  15509. if (string && (guard || chars === undefined)) {
  15510. return string.slice(0, trimmedEndIndex(string) + 1);
  15511. }
  15512. if (!string || !(chars = baseToString(chars))) {
  15513. return string;
  15514. }
  15515. var strSymbols = stringToArray(string),
  15516. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15517. return castSlice(strSymbols, 0, end).join('');
  15518. }
  15519. /**
  15520. * Removes leading whitespace or specified characters from `string`.
  15521. *
  15522. * @static
  15523. * @memberOf _
  15524. * @since 4.0.0
  15525. * @category String
  15526. * @param {string} [string=''] The string to trim.
  15527. * @param {string} [chars=whitespace] The characters to trim.
  15528. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15529. * @returns {string} Returns the trimmed string.
  15530. * @example
  15531. *
  15532. * _.trimStart(' abc ');
  15533. * // => 'abc '
  15534. *
  15535. * _.trimStart('-_-abc-_-', '_-');
  15536. * // => 'abc-_-'
  15537. */
  15538. function trimStart(string, chars, guard) {
  15539. string = toString(string);
  15540. if (string && (guard || chars === undefined)) {
  15541. return string.replace(reTrimStart, '');
  15542. }
  15543. if (!string || !(chars = baseToString(chars))) {
  15544. return string;
  15545. }
  15546. var strSymbols = stringToArray(string),
  15547. start = charsStartIndex(strSymbols, stringToArray(chars));
  15548. return castSlice(strSymbols, start).join('');
  15549. }
  15550. /**
  15551. * Truncates `string` if it's longer than the given maximum string length.
  15552. * The last characters of the truncated string are replaced with the omission
  15553. * string which defaults to "...".
  15554. *
  15555. * @static
  15556. * @memberOf _
  15557. * @since 4.0.0
  15558. * @category String
  15559. * @param {string} [string=''] The string to truncate.
  15560. * @param {Object} [options={}] The options object.
  15561. * @param {number} [options.length=30] The maximum string length.
  15562. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15563. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15564. * @returns {string} Returns the truncated string.
  15565. * @example
  15566. *
  15567. * _.truncate('hi-diddly-ho there, neighborino');
  15568. * // => 'hi-diddly-ho there, neighbo...'
  15569. *
  15570. * _.truncate('hi-diddly-ho there, neighborino', {
  15571. * 'length': 24,
  15572. * 'separator': ' '
  15573. * });
  15574. * // => 'hi-diddly-ho there,...'
  15575. *
  15576. * _.truncate('hi-diddly-ho there, neighborino', {
  15577. * 'length': 24,
  15578. * 'separator': /,? +/
  15579. * });
  15580. * // => 'hi-diddly-ho there...'
  15581. *
  15582. * _.truncate('hi-diddly-ho there, neighborino', {
  15583. * 'omission': ' [...]'
  15584. * });
  15585. * // => 'hi-diddly-ho there, neig [...]'
  15586. */
  15587. function truncate(string, options) {
  15588. var length = DEFAULT_TRUNC_LENGTH,
  15589. omission = DEFAULT_TRUNC_OMISSION;
  15590. if (isObject(options)) {
  15591. var separator = 'separator' in options ? options.separator : separator;
  15592. length = 'length' in options ? toInteger(options.length) : length;
  15593. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15594. }
  15595. string = toString(string);
  15596. var strLength = string.length;
  15597. if (hasUnicode(string)) {
  15598. var strSymbols = stringToArray(string);
  15599. strLength = strSymbols.length;
  15600. }
  15601. if (length >= strLength) {
  15602. return string;
  15603. }
  15604. var end = length - stringSize(omission);
  15605. if (end < 1) {
  15606. return omission;
  15607. }
  15608. var result = strSymbols
  15609. ? castSlice(strSymbols, 0, end).join('')
  15610. : string.slice(0, end);
  15611. if (separator === undefined) {
  15612. return result + omission;
  15613. }
  15614. if (strSymbols) {
  15615. end += (result.length - end);
  15616. }
  15617. if (isRegExp(separator)) {
  15618. if (string.slice(end).search(separator)) {
  15619. var match,
  15620. substring = result;
  15621. if (!separator.global) {
  15622. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15623. }
  15624. separator.lastIndex = 0;
  15625. while ((match = separator.exec(substring))) {
  15626. var newEnd = match.index;
  15627. }
  15628. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15629. }
  15630. } else if (string.indexOf(baseToString(separator), end) != end) {
  15631. var index = result.lastIndexOf(separator);
  15632. if (index > -1) {
  15633. result = result.slice(0, index);
  15634. }
  15635. }
  15636. return result + omission;
  15637. }
  15638. /**
  15639. * The inverse of `_.escape`; this method converts the HTML entities
  15640. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15641. * their corresponding characters.
  15642. *
  15643. * **Note:** No other HTML entities are unescaped. To unescape additional
  15644. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15645. *
  15646. * @static
  15647. * @memberOf _
  15648. * @since 0.6.0
  15649. * @category String
  15650. * @param {string} [string=''] The string to unescape.
  15651. * @returns {string} Returns the unescaped string.
  15652. * @example
  15653. *
  15654. * _.unescape('fred, barney, &amp; pebbles');
  15655. * // => 'fred, barney, & pebbles'
  15656. */
  15657. function unescape(string) {
  15658. string = toString(string);
  15659. return (string && reHasEscapedHtml.test(string))
  15660. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15661. : string;
  15662. }
  15663. /**
  15664. * Converts `string`, as space separated words, to upper case.
  15665. *
  15666. * @static
  15667. * @memberOf _
  15668. * @since 4.0.0
  15669. * @category String
  15670. * @param {string} [string=''] The string to convert.
  15671. * @returns {string} Returns the upper cased string.
  15672. * @example
  15673. *
  15674. * _.upperCase('--foo-bar');
  15675. * // => 'FOO BAR'
  15676. *
  15677. * _.upperCase('fooBar');
  15678. * // => 'FOO BAR'
  15679. *
  15680. * _.upperCase('__foo_bar__');
  15681. * // => 'FOO BAR'
  15682. */
  15683. var upperCase = createCompounder(function(result, word, index) {
  15684. return result + (index ? ' ' : '') + word.toUpperCase();
  15685. });
  15686. /**
  15687. * Converts the first character of `string` to upper case.
  15688. *
  15689. * @static
  15690. * @memberOf _
  15691. * @since 4.0.0
  15692. * @category String
  15693. * @param {string} [string=''] The string to convert.
  15694. * @returns {string} Returns the converted string.
  15695. * @example
  15696. *
  15697. * _.upperFirst('fred');
  15698. * // => 'Fred'
  15699. *
  15700. * _.upperFirst('FRED');
  15701. * // => 'FRED'
  15702. */
  15703. var upperFirst = createCaseFirst('toUpperCase');
  15704. /**
  15705. * Splits `string` into an array of its words.
  15706. *
  15707. * @static
  15708. * @memberOf _
  15709. * @since 3.0.0
  15710. * @category String
  15711. * @param {string} [string=''] The string to inspect.
  15712. * @param {RegExp|string} [pattern] The pattern to match words.
  15713. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15714. * @returns {Array} Returns the words of `string`.
  15715. * @example
  15716. *
  15717. * _.words('fred, barney, & pebbles');
  15718. * // => ['fred', 'barney', 'pebbles']
  15719. *
  15720. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15721. * // => ['fred', 'barney', '&', 'pebbles']
  15722. */
  15723. function words(string, pattern, guard) {
  15724. string = toString(string);
  15725. pattern = guard ? undefined : pattern;
  15726. if (pattern === undefined) {
  15727. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15728. }
  15729. return string.match(pattern) || [];
  15730. }
  15731. /*------------------------------------------------------------------------*/
  15732. /**
  15733. * Attempts to invoke `func`, returning either the result or the caught error
  15734. * object. Any additional arguments are provided to `func` when it's invoked.
  15735. *
  15736. * @static
  15737. * @memberOf _
  15738. * @since 3.0.0
  15739. * @category Util
  15740. * @param {Function} func The function to attempt.
  15741. * @param {...*} [args] The arguments to invoke `func` with.
  15742. * @returns {*} Returns the `func` result or error object.
  15743. * @example
  15744. *
  15745. * // Avoid throwing errors for invalid selectors.
  15746. * var elements = _.attempt(function(selector) {
  15747. * return document.querySelectorAll(selector);
  15748. * }, '>_>');
  15749. *
  15750. * if (_.isError(elements)) {
  15751. * elements = [];
  15752. * }
  15753. */
  15754. var attempt = baseRest(function(func, args) {
  15755. try {
  15756. return apply(func, undefined, args);
  15757. } catch (e) {
  15758. return isError(e) ? e : new Error(e);
  15759. }
  15760. });
  15761. /**
  15762. * Binds methods of an object to the object itself, overwriting the existing
  15763. * method.
  15764. *
  15765. * **Note:** This method doesn't set the "length" property of bound functions.
  15766. *
  15767. * @static
  15768. * @since 0.1.0
  15769. * @memberOf _
  15770. * @category Util
  15771. * @param {Object} object The object to bind and assign the bound methods to.
  15772. * @param {...(string|string[])} methodNames The object method names to bind.
  15773. * @returns {Object} Returns `object`.
  15774. * @example
  15775. *
  15776. * var view = {
  15777. * 'label': 'docs',
  15778. * 'click': function() {
  15779. * console.log('clicked ' + this.label);
  15780. * }
  15781. * };
  15782. *
  15783. * _.bindAll(view, ['click']);
  15784. * jQuery(element).on('click', view.click);
  15785. * // => Logs 'clicked docs' when clicked.
  15786. */
  15787. var bindAll = flatRest(function(object, methodNames) {
  15788. arrayEach(methodNames, function(key) {
  15789. key = toKey(key);
  15790. baseAssignValue(object, key, bind(object[key], object));
  15791. });
  15792. return object;
  15793. });
  15794. /**
  15795. * Creates a function that iterates over `pairs` and invokes the corresponding
  15796. * function of the first predicate to return truthy. The predicate-function
  15797. * pairs are invoked with the `this` binding and arguments of the created
  15798. * function.
  15799. *
  15800. * @static
  15801. * @memberOf _
  15802. * @since 4.0.0
  15803. * @category Util
  15804. * @param {Array} pairs The predicate-function pairs.
  15805. * @returns {Function} Returns the new composite function.
  15806. * @example
  15807. *
  15808. * var func = _.cond([
  15809. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15810. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15811. * [_.stubTrue, _.constant('no match')]
  15812. * ]);
  15813. *
  15814. * func({ 'a': 1, 'b': 2 });
  15815. * // => 'matches A'
  15816. *
  15817. * func({ 'a': 0, 'b': 1 });
  15818. * // => 'matches B'
  15819. *
  15820. * func({ 'a': '1', 'b': '2' });
  15821. * // => 'no match'
  15822. */
  15823. function cond(pairs) {
  15824. var length = pairs == null ? 0 : pairs.length,
  15825. toIteratee = getIteratee();
  15826. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15827. if (typeof pair[1] != 'function') {
  15828. throw new TypeError(FUNC_ERROR_TEXT);
  15829. }
  15830. return [toIteratee(pair[0]), pair[1]];
  15831. });
  15832. return baseRest(function(args) {
  15833. var index = -1;
  15834. while (++index < length) {
  15835. var pair = pairs[index];
  15836. if (apply(pair[0], this, args)) {
  15837. return apply(pair[1], this, args);
  15838. }
  15839. }
  15840. });
  15841. }
  15842. /**
  15843. * Creates a function that invokes the predicate properties of `source` with
  15844. * the corresponding property values of a given object, returning `true` if
  15845. * all predicates return truthy, else `false`.
  15846. *
  15847. * **Note:** The created function is equivalent to `_.conformsTo` with
  15848. * `source` partially applied.
  15849. *
  15850. * @static
  15851. * @memberOf _
  15852. * @since 4.0.0
  15853. * @category Util
  15854. * @param {Object} source The object of property predicates to conform to.
  15855. * @returns {Function} Returns the new spec function.
  15856. * @example
  15857. *
  15858. * var objects = [
  15859. * { 'a': 2, 'b': 1 },
  15860. * { 'a': 1, 'b': 2 }
  15861. * ];
  15862. *
  15863. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15864. * // => [{ 'a': 1, 'b': 2 }]
  15865. */
  15866. function conforms(source) {
  15867. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15868. }
  15869. /**
  15870. * Creates a function that returns `value`.
  15871. *
  15872. * @static
  15873. * @memberOf _
  15874. * @since 2.4.0
  15875. * @category Util
  15876. * @param {*} value The value to return from the new function.
  15877. * @returns {Function} Returns the new constant function.
  15878. * @example
  15879. *
  15880. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15881. *
  15882. * console.log(objects);
  15883. * // => [{ 'a': 1 }, { 'a': 1 }]
  15884. *
  15885. * console.log(objects[0] === objects[1]);
  15886. * // => true
  15887. */
  15888. function constant(value) {
  15889. return function() {
  15890. return value;
  15891. };
  15892. }
  15893. /**
  15894. * Checks `value` to determine whether a default value should be returned in
  15895. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15896. * or `undefined`.
  15897. *
  15898. * @static
  15899. * @memberOf _
  15900. * @since 4.14.0
  15901. * @category Util
  15902. * @param {*} value The value to check.
  15903. * @param {*} defaultValue The default value.
  15904. * @returns {*} Returns the resolved value.
  15905. * @example
  15906. *
  15907. * _.defaultTo(1, 10);
  15908. * // => 1
  15909. *
  15910. * _.defaultTo(undefined, 10);
  15911. * // => 10
  15912. */
  15913. function defaultTo(value, defaultValue) {
  15914. return (value == null || value !== value) ? defaultValue : value;
  15915. }
  15916. /**
  15917. * Creates a function that returns the result of invoking the given functions
  15918. * with the `this` binding of the created function, where each successive
  15919. * invocation is supplied the return value of the previous.
  15920. *
  15921. * @static
  15922. * @memberOf _
  15923. * @since 3.0.0
  15924. * @category Util
  15925. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15926. * @returns {Function} Returns the new composite function.
  15927. * @see _.flowRight
  15928. * @example
  15929. *
  15930. * function square(n) {
  15931. * return n * n;
  15932. * }
  15933. *
  15934. * var addSquare = _.flow([_.add, square]);
  15935. * addSquare(1, 2);
  15936. * // => 9
  15937. */
  15938. var flow = createFlow();
  15939. /**
  15940. * This method is like `_.flow` except that it creates a function that
  15941. * invokes the given functions from right to left.
  15942. *
  15943. * @static
  15944. * @since 3.0.0
  15945. * @memberOf _
  15946. * @category Util
  15947. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15948. * @returns {Function} Returns the new composite function.
  15949. * @see _.flow
  15950. * @example
  15951. *
  15952. * function square(n) {
  15953. * return n * n;
  15954. * }
  15955. *
  15956. * var addSquare = _.flowRight([square, _.add]);
  15957. * addSquare(1, 2);
  15958. * // => 9
  15959. */
  15960. var flowRight = createFlow(true);
  15961. /**
  15962. * This method returns the first argument it receives.
  15963. *
  15964. * @static
  15965. * @since 0.1.0
  15966. * @memberOf _
  15967. * @category Util
  15968. * @param {*} value Any value.
  15969. * @returns {*} Returns `value`.
  15970. * @example
  15971. *
  15972. * var object = { 'a': 1 };
  15973. *
  15974. * console.log(_.identity(object) === object);
  15975. * // => true
  15976. */
  15977. function identity(value) {
  15978. return value;
  15979. }
  15980. /**
  15981. * Creates a function that invokes `func` with the arguments of the created
  15982. * function. If `func` is a property name, the created function returns the
  15983. * property value for a given element. If `func` is an array or object, the
  15984. * created function returns `true` for elements that contain the equivalent
  15985. * source properties, otherwise it returns `false`.
  15986. *
  15987. * @static
  15988. * @since 4.0.0
  15989. * @memberOf _
  15990. * @category Util
  15991. * @param {*} [func=_.identity] The value to convert to a callback.
  15992. * @returns {Function} Returns the callback.
  15993. * @example
  15994. *
  15995. * var users = [
  15996. * { 'user': 'barney', 'age': 36, 'active': true },
  15997. * { 'user': 'fred', 'age': 40, 'active': false }
  15998. * ];
  15999. *
  16000. * // The `_.matches` iteratee shorthand.
  16001. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  16002. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  16003. *
  16004. * // The `_.matchesProperty` iteratee shorthand.
  16005. * _.filter(users, _.iteratee(['user', 'fred']));
  16006. * // => [{ 'user': 'fred', 'age': 40 }]
  16007. *
  16008. * // The `_.property` iteratee shorthand.
  16009. * _.map(users, _.iteratee('user'));
  16010. * // => ['barney', 'fred']
  16011. *
  16012. * // Create custom iteratee shorthands.
  16013. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  16014. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  16015. * return func.test(string);
  16016. * };
  16017. * });
  16018. *
  16019. * _.filter(['abc', 'def'], /ef/);
  16020. * // => ['def']
  16021. */
  16022. function iteratee(func) {
  16023. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  16024. }
  16025. /**
  16026. * Creates a function that performs a partial deep comparison between a given
  16027. * object and `source`, returning `true` if the given object has equivalent
  16028. * property values, else `false`.
  16029. *
  16030. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  16031. * partially applied.
  16032. *
  16033. * Partial comparisons will match empty array and empty object `source`
  16034. * values against any array or object value, respectively. See `_.isEqual`
  16035. * for a list of supported value comparisons.
  16036. *
  16037. * **Note:** Multiple values can be checked by combining several matchers
  16038. * using `_.overSome`
  16039. *
  16040. * @static
  16041. * @memberOf _
  16042. * @since 3.0.0
  16043. * @category Util
  16044. * @param {Object} source The object of property values to match.
  16045. * @returns {Function} Returns the new spec function.
  16046. * @example
  16047. *
  16048. * var objects = [
  16049. * { 'a': 1, 'b': 2, 'c': 3 },
  16050. * { 'a': 4, 'b': 5, 'c': 6 }
  16051. * ];
  16052. *
  16053. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  16054. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  16055. *
  16056. * // Checking for several possible values
  16057. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16058. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16059. */
  16060. function matches(source) {
  16061. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16062. }
  16063. /**
  16064. * Creates a function that performs a partial deep comparison between the
  16065. * value at `path` of a given object to `srcValue`, returning `true` if the
  16066. * object value is equivalent, else `false`.
  16067. *
  16068. * **Note:** Partial comparisons will match empty array and empty object
  16069. * `srcValue` values against any array or object value, respectively. See
  16070. * `_.isEqual` for a list of supported value comparisons.
  16071. *
  16072. * **Note:** Multiple values can be checked by combining several matchers
  16073. * using `_.overSome`
  16074. *
  16075. * @static
  16076. * @memberOf _
  16077. * @since 3.2.0
  16078. * @category Util
  16079. * @param {Array|string} path The path of the property to get.
  16080. * @param {*} srcValue The value to match.
  16081. * @returns {Function} Returns the new spec function.
  16082. * @example
  16083. *
  16084. * var objects = [
  16085. * { 'a': 1, 'b': 2, 'c': 3 },
  16086. * { 'a': 4, 'b': 5, 'c': 6 }
  16087. * ];
  16088. *
  16089. * _.find(objects, _.matchesProperty('a', 4));
  16090. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16091. *
  16092. * // Checking for several possible values
  16093. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16094. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16095. */
  16096. function matchesProperty(path, srcValue) {
  16097. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16098. }
  16099. /**
  16100. * Creates a function that invokes the method at `path` of a given object.
  16101. * Any additional arguments are provided to the invoked method.
  16102. *
  16103. * @static
  16104. * @memberOf _
  16105. * @since 3.7.0
  16106. * @category Util
  16107. * @param {Array|string} path The path of the method to invoke.
  16108. * @param {...*} [args] The arguments to invoke the method with.
  16109. * @returns {Function} Returns the new invoker function.
  16110. * @example
  16111. *
  16112. * var objects = [
  16113. * { 'a': { 'b': _.constant(2) } },
  16114. * { 'a': { 'b': _.constant(1) } }
  16115. * ];
  16116. *
  16117. * _.map(objects, _.method('a.b'));
  16118. * // => [2, 1]
  16119. *
  16120. * _.map(objects, _.method(['a', 'b']));
  16121. * // => [2, 1]
  16122. */
  16123. var method = baseRest(function(path, args) {
  16124. return function(object) {
  16125. return baseInvoke(object, path, args);
  16126. };
  16127. });
  16128. /**
  16129. * The opposite of `_.method`; this method creates a function that invokes
  16130. * the method at a given path of `object`. Any additional arguments are
  16131. * provided to the invoked method.
  16132. *
  16133. * @static
  16134. * @memberOf _
  16135. * @since 3.7.0
  16136. * @category Util
  16137. * @param {Object} object The object to query.
  16138. * @param {...*} [args] The arguments to invoke the method with.
  16139. * @returns {Function} Returns the new invoker function.
  16140. * @example
  16141. *
  16142. * var array = _.times(3, _.constant),
  16143. * object = { 'a': array, 'b': array, 'c': array };
  16144. *
  16145. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16146. * // => [2, 0]
  16147. *
  16148. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16149. * // => [2, 0]
  16150. */
  16151. var methodOf = baseRest(function(object, args) {
  16152. return function(path) {
  16153. return baseInvoke(object, path, args);
  16154. };
  16155. });
  16156. /**
  16157. * Adds all own enumerable string keyed function properties of a source
  16158. * object to the destination object. If `object` is a function, then methods
  16159. * are added to its prototype as well.
  16160. *
  16161. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16162. * avoid conflicts caused by modifying the original.
  16163. *
  16164. * @static
  16165. * @since 0.1.0
  16166. * @memberOf _
  16167. * @category Util
  16168. * @param {Function|Object} [object=lodash] The destination object.
  16169. * @param {Object} source The object of functions to add.
  16170. * @param {Object} [options={}] The options object.
  16171. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16172. * @returns {Function|Object} Returns `object`.
  16173. * @example
  16174. *
  16175. * function vowels(string) {
  16176. * return _.filter(string, function(v) {
  16177. * return /[aeiou]/i.test(v);
  16178. * });
  16179. * }
  16180. *
  16181. * _.mixin({ 'vowels': vowels });
  16182. * _.vowels('fred');
  16183. * // => ['e']
  16184. *
  16185. * _('fred').vowels().value();
  16186. * // => ['e']
  16187. *
  16188. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16189. * _('fred').vowels();
  16190. * // => ['e']
  16191. */
  16192. function mixin(object, source, options) {
  16193. var props = keys(source),
  16194. methodNames = baseFunctions(source, props);
  16195. if (options == null &&
  16196. !(isObject(source) && (methodNames.length || !props.length))) {
  16197. options = source;
  16198. source = object;
  16199. object = this;
  16200. methodNames = baseFunctions(source, keys(source));
  16201. }
  16202. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16203. isFunc = isFunction(object);
  16204. arrayEach(methodNames, function(methodName) {
  16205. var func = source[methodName];
  16206. object[methodName] = func;
  16207. if (isFunc) {
  16208. object.prototype[methodName] = function() {
  16209. var chainAll = this.__chain__;
  16210. if (chain || chainAll) {
  16211. var result = object(this.__wrapped__),
  16212. actions = result.__actions__ = copyArray(this.__actions__);
  16213. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16214. result.__chain__ = chainAll;
  16215. return result;
  16216. }
  16217. return func.apply(object, arrayPush([this.value()], arguments));
  16218. };
  16219. }
  16220. });
  16221. return object;
  16222. }
  16223. /**
  16224. * Reverts the `_` variable to its previous value and returns a reference to
  16225. * the `lodash` function.
  16226. *
  16227. * @static
  16228. * @since 0.1.0
  16229. * @memberOf _
  16230. * @category Util
  16231. * @returns {Function} Returns the `lodash` function.
  16232. * @example
  16233. *
  16234. * var lodash = _.noConflict();
  16235. */
  16236. function noConflict() {
  16237. if (root._ === this) {
  16238. root._ = oldDash;
  16239. }
  16240. return this;
  16241. }
  16242. /**
  16243. * This method returns `undefined`.
  16244. *
  16245. * @static
  16246. * @memberOf _
  16247. * @since 2.3.0
  16248. * @category Util
  16249. * @example
  16250. *
  16251. * _.times(2, _.noop);
  16252. * // => [undefined, undefined]
  16253. */
  16254. function noop() {
  16255. // No operation performed.
  16256. }
  16257. /**
  16258. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16259. * the nth argument from the end is returned.
  16260. *
  16261. * @static
  16262. * @memberOf _
  16263. * @since 4.0.0
  16264. * @category Util
  16265. * @param {number} [n=0] The index of the argument to return.
  16266. * @returns {Function} Returns the new pass-thru function.
  16267. * @example
  16268. *
  16269. * var func = _.nthArg(1);
  16270. * func('a', 'b', 'c', 'd');
  16271. * // => 'b'
  16272. *
  16273. * var func = _.nthArg(-2);
  16274. * func('a', 'b', 'c', 'd');
  16275. * // => 'c'
  16276. */
  16277. function nthArg(n) {
  16278. n = toInteger(n);
  16279. return baseRest(function(args) {
  16280. return baseNth(args, n);
  16281. });
  16282. }
  16283. /**
  16284. * Creates a function that invokes `iteratees` with the arguments it receives
  16285. * and returns their results.
  16286. *
  16287. * @static
  16288. * @memberOf _
  16289. * @since 4.0.0
  16290. * @category Util
  16291. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16292. * The iteratees to invoke.
  16293. * @returns {Function} Returns the new function.
  16294. * @example
  16295. *
  16296. * var func = _.over([Math.max, Math.min]);
  16297. *
  16298. * func(1, 2, 3, 4);
  16299. * // => [4, 1]
  16300. */
  16301. var over = createOver(arrayMap);
  16302. /**
  16303. * Creates a function that checks if **all** of the `predicates` return
  16304. * truthy when invoked with the arguments it receives.
  16305. *
  16306. * Following shorthands are possible for providing predicates.
  16307. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16308. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16309. *
  16310. * @static
  16311. * @memberOf _
  16312. * @since 4.0.0
  16313. * @category Util
  16314. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16315. * The predicates to check.
  16316. * @returns {Function} Returns the new function.
  16317. * @example
  16318. *
  16319. * var func = _.overEvery([Boolean, isFinite]);
  16320. *
  16321. * func('1');
  16322. * // => true
  16323. *
  16324. * func(null);
  16325. * // => false
  16326. *
  16327. * func(NaN);
  16328. * // => false
  16329. */
  16330. var overEvery = createOver(arrayEvery);
  16331. /**
  16332. * Creates a function that checks if **any** of the `predicates` return
  16333. * truthy when invoked with the arguments it receives.
  16334. *
  16335. * Following shorthands are possible for providing predicates.
  16336. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16337. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16338. *
  16339. * @static
  16340. * @memberOf _
  16341. * @since 4.0.0
  16342. * @category Util
  16343. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16344. * The predicates to check.
  16345. * @returns {Function} Returns the new function.
  16346. * @example
  16347. *
  16348. * var func = _.overSome([Boolean, isFinite]);
  16349. *
  16350. * func('1');
  16351. * // => true
  16352. *
  16353. * func(null);
  16354. * // => true
  16355. *
  16356. * func(NaN);
  16357. * // => false
  16358. *
  16359. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16360. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16361. */
  16362. var overSome = createOver(arraySome);
  16363. /**
  16364. * Creates a function that returns the value at `path` of a given object.
  16365. *
  16366. * @static
  16367. * @memberOf _
  16368. * @since 2.4.0
  16369. * @category Util
  16370. * @param {Array|string} path The path of the property to get.
  16371. * @returns {Function} Returns the new accessor function.
  16372. * @example
  16373. *
  16374. * var objects = [
  16375. * { 'a': { 'b': 2 } },
  16376. * { 'a': { 'b': 1 } }
  16377. * ];
  16378. *
  16379. * _.map(objects, _.property('a.b'));
  16380. * // => [2, 1]
  16381. *
  16382. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16383. * // => [1, 2]
  16384. */
  16385. function property(path) {
  16386. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16387. }
  16388. /**
  16389. * The opposite of `_.property`; this method creates a function that returns
  16390. * the value at a given path of `object`.
  16391. *
  16392. * @static
  16393. * @memberOf _
  16394. * @since 3.0.0
  16395. * @category Util
  16396. * @param {Object} object The object to query.
  16397. * @returns {Function} Returns the new accessor function.
  16398. * @example
  16399. *
  16400. * var array = [0, 1, 2],
  16401. * object = { 'a': array, 'b': array, 'c': array };
  16402. *
  16403. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16404. * // => [2, 0]
  16405. *
  16406. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16407. * // => [2, 0]
  16408. */
  16409. function propertyOf(object) {
  16410. return function(path) {
  16411. return object == null ? undefined : baseGet(object, path);
  16412. };
  16413. }
  16414. /**
  16415. * Creates an array of numbers (positive and/or negative) progressing from
  16416. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16417. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16418. * it's set to `start` with `start` then set to `0`.
  16419. *
  16420. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16421. * floating-point values which can produce unexpected results.
  16422. *
  16423. * @static
  16424. * @since 0.1.0
  16425. * @memberOf _
  16426. * @category Util
  16427. * @param {number} [start=0] The start of the range.
  16428. * @param {number} end The end of the range.
  16429. * @param {number} [step=1] The value to increment or decrement by.
  16430. * @returns {Array} Returns the range of numbers.
  16431. * @see _.inRange, _.rangeRight
  16432. * @example
  16433. *
  16434. * _.range(4);
  16435. * // => [0, 1, 2, 3]
  16436. *
  16437. * _.range(-4);
  16438. * // => [0, -1, -2, -3]
  16439. *
  16440. * _.range(1, 5);
  16441. * // => [1, 2, 3, 4]
  16442. *
  16443. * _.range(0, 20, 5);
  16444. * // => [0, 5, 10, 15]
  16445. *
  16446. * _.range(0, -4, -1);
  16447. * // => [0, -1, -2, -3]
  16448. *
  16449. * _.range(1, 4, 0);
  16450. * // => [1, 1, 1]
  16451. *
  16452. * _.range(0);
  16453. * // => []
  16454. */
  16455. var range = createRange();
  16456. /**
  16457. * This method is like `_.range` except that it populates values in
  16458. * descending order.
  16459. *
  16460. * @static
  16461. * @memberOf _
  16462. * @since 4.0.0
  16463. * @category Util
  16464. * @param {number} [start=0] The start of the range.
  16465. * @param {number} end The end of the range.
  16466. * @param {number} [step=1] The value to increment or decrement by.
  16467. * @returns {Array} Returns the range of numbers.
  16468. * @see _.inRange, _.range
  16469. * @example
  16470. *
  16471. * _.rangeRight(4);
  16472. * // => [3, 2, 1, 0]
  16473. *
  16474. * _.rangeRight(-4);
  16475. * // => [-3, -2, -1, 0]
  16476. *
  16477. * _.rangeRight(1, 5);
  16478. * // => [4, 3, 2, 1]
  16479. *
  16480. * _.rangeRight(0, 20, 5);
  16481. * // => [15, 10, 5, 0]
  16482. *
  16483. * _.rangeRight(0, -4, -1);
  16484. * // => [-3, -2, -1, 0]
  16485. *
  16486. * _.rangeRight(1, 4, 0);
  16487. * // => [1, 1, 1]
  16488. *
  16489. * _.rangeRight(0);
  16490. * // => []
  16491. */
  16492. var rangeRight = createRange(true);
  16493. /**
  16494. * This method returns a new empty array.
  16495. *
  16496. * @static
  16497. * @memberOf _
  16498. * @since 4.13.0
  16499. * @category Util
  16500. * @returns {Array} Returns the new empty array.
  16501. * @example
  16502. *
  16503. * var arrays = _.times(2, _.stubArray);
  16504. *
  16505. * console.log(arrays);
  16506. * // => [[], []]
  16507. *
  16508. * console.log(arrays[0] === arrays[1]);
  16509. * // => false
  16510. */
  16511. function stubArray() {
  16512. return [];
  16513. }
  16514. /**
  16515. * This method returns `false`.
  16516. *
  16517. * @static
  16518. * @memberOf _
  16519. * @since 4.13.0
  16520. * @category Util
  16521. * @returns {boolean} Returns `false`.
  16522. * @example
  16523. *
  16524. * _.times(2, _.stubFalse);
  16525. * // => [false, false]
  16526. */
  16527. function stubFalse() {
  16528. return false;
  16529. }
  16530. /**
  16531. * This method returns a new empty object.
  16532. *
  16533. * @static
  16534. * @memberOf _
  16535. * @since 4.13.0
  16536. * @category Util
  16537. * @returns {Object} Returns the new empty object.
  16538. * @example
  16539. *
  16540. * var objects = _.times(2, _.stubObject);
  16541. *
  16542. * console.log(objects);
  16543. * // => [{}, {}]
  16544. *
  16545. * console.log(objects[0] === objects[1]);
  16546. * // => false
  16547. */
  16548. function stubObject() {
  16549. return {};
  16550. }
  16551. /**
  16552. * This method returns an empty string.
  16553. *
  16554. * @static
  16555. * @memberOf _
  16556. * @since 4.13.0
  16557. * @category Util
  16558. * @returns {string} Returns the empty string.
  16559. * @example
  16560. *
  16561. * _.times(2, _.stubString);
  16562. * // => ['', '']
  16563. */
  16564. function stubString() {
  16565. return '';
  16566. }
  16567. /**
  16568. * This method returns `true`.
  16569. *
  16570. * @static
  16571. * @memberOf _
  16572. * @since 4.13.0
  16573. * @category Util
  16574. * @returns {boolean} Returns `true`.
  16575. * @example
  16576. *
  16577. * _.times(2, _.stubTrue);
  16578. * // => [true, true]
  16579. */
  16580. function stubTrue() {
  16581. return true;
  16582. }
  16583. /**
  16584. * Invokes the iteratee `n` times, returning an array of the results of
  16585. * each invocation. The iteratee is invoked with one argument; (index).
  16586. *
  16587. * @static
  16588. * @since 0.1.0
  16589. * @memberOf _
  16590. * @category Util
  16591. * @param {number} n The number of times to invoke `iteratee`.
  16592. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16593. * @returns {Array} Returns the array of results.
  16594. * @example
  16595. *
  16596. * _.times(3, String);
  16597. * // => ['0', '1', '2']
  16598. *
  16599. * _.times(4, _.constant(0));
  16600. * // => [0, 0, 0, 0]
  16601. */
  16602. function times(n, iteratee) {
  16603. n = toInteger(n);
  16604. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16605. return [];
  16606. }
  16607. var index = MAX_ARRAY_LENGTH,
  16608. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16609. iteratee = getIteratee(iteratee);
  16610. n -= MAX_ARRAY_LENGTH;
  16611. var result = baseTimes(length, iteratee);
  16612. while (++index < n) {
  16613. iteratee(index);
  16614. }
  16615. return result;
  16616. }
  16617. /**
  16618. * Converts `value` to a property path array.
  16619. *
  16620. * @static
  16621. * @memberOf _
  16622. * @since 4.0.0
  16623. * @category Util
  16624. * @param {*} value The value to convert.
  16625. * @returns {Array} Returns the new property path array.
  16626. * @example
  16627. *
  16628. * _.toPath('a.b.c');
  16629. * // => ['a', 'b', 'c']
  16630. *
  16631. * _.toPath('a[0].b.c');
  16632. * // => ['a', '0', 'b', 'c']
  16633. */
  16634. function toPath(value) {
  16635. if (isArray(value)) {
  16636. return arrayMap(value, toKey);
  16637. }
  16638. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16639. }
  16640. /**
  16641. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16642. *
  16643. * @static
  16644. * @since 0.1.0
  16645. * @memberOf _
  16646. * @category Util
  16647. * @param {string} [prefix=''] The value to prefix the ID with.
  16648. * @returns {string} Returns the unique ID.
  16649. * @example
  16650. *
  16651. * _.uniqueId('contact_');
  16652. * // => 'contact_104'
  16653. *
  16654. * _.uniqueId();
  16655. * // => '105'
  16656. */
  16657. function uniqueId(prefix) {
  16658. var id = ++idCounter;
  16659. return toString(prefix) + id;
  16660. }
  16661. /*------------------------------------------------------------------------*/
  16662. /**
  16663. * Adds two numbers.
  16664. *
  16665. * @static
  16666. * @memberOf _
  16667. * @since 3.4.0
  16668. * @category Math
  16669. * @param {number} augend The first number in an addition.
  16670. * @param {number} addend The second number in an addition.
  16671. * @returns {number} Returns the total.
  16672. * @example
  16673. *
  16674. * _.add(6, 4);
  16675. * // => 10
  16676. */
  16677. var add = createMathOperation(function(augend, addend) {
  16678. return augend + addend;
  16679. }, 0);
  16680. /**
  16681. * Computes `number` rounded up to `precision`.
  16682. *
  16683. * @static
  16684. * @memberOf _
  16685. * @since 3.10.0
  16686. * @category Math
  16687. * @param {number} number The number to round up.
  16688. * @param {number} [precision=0] The precision to round up to.
  16689. * @returns {number} Returns the rounded up number.
  16690. * @example
  16691. *
  16692. * _.ceil(4.006);
  16693. * // => 5
  16694. *
  16695. * _.ceil(6.004, 2);
  16696. * // => 6.01
  16697. *
  16698. * _.ceil(6040, -2);
  16699. * // => 6100
  16700. */
  16701. var ceil = createRound('ceil');
  16702. /**
  16703. * Divide two numbers.
  16704. *
  16705. * @static
  16706. * @memberOf _
  16707. * @since 4.7.0
  16708. * @category Math
  16709. * @param {number} dividend The first number in a division.
  16710. * @param {number} divisor The second number in a division.
  16711. * @returns {number} Returns the quotient.
  16712. * @example
  16713. *
  16714. * _.divide(6, 4);
  16715. * // => 1.5
  16716. */
  16717. var divide = createMathOperation(function(dividend, divisor) {
  16718. return dividend / divisor;
  16719. }, 1);
  16720. /**
  16721. * Computes `number` rounded down to `precision`.
  16722. *
  16723. * @static
  16724. * @memberOf _
  16725. * @since 3.10.0
  16726. * @category Math
  16727. * @param {number} number The number to round down.
  16728. * @param {number} [precision=0] The precision to round down to.
  16729. * @returns {number} Returns the rounded down number.
  16730. * @example
  16731. *
  16732. * _.floor(4.006);
  16733. * // => 4
  16734. *
  16735. * _.floor(0.046, 2);
  16736. * // => 0.04
  16737. *
  16738. * _.floor(4060, -2);
  16739. * // => 4000
  16740. */
  16741. var floor = createRound('floor');
  16742. /**
  16743. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16744. * `undefined` is returned.
  16745. *
  16746. * @static
  16747. * @since 0.1.0
  16748. * @memberOf _
  16749. * @category Math
  16750. * @param {Array} array The array to iterate over.
  16751. * @returns {*} Returns the maximum value.
  16752. * @example
  16753. *
  16754. * _.max([4, 2, 8, 6]);
  16755. * // => 8
  16756. *
  16757. * _.max([]);
  16758. * // => undefined
  16759. */
  16760. function max(array) {
  16761. return (array && array.length)
  16762. ? baseExtremum(array, identity, baseGt)
  16763. : undefined;
  16764. }
  16765. /**
  16766. * This method is like `_.max` except that it accepts `iteratee` which is
  16767. * invoked for each element in `array` to generate the criterion by which
  16768. * the value is ranked. The iteratee is invoked with one argument: (value).
  16769. *
  16770. * @static
  16771. * @memberOf _
  16772. * @since 4.0.0
  16773. * @category Math
  16774. * @param {Array} array The array to iterate over.
  16775. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16776. * @returns {*} Returns the maximum value.
  16777. * @example
  16778. *
  16779. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16780. *
  16781. * _.maxBy(objects, function(o) { return o.n; });
  16782. * // => { 'n': 2 }
  16783. *
  16784. * // The `_.property` iteratee shorthand.
  16785. * _.maxBy(objects, 'n');
  16786. * // => { 'n': 2 }
  16787. */
  16788. function maxBy(array, iteratee) {
  16789. return (array && array.length)
  16790. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16791. : undefined;
  16792. }
  16793. /**
  16794. * Computes the mean of the values in `array`.
  16795. *
  16796. * @static
  16797. * @memberOf _
  16798. * @since 4.0.0
  16799. * @category Math
  16800. * @param {Array} array The array to iterate over.
  16801. * @returns {number} Returns the mean.
  16802. * @example
  16803. *
  16804. * _.mean([4, 2, 8, 6]);
  16805. * // => 5
  16806. */
  16807. function mean(array) {
  16808. return baseMean(array, identity);
  16809. }
  16810. /**
  16811. * This method is like `_.mean` except that it accepts `iteratee` which is
  16812. * invoked for each element in `array` to generate the value to be averaged.
  16813. * The iteratee is invoked with one argument: (value).
  16814. *
  16815. * @static
  16816. * @memberOf _
  16817. * @since 4.7.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 mean.
  16822. * @example
  16823. *
  16824. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16825. *
  16826. * _.meanBy(objects, function(o) { return o.n; });
  16827. * // => 5
  16828. *
  16829. * // The `_.property` iteratee shorthand.
  16830. * _.meanBy(objects, 'n');
  16831. * // => 5
  16832. */
  16833. function meanBy(array, iteratee) {
  16834. return baseMean(array, getIteratee(iteratee, 2));
  16835. }
  16836. /**
  16837. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16838. * `undefined` is returned.
  16839. *
  16840. * @static
  16841. * @since 0.1.0
  16842. * @memberOf _
  16843. * @category Math
  16844. * @param {Array} array The array to iterate over.
  16845. * @returns {*} Returns the minimum value.
  16846. * @example
  16847. *
  16848. * _.min([4, 2, 8, 6]);
  16849. * // => 2
  16850. *
  16851. * _.min([]);
  16852. * // => undefined
  16853. */
  16854. function min(array) {
  16855. return (array && array.length)
  16856. ? baseExtremum(array, identity, baseLt)
  16857. : undefined;
  16858. }
  16859. /**
  16860. * This method is like `_.min` except that it accepts `iteratee` which is
  16861. * invoked for each element in `array` to generate the criterion by which
  16862. * the value is ranked. The iteratee is invoked with one argument: (value).
  16863. *
  16864. * @static
  16865. * @memberOf _
  16866. * @since 4.0.0
  16867. * @category Math
  16868. * @param {Array} array The array to iterate over.
  16869. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16870. * @returns {*} Returns the minimum value.
  16871. * @example
  16872. *
  16873. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16874. *
  16875. * _.minBy(objects, function(o) { return o.n; });
  16876. * // => { 'n': 1 }
  16877. *
  16878. * // The `_.property` iteratee shorthand.
  16879. * _.minBy(objects, 'n');
  16880. * // => { 'n': 1 }
  16881. */
  16882. function minBy(array, iteratee) {
  16883. return (array && array.length)
  16884. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16885. : undefined;
  16886. }
  16887. /**
  16888. * Multiply two numbers.
  16889. *
  16890. * @static
  16891. * @memberOf _
  16892. * @since 4.7.0
  16893. * @category Math
  16894. * @param {number} multiplier The first number in a multiplication.
  16895. * @param {number} multiplicand The second number in a multiplication.
  16896. * @returns {number} Returns the product.
  16897. * @example
  16898. *
  16899. * _.multiply(6, 4);
  16900. * // => 24
  16901. */
  16902. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16903. return multiplier * multiplicand;
  16904. }, 1);
  16905. /**
  16906. * Computes `number` rounded to `precision`.
  16907. *
  16908. * @static
  16909. * @memberOf _
  16910. * @since 3.10.0
  16911. * @category Math
  16912. * @param {number} number The number to round.
  16913. * @param {number} [precision=0] The precision to round to.
  16914. * @returns {number} Returns the rounded number.
  16915. * @example
  16916. *
  16917. * _.round(4.006);
  16918. * // => 4
  16919. *
  16920. * _.round(4.006, 2);
  16921. * // => 4.01
  16922. *
  16923. * _.round(4060, -2);
  16924. * // => 4100
  16925. */
  16926. var round = createRound('round');
  16927. /**
  16928. * Subtract two numbers.
  16929. *
  16930. * @static
  16931. * @memberOf _
  16932. * @since 4.0.0
  16933. * @category Math
  16934. * @param {number} minuend The first number in a subtraction.
  16935. * @param {number} subtrahend The second number in a subtraction.
  16936. * @returns {number} Returns the difference.
  16937. * @example
  16938. *
  16939. * _.subtract(6, 4);
  16940. * // => 2
  16941. */
  16942. var subtract = createMathOperation(function(minuend, subtrahend) {
  16943. return minuend - subtrahend;
  16944. }, 0);
  16945. /**
  16946. * Computes the sum of the values in `array`.
  16947. *
  16948. * @static
  16949. * @memberOf _
  16950. * @since 3.4.0
  16951. * @category Math
  16952. * @param {Array} array The array to iterate over.
  16953. * @returns {number} Returns the sum.
  16954. * @example
  16955. *
  16956. * _.sum([4, 2, 8, 6]);
  16957. * // => 20
  16958. */
  16959. function sum(array) {
  16960. return (array && array.length)
  16961. ? baseSum(array, identity)
  16962. : 0;
  16963. }
  16964. /**
  16965. * This method is like `_.sum` except that it accepts `iteratee` which is
  16966. * invoked for each element in `array` to generate the value to be summed.
  16967. * The iteratee is invoked with one argument: (value).
  16968. *
  16969. * @static
  16970. * @memberOf _
  16971. * @since 4.0.0
  16972. * @category Math
  16973. * @param {Array} array The array to iterate over.
  16974. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16975. * @returns {number} Returns the sum.
  16976. * @example
  16977. *
  16978. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16979. *
  16980. * _.sumBy(objects, function(o) { return o.n; });
  16981. * // => 20
  16982. *
  16983. * // The `_.property` iteratee shorthand.
  16984. * _.sumBy(objects, 'n');
  16985. * // => 20
  16986. */
  16987. function sumBy(array, iteratee) {
  16988. return (array && array.length)
  16989. ? baseSum(array, getIteratee(iteratee, 2))
  16990. : 0;
  16991. }
  16992. /*------------------------------------------------------------------------*/
  16993. // Add methods that return wrapped values in chain sequences.
  16994. lodash.after = after;
  16995. lodash.ary = ary;
  16996. lodash.assign = assign;
  16997. lodash.assignIn = assignIn;
  16998. lodash.assignInWith = assignInWith;
  16999. lodash.assignWith = assignWith;
  17000. lodash.at = at;
  17001. lodash.before = before;
  17002. lodash.bind = bind;
  17003. lodash.bindAll = bindAll;
  17004. lodash.bindKey = bindKey;
  17005. lodash.castArray = castArray;
  17006. lodash.chain = chain;
  17007. lodash.chunk = chunk;
  17008. lodash.compact = compact;
  17009. lodash.concat = concat;
  17010. lodash.cond = cond;
  17011. lodash.conforms = conforms;
  17012. lodash.constant = constant;
  17013. lodash.countBy = countBy;
  17014. lodash.create = create;
  17015. lodash.curry = curry;
  17016. lodash.curryRight = curryRight;
  17017. lodash.debounce = debounce;
  17018. lodash.defaults = defaults;
  17019. lodash.defaultsDeep = defaultsDeep;
  17020. lodash.defer = defer;
  17021. lodash.delay = delay;
  17022. lodash.difference = difference;
  17023. lodash.differenceBy = differenceBy;
  17024. lodash.differenceWith = differenceWith;
  17025. lodash.drop = drop;
  17026. lodash.dropRight = dropRight;
  17027. lodash.dropRightWhile = dropRightWhile;
  17028. lodash.dropWhile = dropWhile;
  17029. lodash.fill = fill;
  17030. lodash.filter = filter;
  17031. lodash.flatMap = flatMap;
  17032. lodash.flatMapDeep = flatMapDeep;
  17033. lodash.flatMapDepth = flatMapDepth;
  17034. lodash.flatten = flatten;
  17035. lodash.flattenDeep = flattenDeep;
  17036. lodash.flattenDepth = flattenDepth;
  17037. lodash.flip = flip;
  17038. lodash.flow = flow;
  17039. lodash.flowRight = flowRight;
  17040. lodash.fromPairs = fromPairs;
  17041. lodash.functions = functions;
  17042. lodash.functionsIn = functionsIn;
  17043. lodash.groupBy = groupBy;
  17044. lodash.initial = initial;
  17045. lodash.intersection = intersection;
  17046. lodash.intersectionBy = intersectionBy;
  17047. lodash.intersectionWith = intersectionWith;
  17048. lodash.invert = invert;
  17049. lodash.invertBy = invertBy;
  17050. lodash.invokeMap = invokeMap;
  17051. lodash.iteratee = iteratee;
  17052. lodash.keyBy = keyBy;
  17053. lodash.keys = keys;
  17054. lodash.keysIn = keysIn;
  17055. lodash.map = map;
  17056. lodash.mapKeys = mapKeys;
  17057. lodash.mapValues = mapValues;
  17058. lodash.matches = matches;
  17059. lodash.matchesProperty = matchesProperty;
  17060. lodash.memoize = memoize;
  17061. lodash.merge = merge;
  17062. lodash.mergeWith = mergeWith;
  17063. lodash.method = method;
  17064. lodash.methodOf = methodOf;
  17065. lodash.mixin = mixin;
  17066. lodash.negate = negate;
  17067. lodash.nthArg = nthArg;
  17068. lodash.omit = omit;
  17069. lodash.omitBy = omitBy;
  17070. lodash.once = once;
  17071. lodash.orderBy = orderBy;
  17072. lodash.over = over;
  17073. lodash.overArgs = overArgs;
  17074. lodash.overEvery = overEvery;
  17075. lodash.overSome = overSome;
  17076. lodash.partial = partial;
  17077. lodash.partialRight = partialRight;
  17078. lodash.partition = partition;
  17079. lodash.pick = pick;
  17080. lodash.pickBy = pickBy;
  17081. lodash.property = property;
  17082. lodash.propertyOf = propertyOf;
  17083. lodash.pull = pull;
  17084. lodash.pullAll = pullAll;
  17085. lodash.pullAllBy = pullAllBy;
  17086. lodash.pullAllWith = pullAllWith;
  17087. lodash.pullAt = pullAt;
  17088. lodash.range = range;
  17089. lodash.rangeRight = rangeRight;
  17090. lodash.rearg = rearg;
  17091. lodash.reject = reject;
  17092. lodash.remove = remove;
  17093. lodash.rest = rest;
  17094. lodash.reverse = reverse;
  17095. lodash.sampleSize = sampleSize;
  17096. lodash.set = set;
  17097. lodash.setWith = setWith;
  17098. lodash.shuffle = shuffle;
  17099. lodash.slice = slice;
  17100. lodash.sortBy = sortBy;
  17101. lodash.sortedUniq = sortedUniq;
  17102. lodash.sortedUniqBy = sortedUniqBy;
  17103. lodash.split = split;
  17104. lodash.spread = spread;
  17105. lodash.tail = tail;
  17106. lodash.take = take;
  17107. lodash.takeRight = takeRight;
  17108. lodash.takeRightWhile = takeRightWhile;
  17109. lodash.takeWhile = takeWhile;
  17110. lodash.tap = tap;
  17111. lodash.throttle = throttle;
  17112. lodash.thru = thru;
  17113. lodash.toArray = toArray;
  17114. lodash.toPairs = toPairs;
  17115. lodash.toPairsIn = toPairsIn;
  17116. lodash.toPath = toPath;
  17117. lodash.toPlainObject = toPlainObject;
  17118. lodash.transform = transform;
  17119. lodash.unary = unary;
  17120. lodash.union = union;
  17121. lodash.unionBy = unionBy;
  17122. lodash.unionWith = unionWith;
  17123. lodash.uniq = uniq;
  17124. lodash.uniqBy = uniqBy;
  17125. lodash.uniqWith = uniqWith;
  17126. lodash.unset = unset;
  17127. lodash.unzip = unzip;
  17128. lodash.unzipWith = unzipWith;
  17129. lodash.update = update;
  17130. lodash.updateWith = updateWith;
  17131. lodash.values = values;
  17132. lodash.valuesIn = valuesIn;
  17133. lodash.without = without;
  17134. lodash.words = words;
  17135. lodash.wrap = wrap;
  17136. lodash.xor = xor;
  17137. lodash.xorBy = xorBy;
  17138. lodash.xorWith = xorWith;
  17139. lodash.zip = zip;
  17140. lodash.zipObject = zipObject;
  17141. lodash.zipObjectDeep = zipObjectDeep;
  17142. lodash.zipWith = zipWith;
  17143. // Add aliases.
  17144. lodash.entries = toPairs;
  17145. lodash.entriesIn = toPairsIn;
  17146. lodash.extend = assignIn;
  17147. lodash.extendWith = assignInWith;
  17148. // Add methods to `lodash.prototype`.
  17149. mixin(lodash, lodash);
  17150. /*------------------------------------------------------------------------*/
  17151. // Add methods that return unwrapped values in chain sequences.
  17152. lodash.add = add;
  17153. lodash.attempt = attempt;
  17154. lodash.camelCase = camelCase;
  17155. lodash.capitalize = capitalize;
  17156. lodash.ceil = ceil;
  17157. lodash.clamp = clamp;
  17158. lodash.clone = clone;
  17159. lodash.cloneDeep = cloneDeep;
  17160. lodash.cloneDeepWith = cloneDeepWith;
  17161. lodash.cloneWith = cloneWith;
  17162. lodash.conformsTo = conformsTo;
  17163. lodash.deburr = deburr;
  17164. lodash.defaultTo = defaultTo;
  17165. lodash.divide = divide;
  17166. lodash.endsWith = endsWith;
  17167. lodash.eq = eq;
  17168. lodash.escape = escape;
  17169. lodash.escapeRegExp = escapeRegExp;
  17170. lodash.every = every;
  17171. lodash.find = find;
  17172. lodash.findIndex = findIndex;
  17173. lodash.findKey = findKey;
  17174. lodash.findLast = findLast;
  17175. lodash.findLastIndex = findLastIndex;
  17176. lodash.findLastKey = findLastKey;
  17177. lodash.floor = floor;
  17178. lodash.forEach = forEach;
  17179. lodash.forEachRight = forEachRight;
  17180. lodash.forIn = forIn;
  17181. lodash.forInRight = forInRight;
  17182. lodash.forOwn = forOwn;
  17183. lodash.forOwnRight = forOwnRight;
  17184. lodash.get = get;
  17185. lodash.gt = gt;
  17186. lodash.gte = gte;
  17187. lodash.has = has;
  17188. lodash.hasIn = hasIn;
  17189. lodash.head = head;
  17190. lodash.identity = identity;
  17191. lodash.includes = includes;
  17192. lodash.indexOf = indexOf;
  17193. lodash.inRange = inRange;
  17194. lodash.invoke = invoke;
  17195. lodash.isArguments = isArguments;
  17196. lodash.isArray = isArray;
  17197. lodash.isArrayBuffer = isArrayBuffer;
  17198. lodash.isArrayLike = isArrayLike;
  17199. lodash.isArrayLikeObject = isArrayLikeObject;
  17200. lodash.isBoolean = isBoolean;
  17201. lodash.isBuffer = isBuffer;
  17202. lodash.isDate = isDate;
  17203. lodash.isElement = isElement;
  17204. lodash.isEmpty = isEmpty;
  17205. lodash.isEqual = isEqual;
  17206. lodash.isEqualWith = isEqualWith;
  17207. lodash.isError = isError;
  17208. lodash.isFinite = isFinite;
  17209. lodash.isFunction = isFunction;
  17210. lodash.isInteger = isInteger;
  17211. lodash.isLength = isLength;
  17212. lodash.isMap = isMap;
  17213. lodash.isMatch = isMatch;
  17214. lodash.isMatchWith = isMatchWith;
  17215. lodash.isNaN = isNaN;
  17216. lodash.isNative = isNative;
  17217. lodash.isNil = isNil;
  17218. lodash.isNull = isNull;
  17219. lodash.isNumber = isNumber;
  17220. lodash.isObject = isObject;
  17221. lodash.isObjectLike = isObjectLike;
  17222. lodash.isPlainObject = isPlainObject;
  17223. lodash.isRegExp = isRegExp;
  17224. lodash.isSafeInteger = isSafeInteger;
  17225. lodash.isSet = isSet;
  17226. lodash.isString = isString;
  17227. lodash.isSymbol = isSymbol;
  17228. lodash.isTypedArray = isTypedArray;
  17229. lodash.isUndefined = isUndefined;
  17230. lodash.isWeakMap = isWeakMap;
  17231. lodash.isWeakSet = isWeakSet;
  17232. lodash.join = join;
  17233. lodash.kebabCase = kebabCase;
  17234. lodash.last = last;
  17235. lodash.lastIndexOf = lastIndexOf;
  17236. lodash.lowerCase = lowerCase;
  17237. lodash.lowerFirst = lowerFirst;
  17238. lodash.lt = lt;
  17239. lodash.lte = lte;
  17240. lodash.max = max;
  17241. lodash.maxBy = maxBy;
  17242. lodash.mean = mean;
  17243. lodash.meanBy = meanBy;
  17244. lodash.min = min;
  17245. lodash.minBy = minBy;
  17246. lodash.stubArray = stubArray;
  17247. lodash.stubFalse = stubFalse;
  17248. lodash.stubObject = stubObject;
  17249. lodash.stubString = stubString;
  17250. lodash.stubTrue = stubTrue;
  17251. lodash.multiply = multiply;
  17252. lodash.nth = nth;
  17253. lodash.noConflict = noConflict;
  17254. lodash.noop = noop;
  17255. lodash.now = now;
  17256. lodash.pad = pad;
  17257. lodash.padEnd = padEnd;
  17258. lodash.padStart = padStart;
  17259. lodash.parseInt = parseInt;
  17260. lodash.random = random;
  17261. lodash.reduce = reduce;
  17262. lodash.reduceRight = reduceRight;
  17263. lodash.repeat = repeat;
  17264. lodash.replace = replace;
  17265. lodash.result = result;
  17266. lodash.round = round;
  17267. lodash.runInContext = runInContext;
  17268. lodash.sample = sample;
  17269. lodash.size = size;
  17270. lodash.snakeCase = snakeCase;
  17271. lodash.some = some;
  17272. lodash.sortedIndex = sortedIndex;
  17273. lodash.sortedIndexBy = sortedIndexBy;
  17274. lodash.sortedIndexOf = sortedIndexOf;
  17275. lodash.sortedLastIndex = sortedLastIndex;
  17276. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17277. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17278. lodash.startCase = startCase;
  17279. lodash.startsWith = startsWith;
  17280. lodash.subtract = subtract;
  17281. lodash.sum = sum;
  17282. lodash.sumBy = sumBy;
  17283. lodash.template = template;
  17284. lodash.times = times;
  17285. lodash.toFinite = toFinite;
  17286. lodash.toInteger = toInteger;
  17287. lodash.toLength = toLength;
  17288. lodash.toLower = toLower;
  17289. lodash.toNumber = toNumber;
  17290. lodash.toSafeInteger = toSafeInteger;
  17291. lodash.toString = toString;
  17292. lodash.toUpper = toUpper;
  17293. lodash.trim = trim;
  17294. lodash.trimEnd = trimEnd;
  17295. lodash.trimStart = trimStart;
  17296. lodash.truncate = truncate;
  17297. lodash.unescape = unescape;
  17298. lodash.uniqueId = uniqueId;
  17299. lodash.upperCase = upperCase;
  17300. lodash.upperFirst = upperFirst;
  17301. // Add aliases.
  17302. lodash.each = forEach;
  17303. lodash.eachRight = forEachRight;
  17304. lodash.first = head;
  17305. mixin(lodash, (function() {
  17306. var source = {};
  17307. baseForOwn(lodash, function(func, methodName) {
  17308. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17309. source[methodName] = func;
  17310. }
  17311. });
  17312. return source;
  17313. }()), { 'chain': false });
  17314. /*------------------------------------------------------------------------*/
  17315. /**
  17316. * The semantic version number.
  17317. *
  17318. * @static
  17319. * @memberOf _
  17320. * @type {string}
  17321. */
  17322. lodash.VERSION = VERSION;
  17323. // Assign default placeholders.
  17324. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17325. lodash[methodName].placeholder = lodash;
  17326. });
  17327. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17328. arrayEach(['drop', 'take'], function(methodName, index) {
  17329. LazyWrapper.prototype[methodName] = function(n) {
  17330. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17331. var result = (this.__filtered__ && !index)
  17332. ? new LazyWrapper(this)
  17333. : this.clone();
  17334. if (result.__filtered__) {
  17335. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17336. } else {
  17337. result.__views__.push({
  17338. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17339. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17340. });
  17341. }
  17342. return result;
  17343. };
  17344. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17345. return this.reverse()[methodName](n).reverse();
  17346. };
  17347. });
  17348. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17349. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17350. var type = index + 1,
  17351. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17352. LazyWrapper.prototype[methodName] = function(iteratee) {
  17353. var result = this.clone();
  17354. result.__iteratees__.push({
  17355. 'iteratee': getIteratee(iteratee, 3),
  17356. 'type': type
  17357. });
  17358. result.__filtered__ = result.__filtered__ || isFilter;
  17359. return result;
  17360. };
  17361. });
  17362. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17363. arrayEach(['head', 'last'], function(methodName, index) {
  17364. var takeName = 'take' + (index ? 'Right' : '');
  17365. LazyWrapper.prototype[methodName] = function() {
  17366. return this[takeName](1).value()[0];
  17367. };
  17368. });
  17369. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17370. arrayEach(['initial', 'tail'], function(methodName, index) {
  17371. var dropName = 'drop' + (index ? '' : 'Right');
  17372. LazyWrapper.prototype[methodName] = function() {
  17373. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17374. };
  17375. });
  17376. LazyWrapper.prototype.compact = function() {
  17377. return this.filter(identity);
  17378. };
  17379. LazyWrapper.prototype.find = function(predicate) {
  17380. return this.filter(predicate).head();
  17381. };
  17382. LazyWrapper.prototype.findLast = function(predicate) {
  17383. return this.reverse().find(predicate);
  17384. };
  17385. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17386. if (typeof path == 'function') {
  17387. return new LazyWrapper(this);
  17388. }
  17389. return this.map(function(value) {
  17390. return baseInvoke(value, path, args);
  17391. });
  17392. });
  17393. LazyWrapper.prototype.reject = function(predicate) {
  17394. return this.filter(negate(getIteratee(predicate)));
  17395. };
  17396. LazyWrapper.prototype.slice = function(start, end) {
  17397. start = toInteger(start);
  17398. var result = this;
  17399. if (result.__filtered__ && (start > 0 || end < 0)) {
  17400. return new LazyWrapper(result);
  17401. }
  17402. if (start < 0) {
  17403. result = result.takeRight(-start);
  17404. } else if (start) {
  17405. result = result.drop(start);
  17406. }
  17407. if (end !== undefined) {
  17408. end = toInteger(end);
  17409. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17410. }
  17411. return result;
  17412. };
  17413. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17414. return this.reverse().takeWhile(predicate).reverse();
  17415. };
  17416. LazyWrapper.prototype.toArray = function() {
  17417. return this.take(MAX_ARRAY_LENGTH);
  17418. };
  17419. // Add `LazyWrapper` methods to `lodash.prototype`.
  17420. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17421. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17422. isTaker = /^(?:head|last)$/.test(methodName),
  17423. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17424. retUnwrapped = isTaker || /^find/.test(methodName);
  17425. if (!lodashFunc) {
  17426. return;
  17427. }
  17428. lodash.prototype[methodName] = function() {
  17429. var value = this.__wrapped__,
  17430. args = isTaker ? [1] : arguments,
  17431. isLazy = value instanceof LazyWrapper,
  17432. iteratee = args[0],
  17433. useLazy = isLazy || isArray(value);
  17434. var interceptor = function(value) {
  17435. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17436. return (isTaker && chainAll) ? result[0] : result;
  17437. };
  17438. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17439. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17440. isLazy = useLazy = false;
  17441. }
  17442. var chainAll = this.__chain__,
  17443. isHybrid = !!this.__actions__.length,
  17444. isUnwrapped = retUnwrapped && !chainAll,
  17445. onlyLazy = isLazy && !isHybrid;
  17446. if (!retUnwrapped && useLazy) {
  17447. value = onlyLazy ? value : new LazyWrapper(this);
  17448. var result = func.apply(value, args);
  17449. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17450. return new LodashWrapper(result, chainAll);
  17451. }
  17452. if (isUnwrapped && onlyLazy) {
  17453. return func.apply(this, args);
  17454. }
  17455. result = this.thru(interceptor);
  17456. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17457. };
  17458. });
  17459. // Add `Array` methods to `lodash.prototype`.
  17460. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17461. var func = arrayProto[methodName],
  17462. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17463. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17464. lodash.prototype[methodName] = function() {
  17465. var args = arguments;
  17466. if (retUnwrapped && !this.__chain__) {
  17467. var value = this.value();
  17468. return func.apply(isArray(value) ? value : [], args);
  17469. }
  17470. return this[chainName](function(value) {
  17471. return func.apply(isArray(value) ? value : [], args);
  17472. });
  17473. };
  17474. });
  17475. // Map minified method names to their real names.
  17476. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17477. var lodashFunc = lodash[methodName];
  17478. if (lodashFunc) {
  17479. var key = lodashFunc.name + '';
  17480. if (!hasOwnProperty.call(realNames, key)) {
  17481. realNames[key] = [];
  17482. }
  17483. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17484. }
  17485. });
  17486. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17487. 'name': 'wrapper',
  17488. 'func': undefined
  17489. }];
  17490. // Add methods to `LazyWrapper`.
  17491. LazyWrapper.prototype.clone = lazyClone;
  17492. LazyWrapper.prototype.reverse = lazyReverse;
  17493. LazyWrapper.prototype.value = lazyValue;
  17494. // Add chain sequence methods to the `lodash` wrapper.
  17495. lodash.prototype.at = wrapperAt;
  17496. lodash.prototype.chain = wrapperChain;
  17497. lodash.prototype.commit = wrapperCommit;
  17498. lodash.prototype.next = wrapperNext;
  17499. lodash.prototype.plant = wrapperPlant;
  17500. lodash.prototype.reverse = wrapperReverse;
  17501. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17502. // Add lazy aliases.
  17503. lodash.prototype.first = lodash.prototype.head;
  17504. if (symIterator) {
  17505. lodash.prototype[symIterator] = wrapperToIterator;
  17506. }
  17507. return lodash;
  17508. });
  17509. /*--------------------------------------------------------------------------*/
  17510. // Export lodash.
  17511. var _ = runInContext();
  17512. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17513. if (true) {
  17514. // Expose Lodash on the global object to prevent errors when Lodash is
  17515. // loaded by a script tag in the presence of an AMD loader.
  17516. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17517. // Use `_.noConflict` to remove Lodash from the global object.
  17518. root._ = _;
  17519. // Define as an anonymous module so, through path mapping, it can be
  17520. // referenced as the "underscore" module.
  17521. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17522. return _;
  17523. }).call(exports, __webpack_require__, exports, module),
  17524. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17525. }
  17526. // Check for `exports` after `define` in case a build optimizer adds it.
  17527. else {}
  17528. }.call(this));
  17529. /***/ }),
  17530. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17531. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17532. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17533. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17534. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17535. "use strict";
  17536. __webpack_require__.r(__webpack_exports__);
  17537. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17538. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17539. /* harmony export */ });
  17540. /* 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");
  17541. /* 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__);
  17542. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17543. var options = {};
  17544. options.insert = "head";
  17545. options.singleton = false;
  17546. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17547. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17548. /***/ }),
  17549. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17550. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17551. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17552. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17553. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17554. "use strict";
  17555. __webpack_require__.r(__webpack_exports__);
  17556. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17557. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17558. /* harmony export */ });
  17559. /* 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");
  17560. /* 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__);
  17561. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17562. var options = {};
  17563. options.insert = "head";
  17564. options.singleton = false;
  17565. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17566. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17567. /***/ }),
  17568. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17569. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17570. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17571. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17572. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17573. "use strict";
  17574. __webpack_require__.r(__webpack_exports__);
  17575. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17576. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17577. /* harmony export */ });
  17578. /* 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");
  17579. /* 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__);
  17580. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17581. var options = {};
  17582. options.insert = "head";
  17583. options.singleton = false;
  17584. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17585. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17586. /***/ }),
  17587. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17588. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17589. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17590. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17591. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17592. "use strict";
  17593. __webpack_require__.r(__webpack_exports__);
  17594. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17595. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17596. /* harmony export */ });
  17597. /* 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");
  17598. /* 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__);
  17599. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17600. var options = {};
  17601. options.insert = "head";
  17602. options.singleton = false;
  17603. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17604. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17605. /***/ }),
  17606. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17607. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17608. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17609. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17610. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17611. "use strict";
  17612. __webpack_require__.r(__webpack_exports__);
  17613. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17614. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17615. /* harmony export */ });
  17616. /* 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");
  17617. /* 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__);
  17618. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17619. var options = {};
  17620. options.insert = "head";
  17621. options.singleton = false;
  17622. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17623. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17624. /***/ }),
  17625. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17626. /*!******************************************************!*\
  17627. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17628. \******************************************************/
  17629. /***/ ((__unused_webpack_module, exports) => {
  17630. "use strict";
  17631. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17632. // runtime helper for setting properties on components
  17633. // in a tree-shakable way
  17634. exports["default"] = (sfc, props) => {
  17635. const target = sfc.__vccOpts || sfc;
  17636. for (const [key, val] of props) {
  17637. target[key] = val;
  17638. }
  17639. return target;
  17640. };
  17641. /***/ }),
  17642. /***/ "./resources/js/components/AppDropdown.vue":
  17643. /*!*************************************************!*\
  17644. !*** ./resources/js/components/AppDropdown.vue ***!
  17645. \*************************************************/
  17646. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17647. "use strict";
  17648. __webpack_require__.r(__webpack_exports__);
  17649. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17650. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17651. /* harmony export */ });
  17652. /* harmony import */ var _AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992");
  17653. /* harmony import */ var _AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  17654. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17655. ;
  17656. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppDropdown.vue"]])
  17657. /* hot reload */
  17658. if (false) {}
  17659. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17660. /***/ }),
  17661. /***/ "./resources/js/components/AppFooter.vue":
  17662. /*!***********************************************!*\
  17663. !*** ./resources/js/components/AppFooter.vue ***!
  17664. \***********************************************/
  17665. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17666. "use strict";
  17667. __webpack_require__.r(__webpack_exports__);
  17668. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17669. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17670. /* harmony export */ });
  17671. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17672. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17673. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17674. const script = {}
  17675. ;
  17676. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17677. /* hot reload */
  17678. if (false) {}
  17679. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17680. /***/ }),
  17681. /***/ "./resources/js/components/AppInputText.vue":
  17682. /*!**************************************************!*\
  17683. !*** ./resources/js/components/AppInputText.vue ***!
  17684. \**************************************************/
  17685. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17686. "use strict";
  17687. __webpack_require__.r(__webpack_exports__);
  17688. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17689. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17690. /* harmony export */ });
  17691. /* harmony import */ var _AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=template&id=16729fe1 */ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1");
  17692. /* harmony import */ var _AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js");
  17693. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17694. ;
  17695. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppInputText.vue"]])
  17696. /* hot reload */
  17697. if (false) {}
  17698. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17699. /***/ }),
  17700. /***/ "./resources/js/components/AppMessage.vue":
  17701. /*!************************************************!*\
  17702. !*** ./resources/js/components/AppMessage.vue ***!
  17703. \************************************************/
  17704. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17705. "use strict";
  17706. __webpack_require__.r(__webpack_exports__);
  17707. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17708. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17709. /* harmony export */ });
  17710. /* 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");
  17711. /* 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");
  17712. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17713. ;
  17714. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17715. /* hot reload */
  17716. if (false) {}
  17717. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17718. /***/ }),
  17719. /***/ "./resources/js/components/AppSidebar.vue":
  17720. /*!************************************************!*\
  17721. !*** ./resources/js/components/AppSidebar.vue ***!
  17722. \************************************************/
  17723. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17724. "use strict";
  17725. __webpack_require__.r(__webpack_exports__);
  17726. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17727. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17728. /* harmony export */ });
  17729. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17730. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17731. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17732. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17733. ;
  17734. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17735. /* hot reload */
  17736. if (false) {}
  17737. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17738. /***/ }),
  17739. /***/ "./resources/js/components/AppSubSidebar.vue":
  17740. /*!***************************************************!*\
  17741. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17742. \***************************************************/
  17743. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17744. "use strict";
  17745. __webpack_require__.r(__webpack_exports__);
  17746. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17747. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17748. /* harmony export */ });
  17749. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17750. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17751. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17752. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17753. ;
  17754. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17755. /* hot reload */
  17756. if (false) {}
  17757. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17758. /***/ }),
  17759. /***/ "./resources/js/components/AppTopBar.vue":
  17760. /*!***********************************************!*\
  17761. !*** ./resources/js/components/AppTopBar.vue ***!
  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": () => (__WEBPACK_DEFAULT_EXPORT__)
  17768. /* harmony export */ });
  17769. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17770. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17771. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17772. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17773. ;
  17774. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17775. /* hot reload */
  17776. if (false) {}
  17777. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17778. /***/ }),
  17779. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17780. /*!**************************************************!*\
  17781. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17782. \**************************************************/
  17783. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17784. "use strict";
  17785. __webpack_require__.r(__webpack_exports__);
  17786. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17787. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17788. /* harmony export */ });
  17789. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17790. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17791. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17792. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17793. ;
  17794. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17795. /* hot reload */
  17796. if (false) {}
  17797. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17798. /***/ }),
  17799. /***/ "./resources/js/pages/transaction/Create.vue":
  17800. /*!***************************************************!*\
  17801. !*** ./resources/js/pages/transaction/Create.vue ***!
  17802. \***************************************************/
  17803. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17804. "use strict";
  17805. __webpack_require__.r(__webpack_exports__);
  17806. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17807. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17808. /* harmony export */ });
  17809. /* harmony import */ var _Create_vue_vue_type_template_id_2717ac16__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Create.vue?vue&type=template&id=2717ac16 */ "./resources/js/pages/transaction/Create.vue?vue&type=template&id=2717ac16");
  17810. /* harmony import */ var _Create_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Create.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/transaction/Create.vue?vue&type=script&setup=true&lang=js");
  17811. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17812. ;
  17813. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Create_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Create_vue_vue_type_template_id_2717ac16__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/transaction/Create.vue"]])
  17814. /* hot reload */
  17815. if (false) {}
  17816. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17817. /***/ }),
  17818. /***/ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  17819. /*!************************************************************************************!*\
  17820. !*** ./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  17821. \************************************************************************************/
  17822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17823. "use strict";
  17824. __webpack_require__.r(__webpack_exports__);
  17825. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17826. /* harmony export */ "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_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17827. /* harmony export */ });
  17828. /* 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_AppDropdown_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]!./AppDropdown.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/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  17829. /***/ }),
  17830. /***/ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  17831. /*!*************************************************************************************!*\
  17832. !*** ./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  17833. \*************************************************************************************/
  17834. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17835. "use strict";
  17836. __webpack_require__.r(__webpack_exports__);
  17837. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17838. /* harmony export */ "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_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17839. /* harmony export */ });
  17840. /* 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_AppInputText_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]!./AppInputText.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/AppInputText.vue?vue&type=script&setup=true&lang=js");
  17841. /***/ }),
  17842. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17843. /*!***********************************************************************************!*\
  17844. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17845. \***********************************************************************************/
  17846. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17847. "use strict";
  17848. __webpack_require__.r(__webpack_exports__);
  17849. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17850. /* harmony export */ "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"])
  17851. /* harmony export */ });
  17852. /* 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");
  17853. /***/ }),
  17854. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17855. /*!***********************************************************************************!*\
  17856. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17857. \***********************************************************************************/
  17858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17859. "use strict";
  17860. __webpack_require__.r(__webpack_exports__);
  17861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17862. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17863. /* harmony export */ });
  17864. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17865. /***/ }),
  17866. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17867. /*!**************************************************************************************!*\
  17868. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17869. \**************************************************************************************/
  17870. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17871. "use strict";
  17872. __webpack_require__.r(__webpack_exports__);
  17873. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17874. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17875. /* harmony export */ });
  17876. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17877. /***/ }),
  17878. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17879. /*!**********************************************************************************!*\
  17880. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17881. \**********************************************************************************/
  17882. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17883. "use strict";
  17884. __webpack_require__.r(__webpack_exports__);
  17885. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17886. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17887. /* harmony export */ });
  17888. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17889. /***/ }),
  17890. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17891. /*!*************************************************************************************!*\
  17892. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17893. \*************************************************************************************/
  17894. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17895. "use strict";
  17896. __webpack_require__.r(__webpack_exports__);
  17897. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17898. /* harmony export */ "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"])
  17899. /* harmony export */ });
  17900. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17901. /***/ }),
  17902. /***/ "./resources/js/pages/transaction/Create.vue?vue&type=script&setup=true&lang=js":
  17903. /*!**************************************************************************************!*\
  17904. !*** ./resources/js/pages/transaction/Create.vue?vue&type=script&setup=true&lang=js ***!
  17905. \**************************************************************************************/
  17906. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17907. "use strict";
  17908. __webpack_require__.r(__webpack_exports__);
  17909. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17910. /* 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_Create_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17911. /* harmony export */ });
  17912. /* 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_Create_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]!./Create.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/transaction/Create.vue?vue&type=script&setup=true&lang=js");
  17913. /***/ }),
  17914. /***/ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  17915. /*!*******************************************************************************!*\
  17916. !*** ./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  17917. \*******************************************************************************/
  17918. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17919. "use strict";
  17920. __webpack_require__.r(__webpack_exports__);
  17921. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17922. /* 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_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render)
  17923. /* harmony export */ });
  17924. /* 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_AppDropdown_vue_vue_type_template_id_ce0d1992__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]!./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppDropdown.vue?vue&type=template&id=ce0d1992");
  17925. /***/ }),
  17926. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17927. /*!*****************************************************************************************!*\
  17928. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17929. \*****************************************************************************************/
  17930. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17931. "use strict";
  17932. __webpack_require__.r(__webpack_exports__);
  17933. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17934. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17935. /* harmony export */ });
  17936. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17937. /***/ }),
  17938. /***/ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  17939. /*!********************************************************************************!*\
  17940. !*** ./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  17941. \********************************************************************************/
  17942. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17943. "use strict";
  17944. __webpack_require__.r(__webpack_exports__);
  17945. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17946. /* 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_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render)
  17947. /* harmony export */ });
  17948. /* 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_AppInputText_vue_vue_type_template_id_16729fe1__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]!./AppInputText.vue?vue&type=template&id=16729fe1 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1");
  17949. /***/ }),
  17950. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17951. /*!******************************************************************************!*\
  17952. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17953. \******************************************************************************/
  17954. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17955. "use strict";
  17956. __webpack_require__.r(__webpack_exports__);
  17957. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17958. /* 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)
  17959. /* harmony export */ });
  17960. /* 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");
  17961. /***/ }),
  17962. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17963. /*!******************************************************************************************!*\
  17964. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17965. \******************************************************************************************/
  17966. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17967. "use strict";
  17968. __webpack_require__.r(__webpack_exports__);
  17969. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17970. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17971. /* harmony export */ });
  17972. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17973. /***/ }),
  17974. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17975. /*!*********************************************************************************************!*\
  17976. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17977. \*********************************************************************************************/
  17978. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17979. "use strict";
  17980. __webpack_require__.r(__webpack_exports__);
  17981. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17982. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17983. /* harmony export */ });
  17984. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17985. /***/ }),
  17986. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17987. /*!*****************************************************************************************!*\
  17988. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17989. \*****************************************************************************************/
  17990. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17991. "use strict";
  17992. __webpack_require__.r(__webpack_exports__);
  17993. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17994. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17995. /* harmony export */ });
  17996. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17997. /***/ }),
  17998. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17999. /*!********************************************************************************************!*\
  18000. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  18001. \********************************************************************************************/
  18002. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18003. "use strict";
  18004. __webpack_require__.r(__webpack_exports__);
  18005. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18006. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  18007. /* harmony export */ });
  18008. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  18009. /***/ }),
  18010. /***/ "./resources/js/pages/transaction/Create.vue?vue&type=template&id=2717ac16":
  18011. /*!*********************************************************************************!*\
  18012. !*** ./resources/js/pages/transaction/Create.vue?vue&type=template&id=2717ac16 ***!
  18013. \*********************************************************************************/
  18014. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18015. "use strict";
  18016. __webpack_require__.r(__webpack_exports__);
  18017. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18018. /* 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_Create_vue_vue_type_template_id_2717ac16__WEBPACK_IMPORTED_MODULE_0__.render)
  18019. /* harmony export */ });
  18020. /* 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_Create_vue_vue_type_template_id_2717ac16__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]!./Create.vue?vue&type=template&id=2717ac16 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/transaction/Create.vue?vue&type=template&id=2717ac16");
  18021. /***/ }),
  18022. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  18023. /*!********************************************************************************************************!*\
  18024. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  18025. \********************************************************************************************************/
  18026. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18027. "use strict";
  18028. __webpack_require__.r(__webpack_exports__);
  18029. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  18030. /***/ }),
  18031. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  18032. /*!*********************************************************************************************************!*\
  18033. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  18034. \*********************************************************************************************************/
  18035. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18036. "use strict";
  18037. __webpack_require__.r(__webpack_exports__);
  18038. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  18039. /***/ }),
  18040. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  18041. /*!************************************************************************************************************!*\
  18042. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  18043. \************************************************************************************************************/
  18044. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18045. "use strict";
  18046. __webpack_require__.r(__webpack_exports__);
  18047. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  18048. /***/ }),
  18049. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  18050. /*!********************************************************************************************************!*\
  18051. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  18052. \********************************************************************************************************/
  18053. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18054. "use strict";
  18055. __webpack_require__.r(__webpack_exports__);
  18056. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  18057. /***/ }),
  18058. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18059. /*!***********************************************************************************************************!*\
  18060. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18061. \***********************************************************************************************************/
  18062. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18063. "use strict";
  18064. __webpack_require__.r(__webpack_exports__);
  18065. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  18066. /***/ })
  18067. }]);