resources_js_pages_topup_Index_vue.js 705KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_topup_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!***********************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \***********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  269. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/topup/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  276. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  279. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  280. props: {
  281. topUp: Object,
  282. initialSearch: String,
  283. initialDateRange: Array
  284. },
  285. setup: function setup(__props, _ref) {
  286. var expose = _ref.expose;
  287. expose();
  288. var props = __props;
  289. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  290. search = _useSearchText.search;
  291. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter)(props),
  292. dates = _useDateRangeFilter.dates,
  293. startDate = _useDateRangeFilter.startDate,
  294. endDate = _useDateRangeFilter.endDate;
  295. (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)([dates, search], function () {
  296. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  297. startDate: startDate.value,
  298. endDate: endDate.value,
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var filterReset = function filterReset() {
  305. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups');
  306. };
  307. var __returned__ = {
  308. props: props,
  309. search: search,
  310. dates: dates,
  311. startDate: startDate,
  312. endDate: endDate,
  313. filterReset: filterReset,
  314. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  315. watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
  316. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  317. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  318. indexTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.indexTable,
  319. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  320. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter,
  321. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  322. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  323. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__["default"]
  324. };
  325. Object.defineProperty(__returned__, '__isScriptSetup', {
  326. enumerable: false,
  327. value: true
  328. });
  329. return __returned__;
  330. }
  331. });
  332. /***/ }),
  333. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  334. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  335. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  336. \***********************************************************************************************************************************************************************************************************************************************************************************/
  337. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  338. "use strict";
  339. __webpack_require__.r(__webpack_exports__);
  340. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  341. /* harmony export */ "render": () => (/* binding */ render)
  342. /* harmony export */ });
  343. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  344. var _hoisted_1 = {
  345. key: 1,
  346. "class": "p-button-label"
  347. };
  348. var _hoisted_2 = {
  349. key: 1,
  350. "class": "p-button-label"
  351. };
  352. function render(_ctx, _cache, $props, $setup, $data, $options) {
  353. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  354. key: 0,
  355. "class": "p-button p-component",
  356. as: "button",
  357. type: "button"
  358. }, {
  359. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  360. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  361. key: 0,
  362. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  363. }, null, 2
  364. /* CLASS */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  366. /* TEXT */
  367. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  368. }),
  369. _: 1
  370. /* STABLE */
  371. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  372. key: 1,
  373. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  374. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  375. key: 0,
  376. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  377. }, null, 2
  378. /* CLASS */
  379. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  380. /* TEXT */
  381. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  382. /* CLASS */
  383. ));
  384. }
  385. /***/ }),
  386. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  387. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  388. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  389. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  390. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  391. "use strict";
  392. __webpack_require__.r(__webpack_exports__);
  393. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  394. /* harmony export */ "render": () => (/* binding */ render)
  395. /* harmony export */ });
  396. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  397. var _withScopeId = function _withScopeId(n) {
  398. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  399. };
  400. var _hoisted_1 = {
  401. "class": "layout-footer"
  402. };
  403. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  404. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  405. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  406. href: "https://dijitalcode.com",
  407. target: "_blank",
  408. "class": "font-medium ml-2"
  409. }, "DijitalCODE", -1
  410. /* HOISTED */
  411. );
  412. });
  413. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  414. function render(_ctx, _cache) {
  415. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  416. }
  417. /***/ }),
  418. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  419. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  420. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  421. \********************************************************************************************************************************************************************************************************************************************************************************/
  422. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  423. "use strict";
  424. __webpack_require__.r(__webpack_exports__);
  425. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  426. /* harmony export */ "render": () => (/* binding */ render)
  427. /* harmony export */ });
  428. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  429. var _hoisted_1 = {
  430. key: 0
  431. };
  432. var _hoisted_2 = {
  433. key: 1
  434. };
  435. function render(_ctx, _cache, $props, $setup, $data, $options) {
  436. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  437. 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, {
  438. key: 0,
  439. severity: "success",
  440. onClose: $setup.onClose
  441. }, {
  442. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  443. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  444. /* TEXT */
  445. )];
  446. }),
  447. _: 1
  448. /* STABLE */
  449. })) : (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, {
  450. key: 1,
  451. severity: "error",
  452. onClose: $setup.onClose
  453. }, {
  454. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  455. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  456. /* TEXT */
  457. )];
  458. }),
  459. _: 1
  460. /* STABLE */
  461. })) : (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, {
  462. key: 2,
  463. severity: "error",
  464. onClose: $setup.onClose
  465. }, {
  466. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  467. 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
  468. /* TEXT */
  469. ))];
  470. }),
  471. _: 1
  472. /* STABLE */
  473. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  474. /* STABLE_FRAGMENT */
  475. );
  476. }
  477. /***/ }),
  478. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  479. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  480. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  481. \***********************************************************************************************************************************************************************************************************************************************************************************/
  482. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  483. "use strict";
  484. __webpack_require__.r(__webpack_exports__);
  485. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  486. /* harmony export */ "render": () => (/* binding */ render)
  487. /* harmony export */ });
  488. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  489. var _hoisted_1 = {
  490. key: 0,
  491. "class": "p-paginator p-component flex justify-content-start"
  492. };
  493. var _hoisted_2 = {
  494. "class": "p-paginator-pages"
  495. };
  496. var _hoisted_3 = ["innerHTML"];
  497. function render(_ctx, _cache, $props, $setup, $data, $options) {
  498. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  499. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  500. key: "link-".concat(key),
  501. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  502. 'p-disabled': link
  503. }]),
  504. innerHTML: link.label
  505. }, null, 10
  506. /* CLASS, PROPS */
  507. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  508. key: "link-".concat(key),
  509. href: link.url,
  510. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  511. 'p-highlight': link.active
  512. }, "p-paginator-page p-paginator-element p-link"]),
  513. innerHTML: link.label
  514. }, null, 8
  515. /* PROPS */
  516. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  517. /* STABLE_FRAGMENT */
  518. );
  519. }), 256
  520. /* UNKEYED_FRAGMENT */
  521. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  522. }
  523. /***/ }),
  524. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  525. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  526. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  527. \********************************************************************************************************************************************************************************************************************************************************************************************/
  528. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  529. "use strict";
  530. __webpack_require__.r(__webpack_exports__);
  531. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  532. /* harmony export */ "render": () => (/* binding */ render)
  533. /* harmony export */ });
  534. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  535. function render(_ctx, _cache, $props, $setup, $data, $options) {
  536. 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"], {
  537. "class": "layout-menu",
  538. items: $props.menu,
  539. root: true
  540. }, null, 8
  541. /* PROPS */
  542. , ["items"])]);
  543. }
  544. /***/ }),
  545. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  546. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  547. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  548. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  550. "use strict";
  551. __webpack_require__.r(__webpack_exports__);
  552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  553. /* harmony export */ "render": () => (/* binding */ render)
  554. /* harmony export */ });
  555. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  556. var _withScopeId = function _withScopeId(n) {
  557. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  558. };
  559. var _hoisted_1 = {
  560. key: 0
  561. };
  562. var _hoisted_2 = ["aria-label"];
  563. var _hoisted_3 = ["aria-label"];
  564. function render(_ctx, _cache, $props, $setup, $data, $options) {
  565. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  566. 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) {
  567. 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", {
  568. key: i,
  569. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  570. 'layout-menuitem-category': $props.root
  571. }]),
  572. role: "none"
  573. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  574. key: 0
  575. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  576. "class": "layout-menuitem-root-text",
  577. "aria-label": item.label
  578. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  579. /* TEXT, PROPS */
  580. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  581. items: item.items
  582. }, null, 8
  583. /* PROPS */
  584. , ["items"])], 64
  585. /* STABLE_FRAGMENT */
  586. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  587. key: 1
  588. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  589. key: 0,
  590. role: "menuitem",
  591. href: item.to,
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  593. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  594. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  595. }]),
  596. "aria-label": item.label
  597. }, {
  598. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  599. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  600. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  601. }, null, 2
  602. /* CLASS */
  603. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  604. /* TEXT */
  605. )];
  606. }),
  607. _: 2
  608. /* DYNAMIC */
  609. }, 1032
  610. /* PROPS, DYNAMIC_SLOTS */
  611. , ["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", {
  612. key: 1,
  613. href: "#",
  614. role: "menuitem",
  615. "aria-label": item.label
  616. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  617. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  618. }, null, 2
  619. /* CLASS */
  620. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  621. /* TEXT */
  622. )], 8
  623. /* PROPS */
  624. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  625. items: item.items
  626. }, null, 8
  627. /* PROPS */
  628. , ["items"])], 64
  629. /* STABLE_FRAGMENT */
  630. ))], 2
  631. /* CLASS */
  632. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  633. /* STABLE_FRAGMENT */
  634. );
  635. }), 256
  636. /* UNKEYED_FRAGMENT */
  637. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  638. }
  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/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  641. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  642. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  643. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  645. "use strict";
  646. __webpack_require__.r(__webpack_exports__);
  647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  648. /* harmony export */ "render": () => (/* binding */ render)
  649. /* harmony export */ });
  650. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  651. var _withScopeId = function _withScopeId(n) {
  652. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  653. };
  654. var _hoisted_1 = {
  655. "class": "layout-topbar"
  656. };
  657. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  658. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  659. alt: "Logo",
  660. src: "/images/logo.svg",
  661. "class": "md:mr-3"
  662. }, null, -1
  663. /* HOISTED */
  664. );
  665. });
  666. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  668. /* HOISTED */
  669. );
  670. });
  671. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  672. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  673. "class": "pi pi-bars"
  674. }, null, -1
  675. /* HOISTED */
  676. );
  677. });
  678. var _hoisted_5 = [_hoisted_4];
  679. var _hoisted_6 = {
  680. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  681. };
  682. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  683. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  684. "class": "pi pi-ellipsis-v"
  685. }, null, -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_8 = [_hoisted_7];
  690. var _hoisted_9 = {
  691. "class": "layout-topbar-menu hidden lg:flex origin-top"
  692. };
  693. var _hoisted_10 = {
  694. "class": "align-self-center"
  695. };
  696. var _hoisted_11 = {
  697. "class": "hidden lg:inline"
  698. };
  699. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  700. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  701. "class": "pi pi-user"
  702. }, null, -1
  703. /* HOISTED */
  704. );
  705. });
  706. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  707. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  708. /* HOISTED */
  709. );
  710. });
  711. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  712. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  713. "class": "pi pi-sign-out"
  714. }, null, -1
  715. /* HOISTED */
  716. );
  717. });
  718. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  719. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  720. /* HOISTED */
  721. );
  722. });
  723. function render(_ctx, _cache, $props, $setup, $data, $options) {
  724. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  725. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  726. 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"], {
  727. href: "/",
  728. "class": "layout-topbar-logo"
  729. }, {
  730. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  731. return [_hoisted_2, _hoisted_3];
  732. }),
  733. _: 1
  734. /* STABLE */
  735. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  736. "class": "p-link layout-menu-button layout-topbar-button",
  737. onClick: _cache[0] || (_cache[0] = function ($event) {
  738. return _ctx.$emit('menu-toggle', $event);
  739. })
  740. }, _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, {
  741. selector: '@next',
  742. enterClass: 'hidden',
  743. enterActiveClass: 'scalein',
  744. leaveToClass: 'hidden',
  745. leaveActiveClass: 'fadeout',
  746. hideOnOutsideClick: true
  747. }]]), (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
  748. /* TEXT */
  749. )]), (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"], {
  750. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  751. "class": "p-link layout-topbar-button"
  752. }, {
  753. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  754. return [_hoisted_12, _hoisted_13];
  755. }),
  756. _: 1
  757. /* STABLE */
  758. }, 8
  759. /* PROPS */
  760. , ["href"])), [[_directive_tooltip, {
  761. value: 'Ubah Profil',
  762. "class": 'layout-topbar-menu-tooltip'
  763. }, void 0, {
  764. bottom: true
  765. }]])]), (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"], {
  766. href: _ctx.route('logout'),
  767. as: "button",
  768. method: "post",
  769. "class": "p-link layout-topbar-button"
  770. }, {
  771. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  772. return [_hoisted_14, _hoisted_15];
  773. }),
  774. _: 1
  775. /* STABLE */
  776. }, 8
  777. /* PROPS */
  778. , ["href"])), [[_directive_tooltip, {
  779. value: 'Keluar',
  780. "class": 'layout-topbar-menu-tooltip'
  781. }, void 0, {
  782. bottom: true
  783. }]])])])]);
  784. }
  785. /***/ }),
  786. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  787. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  788. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  789. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  790. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  791. "use strict";
  792. __webpack_require__.r(__webpack_exports__);
  793. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  794. /* harmony export */ "render": () => (/* binding */ render)
  795. /* harmony export */ });
  796. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  797. var _withScopeId = function _withScopeId(n) {
  798. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  799. };
  800. var _hoisted_1 = {
  801. "class": "layout-sidebar"
  802. };
  803. var _hoisted_2 = {
  804. "class": "layout-main-container"
  805. };
  806. var _hoisted_3 = {
  807. "class": "layout-main"
  808. };
  809. var _hoisted_4 = {
  810. key: 0,
  811. "class": "layout-mask p-component-overlay"
  812. };
  813. function render(_ctx, _cache, $props, $setup, $data, $options) {
  814. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  815. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  816. onClick: $setup.onWrapperClick
  817. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  818. onMenuToggle: $setup.onMenuToggle
  819. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  820. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  821. }, null, 8
  822. /* PROPS */
  823. , ["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, {
  824. name: "layout-mask"
  825. }, {
  826. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  827. 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)];
  828. }),
  829. _: 1
  830. /* STABLE */
  831. })], 2
  832. /* CLASS */
  833. );
  834. }
  835. /***/ }),
  836. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/topup/Index.vue?vue&type=template&id=3bf54f8c":
  837. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  838. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  839. \****************************************************************************************************************************************************************************************************************************************************************************/
  840. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  841. "use strict";
  842. __webpack_require__.r(__webpack_exports__);
  843. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  844. /* harmony export */ "render": () => (/* binding */ render)
  845. /* harmony export */ });
  846. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  847. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Top Up", -1
  848. /* HOISTED */
  849. );
  850. var _hoisted_2 = {
  851. "class": "grid"
  852. };
  853. var _hoisted_3 = {
  854. "class": "col-12 md:col-8"
  855. };
  856. var _hoisted_4 = {
  857. "class": "grid"
  858. };
  859. var _hoisted_5 = {
  860. "class": "col-12 md:col-3"
  861. };
  862. var _hoisted_6 = {
  863. "class": "col-12 md:col-3"
  864. };
  865. var _hoisted_7 = {
  866. "class": "col-auto mt-2 ml-2"
  867. };
  868. var _hoisted_8 = {
  869. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  870. };
  871. function render(_ctx, _cache, $props, $setup, $data, $options) {
  872. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  873. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  874. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  875. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  876. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  877. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  878. title: "Top Up"
  879. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  880. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  881. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  882. "responsive-layout": "scroll",
  883. "column-resize-mode": "expand",
  884. value: $props.topUp.data,
  885. "row-hover": true,
  886. "striped-rows": true
  887. }, {
  888. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  889. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  890. "class": "w-full",
  891. placeholder: "cari, contoh: tina",
  892. modelValue: $setup.search,
  893. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  894. return $setup.search = $event;
  895. })
  896. }, null, 8
  897. /* PROPS */
  898. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  899. "touch-u-i": "",
  900. "class": "w-full",
  901. modelValue: $setup.dates,
  902. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  903. return $setup.dates = $event;
  904. }),
  905. "selection-mode": "range",
  906. placeholder: "filter waktu...",
  907. "date-format": "dd/mm/yy",
  908. "manual-input": false
  909. }, null, 8
  910. /* PROPS */
  911. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  912. label: "reset",
  913. "class": "p-button-link",
  914. onClick: $setup.filterReset
  915. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  916. label: "Top Up",
  917. "class": "p-button-outlined",
  918. icon: "pi pi-pencil",
  919. href: _ctx.route('top-ups.create')
  920. }, null, 8
  921. /* PROPS */
  922. , ["href"])])])];
  923. }),
  924. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  925. 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) {
  926. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  927. field: value.field,
  928. header: value.header,
  929. key: value.field
  930. }, null, 8
  931. /* PROPS */
  932. , ["field", "header"]);
  933. }), 128
  934. /* KEYED_FRAGMENT */
  935. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  936. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  937. var data = _ref.data;
  938. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  939. icon: "pi pi-eye",
  940. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  941. href: _ctx.route('top-ups.show', data.id)
  942. }, null, 8
  943. /* PROPS */
  944. , ["href"])];
  945. }),
  946. _: 1
  947. /* STABLE */
  948. })];
  949. }),
  950. _: 1
  951. /* STABLE */
  952. }, 8
  953. /* PROPS */
  954. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  955. links: $props.topUp.links
  956. }, null, 8
  957. /* PROPS */
  958. , ["links"])];
  959. }),
  960. _: 1
  961. /* STABLE */
  962. })], 64
  963. /* STABLE_FRAGMENT */
  964. );
  965. }
  966. /***/ }),
  967. /***/ "./resources/js/components/useDateRangeFilter.js":
  968. /*!*******************************************************!*\
  969. !*** ./resources/js/components/useDateRangeFilter.js ***!
  970. \*******************************************************/
  971. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  972. "use strict";
  973. __webpack_require__.r(__webpack_exports__);
  974. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  975. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  976. /* harmony export */ });
  977. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  978. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  979. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  980. function useDateRangeFilter(props) {
  981. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  982. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  983. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  984. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  985. if (!props.initialDateRange) {
  986. return;
  987. }
  988. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  989. if (props.initialDateRange[1]) {
  990. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  991. } else {
  992. dates.value = [new Date(props.props.initialDateRange[1]), null];
  993. }
  994. }
  995. });
  996. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  997. if (dates.value[1]) {
  998. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  999. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  1000. } else if (dates.value[0]) {
  1001. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1002. endDate.value = null;
  1003. }
  1004. });
  1005. return {
  1006. dates: dates,
  1007. startDate: startDate,
  1008. endDate: endDate
  1009. };
  1010. }
  1011. /***/ }),
  1012. /***/ "./resources/js/components/useSearchText.js":
  1013. /*!**************************************************!*\
  1014. !*** ./resources/js/components/useSearchText.js ***!
  1015. \**************************************************/
  1016. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1017. "use strict";
  1018. __webpack_require__.r(__webpack_exports__);
  1019. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1020. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  1021. /* harmony export */ });
  1022. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1023. function useSearchText(props) {
  1024. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  1025. return {
  1026. search: search
  1027. };
  1028. }
  1029. /***/ }),
  1030. /***/ "./resources/js/pages/topup/tableHeader.js":
  1031. /*!*************************************************!*\
  1032. !*** ./resources/js/pages/topup/tableHeader.js ***!
  1033. \*************************************************/
  1034. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1035. "use strict";
  1036. __webpack_require__.r(__webpack_exports__);
  1037. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1038. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1039. /* harmony export */ "topUpTable": () => (/* binding */ topUpTable)
  1040. /* harmony export */ });
  1041. var indexTable = [{
  1042. field: 'updatedAt',
  1043. header: 'Diperbaharui'
  1044. }, {
  1045. field: 'name',
  1046. header: 'Nama'
  1047. }, {
  1048. field: 'platNumber',
  1049. header: 'Plat Kendaraan'
  1050. }, {
  1051. field: 'type',
  1052. header: 'Jenis Member'
  1053. }, {
  1054. field: 'amount',
  1055. header: 'Tarif Member'
  1056. }, {
  1057. field: 'expDate',
  1058. header: 'Berakhir'
  1059. }];
  1060. var topUpTable = [{
  1061. field: 'updatedAt',
  1062. header: 'Diperbaharui'
  1063. }, {
  1064. field: 'name',
  1065. header: 'Petugas Parkir'
  1066. }, {
  1067. field: 'platNumber',
  1068. header: 'Plat Kendaraan'
  1069. }, {
  1070. field: 'type',
  1071. header: 'Jenis Member'
  1072. }, {
  1073. field: 'amount',
  1074. header: 'Tarif Member'
  1075. }, {
  1076. field: 'expDate',
  1077. header: 'Berakhir'
  1078. }];
  1079. /***/ }),
  1080. /***/ "./resources/js/utils/menu.js":
  1081. /*!************************************!*\
  1082. !*** ./resources/js/utils/menu.js ***!
  1083. \************************************/
  1084. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1085. "use strict";
  1086. __webpack_require__.r(__webpack_exports__);
  1087. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1088. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1089. /* harmony export */ });
  1090. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1091. // Admin
  1092. 1: [{
  1093. label: 'Home',
  1094. items: [{
  1095. label: 'Dashboard',
  1096. icon: 'pi pi-home',
  1097. to: '/dashboards',
  1098. component: 'home/Index'
  1099. }]
  1100. }, {
  1101. label: 'Master',
  1102. items: [{
  1103. label: 'User',
  1104. icon: 'pi pi-user',
  1105. to: '/users',
  1106. component: 'user/Index'
  1107. }]
  1108. }],
  1109. // Supervisor
  1110. 2: [{
  1111. label: 'Home',
  1112. items: [{
  1113. label: 'Dashboard',
  1114. icon: 'pi pi-home',
  1115. to: '/dashboards',
  1116. component: 'home/Index'
  1117. }]
  1118. }, {
  1119. label: 'Menu',
  1120. items: [{
  1121. label: 'Pengeluaran',
  1122. icon: 'pi pi-wallet',
  1123. to: '/expenses',
  1124. component: 'expense/Index'
  1125. }, {
  1126. label: 'Laporan',
  1127. icon: 'pi pi-book',
  1128. items: [{
  1129. label: 'Mutasi',
  1130. icon: 'pi pi-circle',
  1131. to: '/reports/mutations',
  1132. component: 'mutation/Report'
  1133. }]
  1134. }]
  1135. }, {
  1136. label: 'Master',
  1137. items: [{
  1138. label: 'Jenis Kendaraan',
  1139. icon: 'pi pi-car',
  1140. to: '/type-vehicles',
  1141. component: 'typevehicle/Index'
  1142. }, {
  1143. label: 'Jenis Member',
  1144. icon: 'pi pi-id-card',
  1145. to: '/type-members',
  1146. component: 'typemember/Index'
  1147. }]
  1148. }, {
  1149. label: 'Pengaturan',
  1150. items: [{
  1151. label: 'Tarif Parkir',
  1152. icon: 'pi pi-car',
  1153. to: '/parking-fees/create',
  1154. component: 'parkingfee/Create'
  1155. }]
  1156. }],
  1157. // Operator
  1158. 3: [{
  1159. label: 'Home',
  1160. items: [{
  1161. label: 'Dashboard',
  1162. icon: 'pi pi-home',
  1163. to: '/dashboards',
  1164. component: 'home/Index'
  1165. }]
  1166. }, {
  1167. label: 'Transaksi',
  1168. items: [{
  1169. label: 'Transaksi masuk dan keluar',
  1170. icon: 'pi pi-car',
  1171. to: '/transactions/create',
  1172. component: 'transaction/Create'
  1173. }]
  1174. }, {
  1175. label: 'Menu',
  1176. items: [{
  1177. label: 'Pengeluaran',
  1178. icon: 'pi pi-wallet',
  1179. to: '/expenses',
  1180. component: 'expense/Index'
  1181. }, {
  1182. label: 'Member',
  1183. icon: 'pi pi-id-card',
  1184. to: '/members',
  1185. component: 'member/Index'
  1186. }, {
  1187. label: 'Top Up',
  1188. icon: 'pi pi-car',
  1189. to: '/top-ups',
  1190. component: 'topup/Index'
  1191. }]
  1192. }, {
  1193. label: 'Not Production',
  1194. items: [{
  1195. label: 'Test Transactions',
  1196. icon: 'pi pi-car',
  1197. to: '/test-transactions/create',
  1198. component: 'test-transaction/Create'
  1199. }]
  1200. }]
  1201. });
  1202. /***/ }),
  1203. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1204. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1205. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1206. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1207. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1208. "use strict";
  1209. __webpack_require__.r(__webpack_exports__);
  1210. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1211. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1212. /* harmony export */ });
  1213. /* 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");
  1214. /* 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__);
  1215. // Imports
  1216. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1217. // Module
  1218. ___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}", ""]);
  1219. // Exports
  1220. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1221. /***/ }),
  1222. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1223. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1224. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1225. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1226. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1227. "use strict";
  1228. __webpack_require__.r(__webpack_exports__);
  1229. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1230. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1231. /* harmony export */ });
  1232. /* 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");
  1233. /* 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__);
  1234. // Imports
  1235. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1236. // Module
  1237. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1238. // Exports
  1239. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1240. /***/ }),
  1241. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1242. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1243. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1244. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1245. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1246. "use strict";
  1247. __webpack_require__.r(__webpack_exports__);
  1248. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1249. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1250. /* harmony export */ });
  1251. /* 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");
  1252. /* 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__);
  1253. // Imports
  1254. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1255. // Module
  1256. ___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}", ""]);
  1257. // Exports
  1258. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1259. /***/ }),
  1260. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1261. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1262. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1263. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1264. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1265. "use strict";
  1266. __webpack_require__.r(__webpack_exports__);
  1267. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1268. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1269. /* harmony export */ });
  1270. /* 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");
  1271. /* 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__);
  1272. // Imports
  1273. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1274. // Module
  1275. ___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}", ""]);
  1276. // Exports
  1277. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1278. /***/ }),
  1279. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1280. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1281. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1282. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1283. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1284. "use strict";
  1285. __webpack_require__.r(__webpack_exports__);
  1286. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1287. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1288. /* harmony export */ });
  1289. /* 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");
  1290. /* 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__);
  1291. // Imports
  1292. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1293. // Module
  1294. ___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}", ""]);
  1295. // Exports
  1296. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1297. /***/ }),
  1298. /***/ "./node_modules/dayjs/dayjs.min.js":
  1299. /*!*****************************************!*\
  1300. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1301. \*****************************************/
  1302. /***/ (function(module) {
  1303. !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
  1304. /***/ }),
  1305. /***/ "./node_modules/lodash/lodash.js":
  1306. /*!***************************************!*\
  1307. !*** ./node_modules/lodash/lodash.js ***!
  1308. \***************************************/
  1309. /***/ (function(module, exports, __webpack_require__) {
  1310. /* module decorator */ module = __webpack_require__.nmd(module);
  1311. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1312. * @license
  1313. * Lodash <https://lodash.com/>
  1314. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1315. * Released under MIT license <https://lodash.com/license>
  1316. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1317. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1318. */
  1319. ;(function() {
  1320. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1321. var undefined;
  1322. /** Used as the semantic version number. */
  1323. var VERSION = '4.17.21';
  1324. /** Used as the size to enable large array optimizations. */
  1325. var LARGE_ARRAY_SIZE = 200;
  1326. /** Error message constants. */
  1327. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1328. FUNC_ERROR_TEXT = 'Expected a function',
  1329. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1330. /** Used to stand-in for `undefined` hash values. */
  1331. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1332. /** Used as the maximum memoize cache size. */
  1333. var MAX_MEMOIZE_SIZE = 500;
  1334. /** Used as the internal argument placeholder. */
  1335. var PLACEHOLDER = '__lodash_placeholder__';
  1336. /** Used to compose bitmasks for cloning. */
  1337. var CLONE_DEEP_FLAG = 1,
  1338. CLONE_FLAT_FLAG = 2,
  1339. CLONE_SYMBOLS_FLAG = 4;
  1340. /** Used to compose bitmasks for value comparisons. */
  1341. var COMPARE_PARTIAL_FLAG = 1,
  1342. COMPARE_UNORDERED_FLAG = 2;
  1343. /** Used to compose bitmasks for function metadata. */
  1344. var WRAP_BIND_FLAG = 1,
  1345. WRAP_BIND_KEY_FLAG = 2,
  1346. WRAP_CURRY_BOUND_FLAG = 4,
  1347. WRAP_CURRY_FLAG = 8,
  1348. WRAP_CURRY_RIGHT_FLAG = 16,
  1349. WRAP_PARTIAL_FLAG = 32,
  1350. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1351. WRAP_ARY_FLAG = 128,
  1352. WRAP_REARG_FLAG = 256,
  1353. WRAP_FLIP_FLAG = 512;
  1354. /** Used as default options for `_.truncate`. */
  1355. var DEFAULT_TRUNC_LENGTH = 30,
  1356. DEFAULT_TRUNC_OMISSION = '...';
  1357. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1358. var HOT_COUNT = 800,
  1359. HOT_SPAN = 16;
  1360. /** Used to indicate the type of lazy iteratees. */
  1361. var LAZY_FILTER_FLAG = 1,
  1362. LAZY_MAP_FLAG = 2,
  1363. LAZY_WHILE_FLAG = 3;
  1364. /** Used as references for various `Number` constants. */
  1365. var INFINITY = 1 / 0,
  1366. MAX_SAFE_INTEGER = 9007199254740991,
  1367. MAX_INTEGER = 1.7976931348623157e+308,
  1368. NAN = 0 / 0;
  1369. /** Used as references for the maximum length and index of an array. */
  1370. var MAX_ARRAY_LENGTH = 4294967295,
  1371. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1372. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1373. /** Used to associate wrap methods with their bit flags. */
  1374. var wrapFlags = [
  1375. ['ary', WRAP_ARY_FLAG],
  1376. ['bind', WRAP_BIND_FLAG],
  1377. ['bindKey', WRAP_BIND_KEY_FLAG],
  1378. ['curry', WRAP_CURRY_FLAG],
  1379. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1380. ['flip', WRAP_FLIP_FLAG],
  1381. ['partial', WRAP_PARTIAL_FLAG],
  1382. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1383. ['rearg', WRAP_REARG_FLAG]
  1384. ];
  1385. /** `Object#toString` result references. */
  1386. var argsTag = '[object Arguments]',
  1387. arrayTag = '[object Array]',
  1388. asyncTag = '[object AsyncFunction]',
  1389. boolTag = '[object Boolean]',
  1390. dateTag = '[object Date]',
  1391. domExcTag = '[object DOMException]',
  1392. errorTag = '[object Error]',
  1393. funcTag = '[object Function]',
  1394. genTag = '[object GeneratorFunction]',
  1395. mapTag = '[object Map]',
  1396. numberTag = '[object Number]',
  1397. nullTag = '[object Null]',
  1398. objectTag = '[object Object]',
  1399. promiseTag = '[object Promise]',
  1400. proxyTag = '[object Proxy]',
  1401. regexpTag = '[object RegExp]',
  1402. setTag = '[object Set]',
  1403. stringTag = '[object String]',
  1404. symbolTag = '[object Symbol]',
  1405. undefinedTag = '[object Undefined]',
  1406. weakMapTag = '[object WeakMap]',
  1407. weakSetTag = '[object WeakSet]';
  1408. var arrayBufferTag = '[object ArrayBuffer]',
  1409. dataViewTag = '[object DataView]',
  1410. float32Tag = '[object Float32Array]',
  1411. float64Tag = '[object Float64Array]',
  1412. int8Tag = '[object Int8Array]',
  1413. int16Tag = '[object Int16Array]',
  1414. int32Tag = '[object Int32Array]',
  1415. uint8Tag = '[object Uint8Array]',
  1416. uint8ClampedTag = '[object Uint8ClampedArray]',
  1417. uint16Tag = '[object Uint16Array]',
  1418. uint32Tag = '[object Uint32Array]';
  1419. /** Used to match empty string literals in compiled template source. */
  1420. var reEmptyStringLeading = /\b__p \+= '';/g,
  1421. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1422. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1423. /** Used to match HTML entities and HTML characters. */
  1424. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1425. reUnescapedHtml = /[&<>"']/g,
  1426. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1427. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1428. /** Used to match template delimiters. */
  1429. var reEscape = /<%-([\s\S]+?)%>/g,
  1430. reEvaluate = /<%([\s\S]+?)%>/g,
  1431. reInterpolate = /<%=([\s\S]+?)%>/g;
  1432. /** Used to match property names within property paths. */
  1433. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1434. reIsPlainProp = /^\w*$/,
  1435. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1436. /**
  1437. * Used to match `RegExp`
  1438. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1439. */
  1440. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1441. reHasRegExpChar = RegExp(reRegExpChar.source);
  1442. /** Used to match leading whitespace. */
  1443. var reTrimStart = /^\s+/;
  1444. /** Used to match a single whitespace character. */
  1445. var reWhitespace = /\s/;
  1446. /** Used to match wrap detail comments. */
  1447. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1448. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1449. reSplitDetails = /,? & /;
  1450. /** Used to match words composed of alphanumeric characters. */
  1451. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1452. /**
  1453. * Used to validate the `validate` option in `_.template` variable.
  1454. *
  1455. * Forbids characters which could potentially change the meaning of the function argument definition:
  1456. * - "()," (modification of function parameters)
  1457. * - "=" (default value)
  1458. * - "[]{}" (destructuring of function parameters)
  1459. * - "/" (beginning of a comment)
  1460. * - whitespace
  1461. */
  1462. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1463. /** Used to match backslashes in property paths. */
  1464. var reEscapeChar = /\\(\\)?/g;
  1465. /**
  1466. * Used to match
  1467. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1468. */
  1469. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1470. /** Used to match `RegExp` flags from their coerced string values. */
  1471. var reFlags = /\w*$/;
  1472. /** Used to detect bad signed hexadecimal string values. */
  1473. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1474. /** Used to detect binary string values. */
  1475. var reIsBinary = /^0b[01]+$/i;
  1476. /** Used to detect host constructors (Safari). */
  1477. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1478. /** Used to detect octal string values. */
  1479. var reIsOctal = /^0o[0-7]+$/i;
  1480. /** Used to detect unsigned integer values. */
  1481. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1482. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1483. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1484. /** Used to ensure capturing order of template delimiters. */
  1485. var reNoMatch = /($^)/;
  1486. /** Used to match unescaped characters in compiled string literals. */
  1487. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1488. /** Used to compose unicode character classes. */
  1489. var rsAstralRange = '\\ud800-\\udfff',
  1490. rsComboMarksRange = '\\u0300-\\u036f',
  1491. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1492. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1493. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1494. rsDingbatRange = '\\u2700-\\u27bf',
  1495. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1496. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1497. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1498. rsPunctuationRange = '\\u2000-\\u206f',
  1499. 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',
  1500. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1501. rsVarRange = '\\ufe0e\\ufe0f',
  1502. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1503. /** Used to compose unicode capture groups. */
  1504. var rsApos = "['\u2019]",
  1505. rsAstral = '[' + rsAstralRange + ']',
  1506. rsBreak = '[' + rsBreakRange + ']',
  1507. rsCombo = '[' + rsComboRange + ']',
  1508. rsDigits = '\\d+',
  1509. rsDingbat = '[' + rsDingbatRange + ']',
  1510. rsLower = '[' + rsLowerRange + ']',
  1511. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1512. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1513. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1514. rsNonAstral = '[^' + rsAstralRange + ']',
  1515. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1516. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1517. rsUpper = '[' + rsUpperRange + ']',
  1518. rsZWJ = '\\u200d';
  1519. /** Used to compose unicode regexes. */
  1520. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1521. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1522. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1523. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1524. reOptMod = rsModifier + '?',
  1525. rsOptVar = '[' + rsVarRange + ']?',
  1526. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1527. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1528. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1529. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1530. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1531. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1532. /** Used to match apostrophes. */
  1533. var reApos = RegExp(rsApos, 'g');
  1534. /**
  1535. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1536. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1537. */
  1538. var reComboMark = RegExp(rsCombo, 'g');
  1539. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1540. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1541. /** Used to match complex or compound words. */
  1542. var reUnicodeWord = RegExp([
  1543. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1544. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1545. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1546. rsUpper + '+' + rsOptContrUpper,
  1547. rsOrdUpper,
  1548. rsOrdLower,
  1549. rsDigits,
  1550. rsEmoji
  1551. ].join('|'), 'g');
  1552. /** 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/). */
  1553. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1554. /** Used to detect strings that need a more robust regexp to match words. */
  1555. 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 ]/;
  1556. /** Used to assign default `context` object properties. */
  1557. var contextProps = [
  1558. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1559. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1560. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1561. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1562. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1563. ];
  1564. /** Used to make template sourceURLs easier to identify. */
  1565. var templateCounter = -1;
  1566. /** Used to identify `toStringTag` values of typed arrays. */
  1567. var typedArrayTags = {};
  1568. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1569. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1570. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1571. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1572. typedArrayTags[uint32Tag] = true;
  1573. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1574. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1575. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1576. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1577. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1578. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1579. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1580. typedArrayTags[weakMapTag] = false;
  1581. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1582. var cloneableTags = {};
  1583. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1584. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1585. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1586. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1587. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1588. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1589. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1590. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1591. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1592. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1593. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1594. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1595. cloneableTags[weakMapTag] = false;
  1596. /** Used to map Latin Unicode letters to basic Latin letters. */
  1597. var deburredLetters = {
  1598. // Latin-1 Supplement block.
  1599. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1600. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1601. '\xc7': 'C', '\xe7': 'c',
  1602. '\xd0': 'D', '\xf0': 'd',
  1603. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1604. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1605. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1606. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1607. '\xd1': 'N', '\xf1': 'n',
  1608. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1609. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1610. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1611. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1612. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1613. '\xc6': 'Ae', '\xe6': 'ae',
  1614. '\xde': 'Th', '\xfe': 'th',
  1615. '\xdf': 'ss',
  1616. // Latin Extended-A block.
  1617. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1618. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1619. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1620. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1621. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1622. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1623. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1624. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1625. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1626. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1627. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1628. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1629. '\u0134': 'J', '\u0135': 'j',
  1630. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1631. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1632. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1633. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1634. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1635. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1636. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1637. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1638. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1639. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1640. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1641. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1642. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1643. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1644. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1645. '\u0174': 'W', '\u0175': 'w',
  1646. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1647. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1648. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1649. '\u0132': 'IJ', '\u0133': 'ij',
  1650. '\u0152': 'Oe', '\u0153': 'oe',
  1651. '\u0149': "'n", '\u017f': 's'
  1652. };
  1653. /** Used to map characters to HTML entities. */
  1654. var htmlEscapes = {
  1655. '&': '&amp;',
  1656. '<': '&lt;',
  1657. '>': '&gt;',
  1658. '"': '&quot;',
  1659. "'": '&#39;'
  1660. };
  1661. /** Used to map HTML entities to characters. */
  1662. var htmlUnescapes = {
  1663. '&amp;': '&',
  1664. '&lt;': '<',
  1665. '&gt;': '>',
  1666. '&quot;': '"',
  1667. '&#39;': "'"
  1668. };
  1669. /** Used to escape characters for inclusion in compiled string literals. */
  1670. var stringEscapes = {
  1671. '\\': '\\',
  1672. "'": "'",
  1673. '\n': 'n',
  1674. '\r': 'r',
  1675. '\u2028': 'u2028',
  1676. '\u2029': 'u2029'
  1677. };
  1678. /** Built-in method references without a dependency on `root`. */
  1679. var freeParseFloat = parseFloat,
  1680. freeParseInt = parseInt;
  1681. /** Detect free variable `global` from Node.js. */
  1682. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1683. /** Detect free variable `self`. */
  1684. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1685. /** Used as a reference to the global object. */
  1686. var root = freeGlobal || freeSelf || Function('return this')();
  1687. /** Detect free variable `exports`. */
  1688. var freeExports = true && exports && !exports.nodeType && exports;
  1689. /** Detect free variable `module`. */
  1690. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1691. /** Detect the popular CommonJS extension `module.exports`. */
  1692. var moduleExports = freeModule && freeModule.exports === freeExports;
  1693. /** Detect free variable `process` from Node.js. */
  1694. var freeProcess = moduleExports && freeGlobal.process;
  1695. /** Used to access faster Node.js helpers. */
  1696. var nodeUtil = (function() {
  1697. try {
  1698. // Use `util.types` for Node.js 10+.
  1699. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1700. if (types) {
  1701. return types;
  1702. }
  1703. // Legacy `process.binding('util')` for Node.js < 10.
  1704. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1705. } catch (e) {}
  1706. }());
  1707. /* Node.js helper references. */
  1708. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1709. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1710. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1711. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1712. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1713. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1714. /*--------------------------------------------------------------------------*/
  1715. /**
  1716. * A faster alternative to `Function#apply`, this function invokes `func`
  1717. * with the `this` binding of `thisArg` and the arguments of `args`.
  1718. *
  1719. * @private
  1720. * @param {Function} func The function to invoke.
  1721. * @param {*} thisArg The `this` binding of `func`.
  1722. * @param {Array} args The arguments to invoke `func` with.
  1723. * @returns {*} Returns the result of `func`.
  1724. */
  1725. function apply(func, thisArg, args) {
  1726. switch (args.length) {
  1727. case 0: return func.call(thisArg);
  1728. case 1: return func.call(thisArg, args[0]);
  1729. case 2: return func.call(thisArg, args[0], args[1]);
  1730. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1731. }
  1732. return func.apply(thisArg, args);
  1733. }
  1734. /**
  1735. * A specialized version of `baseAggregator` for arrays.
  1736. *
  1737. * @private
  1738. * @param {Array} [array] The array to iterate over.
  1739. * @param {Function} setter The function to set `accumulator` values.
  1740. * @param {Function} iteratee The iteratee to transform keys.
  1741. * @param {Object} accumulator The initial aggregated object.
  1742. * @returns {Function} Returns `accumulator`.
  1743. */
  1744. function arrayAggregator(array, setter, iteratee, accumulator) {
  1745. var index = -1,
  1746. length = array == null ? 0 : array.length;
  1747. while (++index < length) {
  1748. var value = array[index];
  1749. setter(accumulator, value, iteratee(value), array);
  1750. }
  1751. return accumulator;
  1752. }
  1753. /**
  1754. * A specialized version of `_.forEach` for arrays without support for
  1755. * iteratee shorthands.
  1756. *
  1757. * @private
  1758. * @param {Array} [array] The array to iterate over.
  1759. * @param {Function} iteratee The function invoked per iteration.
  1760. * @returns {Array} Returns `array`.
  1761. */
  1762. function arrayEach(array, iteratee) {
  1763. var index = -1,
  1764. length = array == null ? 0 : array.length;
  1765. while (++index < length) {
  1766. if (iteratee(array[index], index, array) === false) {
  1767. break;
  1768. }
  1769. }
  1770. return array;
  1771. }
  1772. /**
  1773. * A specialized version of `_.forEachRight` for arrays without support for
  1774. * iteratee shorthands.
  1775. *
  1776. * @private
  1777. * @param {Array} [array] The array to iterate over.
  1778. * @param {Function} iteratee The function invoked per iteration.
  1779. * @returns {Array} Returns `array`.
  1780. */
  1781. function arrayEachRight(array, iteratee) {
  1782. var length = array == null ? 0 : array.length;
  1783. while (length--) {
  1784. if (iteratee(array[length], length, array) === false) {
  1785. break;
  1786. }
  1787. }
  1788. return array;
  1789. }
  1790. /**
  1791. * A specialized version of `_.every` for arrays without support for
  1792. * iteratee shorthands.
  1793. *
  1794. * @private
  1795. * @param {Array} [array] The array to iterate over.
  1796. * @param {Function} predicate The function invoked per iteration.
  1797. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1798. * else `false`.
  1799. */
  1800. function arrayEvery(array, predicate) {
  1801. var index = -1,
  1802. length = array == null ? 0 : array.length;
  1803. while (++index < length) {
  1804. if (!predicate(array[index], index, array)) {
  1805. return false;
  1806. }
  1807. }
  1808. return true;
  1809. }
  1810. /**
  1811. * A specialized version of `_.filter` for arrays without support for
  1812. * iteratee shorthands.
  1813. *
  1814. * @private
  1815. * @param {Array} [array] The array to iterate over.
  1816. * @param {Function} predicate The function invoked per iteration.
  1817. * @returns {Array} Returns the new filtered array.
  1818. */
  1819. function arrayFilter(array, predicate) {
  1820. var index = -1,
  1821. length = array == null ? 0 : array.length,
  1822. resIndex = 0,
  1823. result = [];
  1824. while (++index < length) {
  1825. var value = array[index];
  1826. if (predicate(value, index, array)) {
  1827. result[resIndex++] = value;
  1828. }
  1829. }
  1830. return result;
  1831. }
  1832. /**
  1833. * A specialized version of `_.includes` for arrays without support for
  1834. * specifying an index to search from.
  1835. *
  1836. * @private
  1837. * @param {Array} [array] The array to inspect.
  1838. * @param {*} target The value to search for.
  1839. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1840. */
  1841. function arrayIncludes(array, value) {
  1842. var length = array == null ? 0 : array.length;
  1843. return !!length && baseIndexOf(array, value, 0) > -1;
  1844. }
  1845. /**
  1846. * This function is like `arrayIncludes` except that it accepts a comparator.
  1847. *
  1848. * @private
  1849. * @param {Array} [array] The array to inspect.
  1850. * @param {*} target The value to search for.
  1851. * @param {Function} comparator The comparator invoked per element.
  1852. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1853. */
  1854. function arrayIncludesWith(array, value, comparator) {
  1855. var index = -1,
  1856. length = array == null ? 0 : array.length;
  1857. while (++index < length) {
  1858. if (comparator(value, array[index])) {
  1859. return true;
  1860. }
  1861. }
  1862. return false;
  1863. }
  1864. /**
  1865. * A specialized version of `_.map` for arrays without support for iteratee
  1866. * shorthands.
  1867. *
  1868. * @private
  1869. * @param {Array} [array] The array to iterate over.
  1870. * @param {Function} iteratee The function invoked per iteration.
  1871. * @returns {Array} Returns the new mapped array.
  1872. */
  1873. function arrayMap(array, iteratee) {
  1874. var index = -1,
  1875. length = array == null ? 0 : array.length,
  1876. result = Array(length);
  1877. while (++index < length) {
  1878. result[index] = iteratee(array[index], index, array);
  1879. }
  1880. return result;
  1881. }
  1882. /**
  1883. * Appends the elements of `values` to `array`.
  1884. *
  1885. * @private
  1886. * @param {Array} array The array to modify.
  1887. * @param {Array} values The values to append.
  1888. * @returns {Array} Returns `array`.
  1889. */
  1890. function arrayPush(array, values) {
  1891. var index = -1,
  1892. length = values.length,
  1893. offset = array.length;
  1894. while (++index < length) {
  1895. array[offset + index] = values[index];
  1896. }
  1897. return array;
  1898. }
  1899. /**
  1900. * A specialized version of `_.reduce` for arrays without support for
  1901. * iteratee shorthands.
  1902. *
  1903. * @private
  1904. * @param {Array} [array] The array to iterate over.
  1905. * @param {Function} iteratee The function invoked per iteration.
  1906. * @param {*} [accumulator] The initial value.
  1907. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1908. * the initial value.
  1909. * @returns {*} Returns the accumulated value.
  1910. */
  1911. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1912. var index = -1,
  1913. length = array == null ? 0 : array.length;
  1914. if (initAccum && length) {
  1915. accumulator = array[++index];
  1916. }
  1917. while (++index < length) {
  1918. accumulator = iteratee(accumulator, array[index], index, array);
  1919. }
  1920. return accumulator;
  1921. }
  1922. /**
  1923. * A specialized version of `_.reduceRight` for arrays without support for
  1924. * iteratee shorthands.
  1925. *
  1926. * @private
  1927. * @param {Array} [array] The array to iterate over.
  1928. * @param {Function} iteratee The function invoked per iteration.
  1929. * @param {*} [accumulator] The initial value.
  1930. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1931. * the initial value.
  1932. * @returns {*} Returns the accumulated value.
  1933. */
  1934. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1935. var length = array == null ? 0 : array.length;
  1936. if (initAccum && length) {
  1937. accumulator = array[--length];
  1938. }
  1939. while (length--) {
  1940. accumulator = iteratee(accumulator, array[length], length, array);
  1941. }
  1942. return accumulator;
  1943. }
  1944. /**
  1945. * A specialized version of `_.some` for arrays without support for iteratee
  1946. * shorthands.
  1947. *
  1948. * @private
  1949. * @param {Array} [array] The array to iterate over.
  1950. * @param {Function} predicate The function invoked per iteration.
  1951. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1952. * else `false`.
  1953. */
  1954. function arraySome(array, predicate) {
  1955. var index = -1,
  1956. length = array == null ? 0 : array.length;
  1957. while (++index < length) {
  1958. if (predicate(array[index], index, array)) {
  1959. return true;
  1960. }
  1961. }
  1962. return false;
  1963. }
  1964. /**
  1965. * Gets the size of an ASCII `string`.
  1966. *
  1967. * @private
  1968. * @param {string} string The string inspect.
  1969. * @returns {number} Returns the string size.
  1970. */
  1971. var asciiSize = baseProperty('length');
  1972. /**
  1973. * Converts an ASCII `string` to an array.
  1974. *
  1975. * @private
  1976. * @param {string} string The string to convert.
  1977. * @returns {Array} Returns the converted array.
  1978. */
  1979. function asciiToArray(string) {
  1980. return string.split('');
  1981. }
  1982. /**
  1983. * Splits an ASCII `string` into an array of its words.
  1984. *
  1985. * @private
  1986. * @param {string} The string to inspect.
  1987. * @returns {Array} Returns the words of `string`.
  1988. */
  1989. function asciiWords(string) {
  1990. return string.match(reAsciiWord) || [];
  1991. }
  1992. /**
  1993. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1994. * without support for iteratee shorthands, which iterates over `collection`
  1995. * using `eachFunc`.
  1996. *
  1997. * @private
  1998. * @param {Array|Object} collection The collection to inspect.
  1999. * @param {Function} predicate The function invoked per iteration.
  2000. * @param {Function} eachFunc The function to iterate over `collection`.
  2001. * @returns {*} Returns the found element or its key, else `undefined`.
  2002. */
  2003. function baseFindKey(collection, predicate, eachFunc) {
  2004. var result;
  2005. eachFunc(collection, function(value, key, collection) {
  2006. if (predicate(value, key, collection)) {
  2007. result = key;
  2008. return false;
  2009. }
  2010. });
  2011. return result;
  2012. }
  2013. /**
  2014. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2015. * support for iteratee shorthands.
  2016. *
  2017. * @private
  2018. * @param {Array} array The array to inspect.
  2019. * @param {Function} predicate The function invoked per iteration.
  2020. * @param {number} fromIndex The index to search from.
  2021. * @param {boolean} [fromRight] Specify iterating from right to left.
  2022. * @returns {number} Returns the index of the matched value, else `-1`.
  2023. */
  2024. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2025. var length = array.length,
  2026. index = fromIndex + (fromRight ? 1 : -1);
  2027. while ((fromRight ? index-- : ++index < length)) {
  2028. if (predicate(array[index], index, array)) {
  2029. return index;
  2030. }
  2031. }
  2032. return -1;
  2033. }
  2034. /**
  2035. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2036. *
  2037. * @private
  2038. * @param {Array} array The array to inspect.
  2039. * @param {*} value The value to search for.
  2040. * @param {number} fromIndex The index to search from.
  2041. * @returns {number} Returns the index of the matched value, else `-1`.
  2042. */
  2043. function baseIndexOf(array, value, fromIndex) {
  2044. return value === value
  2045. ? strictIndexOf(array, value, fromIndex)
  2046. : baseFindIndex(array, baseIsNaN, fromIndex);
  2047. }
  2048. /**
  2049. * This function is like `baseIndexOf` except that it accepts a comparator.
  2050. *
  2051. * @private
  2052. * @param {Array} array The array to inspect.
  2053. * @param {*} value The value to search for.
  2054. * @param {number} fromIndex The index to search from.
  2055. * @param {Function} comparator The comparator invoked per element.
  2056. * @returns {number} Returns the index of the matched value, else `-1`.
  2057. */
  2058. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2059. var index = fromIndex - 1,
  2060. length = array.length;
  2061. while (++index < length) {
  2062. if (comparator(array[index], value)) {
  2063. return index;
  2064. }
  2065. }
  2066. return -1;
  2067. }
  2068. /**
  2069. * The base implementation of `_.isNaN` without support for number objects.
  2070. *
  2071. * @private
  2072. * @param {*} value The value to check.
  2073. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2074. */
  2075. function baseIsNaN(value) {
  2076. return value !== value;
  2077. }
  2078. /**
  2079. * The base implementation of `_.mean` and `_.meanBy` without support for
  2080. * iteratee shorthands.
  2081. *
  2082. * @private
  2083. * @param {Array} array The array to iterate over.
  2084. * @param {Function} iteratee The function invoked per iteration.
  2085. * @returns {number} Returns the mean.
  2086. */
  2087. function baseMean(array, iteratee) {
  2088. var length = array == null ? 0 : array.length;
  2089. return length ? (baseSum(array, iteratee) / length) : NAN;
  2090. }
  2091. /**
  2092. * The base implementation of `_.property` without support for deep paths.
  2093. *
  2094. * @private
  2095. * @param {string} key The key of the property to get.
  2096. * @returns {Function} Returns the new accessor function.
  2097. */
  2098. function baseProperty(key) {
  2099. return function(object) {
  2100. return object == null ? undefined : object[key];
  2101. };
  2102. }
  2103. /**
  2104. * The base implementation of `_.propertyOf` without support for deep paths.
  2105. *
  2106. * @private
  2107. * @param {Object} object The object to query.
  2108. * @returns {Function} Returns the new accessor function.
  2109. */
  2110. function basePropertyOf(object) {
  2111. return function(key) {
  2112. return object == null ? undefined : object[key];
  2113. };
  2114. }
  2115. /**
  2116. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2117. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2118. *
  2119. * @private
  2120. * @param {Array|Object} collection The collection to iterate over.
  2121. * @param {Function} iteratee The function invoked per iteration.
  2122. * @param {*} accumulator The initial value.
  2123. * @param {boolean} initAccum Specify using the first or last element of
  2124. * `collection` as the initial value.
  2125. * @param {Function} eachFunc The function to iterate over `collection`.
  2126. * @returns {*} Returns the accumulated value.
  2127. */
  2128. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2129. eachFunc(collection, function(value, index, collection) {
  2130. accumulator = initAccum
  2131. ? (initAccum = false, value)
  2132. : iteratee(accumulator, value, index, collection);
  2133. });
  2134. return accumulator;
  2135. }
  2136. /**
  2137. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2138. * sort order of `array` and replaces criteria objects with their corresponding
  2139. * values.
  2140. *
  2141. * @private
  2142. * @param {Array} array The array to sort.
  2143. * @param {Function} comparer The function to define sort order.
  2144. * @returns {Array} Returns `array`.
  2145. */
  2146. function baseSortBy(array, comparer) {
  2147. var length = array.length;
  2148. array.sort(comparer);
  2149. while (length--) {
  2150. array[length] = array[length].value;
  2151. }
  2152. return array;
  2153. }
  2154. /**
  2155. * The base implementation of `_.sum` and `_.sumBy` without support for
  2156. * iteratee shorthands.
  2157. *
  2158. * @private
  2159. * @param {Array} array The array to iterate over.
  2160. * @param {Function} iteratee The function invoked per iteration.
  2161. * @returns {number} Returns the sum.
  2162. */
  2163. function baseSum(array, iteratee) {
  2164. var result,
  2165. index = -1,
  2166. length = array.length;
  2167. while (++index < length) {
  2168. var current = iteratee(array[index]);
  2169. if (current !== undefined) {
  2170. result = result === undefined ? current : (result + current);
  2171. }
  2172. }
  2173. return result;
  2174. }
  2175. /**
  2176. * The base implementation of `_.times` without support for iteratee shorthands
  2177. * or max array length checks.
  2178. *
  2179. * @private
  2180. * @param {number} n The number of times to invoke `iteratee`.
  2181. * @param {Function} iteratee The function invoked per iteration.
  2182. * @returns {Array} Returns the array of results.
  2183. */
  2184. function baseTimes(n, iteratee) {
  2185. var index = -1,
  2186. result = Array(n);
  2187. while (++index < n) {
  2188. result[index] = iteratee(index);
  2189. }
  2190. return result;
  2191. }
  2192. /**
  2193. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2194. * of key-value pairs for `object` corresponding to the property names of `props`.
  2195. *
  2196. * @private
  2197. * @param {Object} object The object to query.
  2198. * @param {Array} props The property names to get values for.
  2199. * @returns {Object} Returns the key-value pairs.
  2200. */
  2201. function baseToPairs(object, props) {
  2202. return arrayMap(props, function(key) {
  2203. return [key, object[key]];
  2204. });
  2205. }
  2206. /**
  2207. * The base implementation of `_.trim`.
  2208. *
  2209. * @private
  2210. * @param {string} string The string to trim.
  2211. * @returns {string} Returns the trimmed string.
  2212. */
  2213. function baseTrim(string) {
  2214. return string
  2215. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2216. : string;
  2217. }
  2218. /**
  2219. * The base implementation of `_.unary` without support for storing metadata.
  2220. *
  2221. * @private
  2222. * @param {Function} func The function to cap arguments for.
  2223. * @returns {Function} Returns the new capped function.
  2224. */
  2225. function baseUnary(func) {
  2226. return function(value) {
  2227. return func(value);
  2228. };
  2229. }
  2230. /**
  2231. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2232. * array of `object` property values corresponding to the property names
  2233. * of `props`.
  2234. *
  2235. * @private
  2236. * @param {Object} object The object to query.
  2237. * @param {Array} props The property names to get values for.
  2238. * @returns {Object} Returns the array of property values.
  2239. */
  2240. function baseValues(object, props) {
  2241. return arrayMap(props, function(key) {
  2242. return object[key];
  2243. });
  2244. }
  2245. /**
  2246. * Checks if a `cache` value for `key` exists.
  2247. *
  2248. * @private
  2249. * @param {Object} cache The cache to query.
  2250. * @param {string} key The key of the entry to check.
  2251. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2252. */
  2253. function cacheHas(cache, key) {
  2254. return cache.has(key);
  2255. }
  2256. /**
  2257. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2258. * that is not found in the character symbols.
  2259. *
  2260. * @private
  2261. * @param {Array} strSymbols The string symbols to inspect.
  2262. * @param {Array} chrSymbols The character symbols to find.
  2263. * @returns {number} Returns the index of the first unmatched string symbol.
  2264. */
  2265. function charsStartIndex(strSymbols, chrSymbols) {
  2266. var index = -1,
  2267. length = strSymbols.length;
  2268. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2269. return index;
  2270. }
  2271. /**
  2272. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2273. * that is not found in the character symbols.
  2274. *
  2275. * @private
  2276. * @param {Array} strSymbols The string symbols to inspect.
  2277. * @param {Array} chrSymbols The character symbols to find.
  2278. * @returns {number} Returns the index of the last unmatched string symbol.
  2279. */
  2280. function charsEndIndex(strSymbols, chrSymbols) {
  2281. var index = strSymbols.length;
  2282. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2283. return index;
  2284. }
  2285. /**
  2286. * Gets the number of `placeholder` occurrences in `array`.
  2287. *
  2288. * @private
  2289. * @param {Array} array The array to inspect.
  2290. * @param {*} placeholder The placeholder to search for.
  2291. * @returns {number} Returns the placeholder count.
  2292. */
  2293. function countHolders(array, placeholder) {
  2294. var length = array.length,
  2295. result = 0;
  2296. while (length--) {
  2297. if (array[length] === placeholder) {
  2298. ++result;
  2299. }
  2300. }
  2301. return result;
  2302. }
  2303. /**
  2304. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2305. * letters to basic Latin letters.
  2306. *
  2307. * @private
  2308. * @param {string} letter The matched letter to deburr.
  2309. * @returns {string} Returns the deburred letter.
  2310. */
  2311. var deburrLetter = basePropertyOf(deburredLetters);
  2312. /**
  2313. * Used by `_.escape` to convert characters to HTML entities.
  2314. *
  2315. * @private
  2316. * @param {string} chr The matched character to escape.
  2317. * @returns {string} Returns the escaped character.
  2318. */
  2319. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2320. /**
  2321. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2322. *
  2323. * @private
  2324. * @param {string} chr The matched character to escape.
  2325. * @returns {string} Returns the escaped character.
  2326. */
  2327. function escapeStringChar(chr) {
  2328. return '\\' + stringEscapes[chr];
  2329. }
  2330. /**
  2331. * Gets the value at `key` of `object`.
  2332. *
  2333. * @private
  2334. * @param {Object} [object] The object to query.
  2335. * @param {string} key The key of the property to get.
  2336. * @returns {*} Returns the property value.
  2337. */
  2338. function getValue(object, key) {
  2339. return object == null ? undefined : object[key];
  2340. }
  2341. /**
  2342. * Checks if `string` contains Unicode symbols.
  2343. *
  2344. * @private
  2345. * @param {string} string The string to inspect.
  2346. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2347. */
  2348. function hasUnicode(string) {
  2349. return reHasUnicode.test(string);
  2350. }
  2351. /**
  2352. * Checks if `string` contains a word composed of Unicode symbols.
  2353. *
  2354. * @private
  2355. * @param {string} string The string to inspect.
  2356. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2357. */
  2358. function hasUnicodeWord(string) {
  2359. return reHasUnicodeWord.test(string);
  2360. }
  2361. /**
  2362. * Converts `iterator` to an array.
  2363. *
  2364. * @private
  2365. * @param {Object} iterator The iterator to convert.
  2366. * @returns {Array} Returns the converted array.
  2367. */
  2368. function iteratorToArray(iterator) {
  2369. var data,
  2370. result = [];
  2371. while (!(data = iterator.next()).done) {
  2372. result.push(data.value);
  2373. }
  2374. return result;
  2375. }
  2376. /**
  2377. * Converts `map` to its key-value pairs.
  2378. *
  2379. * @private
  2380. * @param {Object} map The map to convert.
  2381. * @returns {Array} Returns the key-value pairs.
  2382. */
  2383. function mapToArray(map) {
  2384. var index = -1,
  2385. result = Array(map.size);
  2386. map.forEach(function(value, key) {
  2387. result[++index] = [key, value];
  2388. });
  2389. return result;
  2390. }
  2391. /**
  2392. * Creates a unary function that invokes `func` with its argument transformed.
  2393. *
  2394. * @private
  2395. * @param {Function} func The function to wrap.
  2396. * @param {Function} transform The argument transform.
  2397. * @returns {Function} Returns the new function.
  2398. */
  2399. function overArg(func, transform) {
  2400. return function(arg) {
  2401. return func(transform(arg));
  2402. };
  2403. }
  2404. /**
  2405. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2406. * and returns an array of their indexes.
  2407. *
  2408. * @private
  2409. * @param {Array} array The array to modify.
  2410. * @param {*} placeholder The placeholder to replace.
  2411. * @returns {Array} Returns the new array of placeholder indexes.
  2412. */
  2413. function replaceHolders(array, placeholder) {
  2414. var index = -1,
  2415. length = array.length,
  2416. resIndex = 0,
  2417. result = [];
  2418. while (++index < length) {
  2419. var value = array[index];
  2420. if (value === placeholder || value === PLACEHOLDER) {
  2421. array[index] = PLACEHOLDER;
  2422. result[resIndex++] = index;
  2423. }
  2424. }
  2425. return result;
  2426. }
  2427. /**
  2428. * Converts `set` to an array of its values.
  2429. *
  2430. * @private
  2431. * @param {Object} set The set to convert.
  2432. * @returns {Array} Returns the values.
  2433. */
  2434. function setToArray(set) {
  2435. var index = -1,
  2436. result = Array(set.size);
  2437. set.forEach(function(value) {
  2438. result[++index] = value;
  2439. });
  2440. return result;
  2441. }
  2442. /**
  2443. * Converts `set` to its value-value pairs.
  2444. *
  2445. * @private
  2446. * @param {Object} set The set to convert.
  2447. * @returns {Array} Returns the value-value pairs.
  2448. */
  2449. function setToPairs(set) {
  2450. var index = -1,
  2451. result = Array(set.size);
  2452. set.forEach(function(value) {
  2453. result[++index] = [value, value];
  2454. });
  2455. return result;
  2456. }
  2457. /**
  2458. * A specialized version of `_.indexOf` which performs strict equality
  2459. * comparisons of values, i.e. `===`.
  2460. *
  2461. * @private
  2462. * @param {Array} array The array to inspect.
  2463. * @param {*} value The value to search for.
  2464. * @param {number} fromIndex The index to search from.
  2465. * @returns {number} Returns the index of the matched value, else `-1`.
  2466. */
  2467. function strictIndexOf(array, value, fromIndex) {
  2468. var index = fromIndex - 1,
  2469. length = array.length;
  2470. while (++index < length) {
  2471. if (array[index] === value) {
  2472. return index;
  2473. }
  2474. }
  2475. return -1;
  2476. }
  2477. /**
  2478. * A specialized version of `_.lastIndexOf` which performs strict equality
  2479. * comparisons of values, i.e. `===`.
  2480. *
  2481. * @private
  2482. * @param {Array} array The array to inspect.
  2483. * @param {*} value The value to search for.
  2484. * @param {number} fromIndex The index to search from.
  2485. * @returns {number} Returns the index of the matched value, else `-1`.
  2486. */
  2487. function strictLastIndexOf(array, value, fromIndex) {
  2488. var index = fromIndex + 1;
  2489. while (index--) {
  2490. if (array[index] === value) {
  2491. return index;
  2492. }
  2493. }
  2494. return index;
  2495. }
  2496. /**
  2497. * Gets the number of symbols in `string`.
  2498. *
  2499. * @private
  2500. * @param {string} string The string to inspect.
  2501. * @returns {number} Returns the string size.
  2502. */
  2503. function stringSize(string) {
  2504. return hasUnicode(string)
  2505. ? unicodeSize(string)
  2506. : asciiSize(string);
  2507. }
  2508. /**
  2509. * Converts `string` to an array.
  2510. *
  2511. * @private
  2512. * @param {string} string The string to convert.
  2513. * @returns {Array} Returns the converted array.
  2514. */
  2515. function stringToArray(string) {
  2516. return hasUnicode(string)
  2517. ? unicodeToArray(string)
  2518. : asciiToArray(string);
  2519. }
  2520. /**
  2521. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2522. * character of `string`.
  2523. *
  2524. * @private
  2525. * @param {string} string The string to inspect.
  2526. * @returns {number} Returns the index of the last non-whitespace character.
  2527. */
  2528. function trimmedEndIndex(string) {
  2529. var index = string.length;
  2530. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2531. return index;
  2532. }
  2533. /**
  2534. * Used by `_.unescape` to convert HTML entities to characters.
  2535. *
  2536. * @private
  2537. * @param {string} chr The matched character to unescape.
  2538. * @returns {string} Returns the unescaped character.
  2539. */
  2540. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2541. /**
  2542. * Gets the size of a Unicode `string`.
  2543. *
  2544. * @private
  2545. * @param {string} string The string inspect.
  2546. * @returns {number} Returns the string size.
  2547. */
  2548. function unicodeSize(string) {
  2549. var result = reUnicode.lastIndex = 0;
  2550. while (reUnicode.test(string)) {
  2551. ++result;
  2552. }
  2553. return result;
  2554. }
  2555. /**
  2556. * Converts a Unicode `string` to an array.
  2557. *
  2558. * @private
  2559. * @param {string} string The string to convert.
  2560. * @returns {Array} Returns the converted array.
  2561. */
  2562. function unicodeToArray(string) {
  2563. return string.match(reUnicode) || [];
  2564. }
  2565. /**
  2566. * Splits a Unicode `string` into an array of its words.
  2567. *
  2568. * @private
  2569. * @param {string} The string to inspect.
  2570. * @returns {Array} Returns the words of `string`.
  2571. */
  2572. function unicodeWords(string) {
  2573. return string.match(reUnicodeWord) || [];
  2574. }
  2575. /*--------------------------------------------------------------------------*/
  2576. /**
  2577. * Create a new pristine `lodash` function using the `context` object.
  2578. *
  2579. * @static
  2580. * @memberOf _
  2581. * @since 1.1.0
  2582. * @category Util
  2583. * @param {Object} [context=root] The context object.
  2584. * @returns {Function} Returns a new `lodash` function.
  2585. * @example
  2586. *
  2587. * _.mixin({ 'foo': _.constant('foo') });
  2588. *
  2589. * var lodash = _.runInContext();
  2590. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2591. *
  2592. * _.isFunction(_.foo);
  2593. * // => true
  2594. * _.isFunction(_.bar);
  2595. * // => false
  2596. *
  2597. * lodash.isFunction(lodash.foo);
  2598. * // => false
  2599. * lodash.isFunction(lodash.bar);
  2600. * // => true
  2601. *
  2602. * // Create a suped-up `defer` in Node.js.
  2603. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2604. */
  2605. var runInContext = (function runInContext(context) {
  2606. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2607. /** Built-in constructor references. */
  2608. var Array = context.Array,
  2609. Date = context.Date,
  2610. Error = context.Error,
  2611. Function = context.Function,
  2612. Math = context.Math,
  2613. Object = context.Object,
  2614. RegExp = context.RegExp,
  2615. String = context.String,
  2616. TypeError = context.TypeError;
  2617. /** Used for built-in method references. */
  2618. var arrayProto = Array.prototype,
  2619. funcProto = Function.prototype,
  2620. objectProto = Object.prototype;
  2621. /** Used to detect overreaching core-js shims. */
  2622. var coreJsData = context['__core-js_shared__'];
  2623. /** Used to resolve the decompiled source of functions. */
  2624. var funcToString = funcProto.toString;
  2625. /** Used to check objects for own properties. */
  2626. var hasOwnProperty = objectProto.hasOwnProperty;
  2627. /** Used to generate unique IDs. */
  2628. var idCounter = 0;
  2629. /** Used to detect methods masquerading as native. */
  2630. var maskSrcKey = (function() {
  2631. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2632. return uid ? ('Symbol(src)_1.' + uid) : '';
  2633. }());
  2634. /**
  2635. * Used to resolve the
  2636. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2637. * of values.
  2638. */
  2639. var nativeObjectToString = objectProto.toString;
  2640. /** Used to infer the `Object` constructor. */
  2641. var objectCtorString = funcToString.call(Object);
  2642. /** Used to restore the original `_` reference in `_.noConflict`. */
  2643. var oldDash = root._;
  2644. /** Used to detect if a method is native. */
  2645. var reIsNative = RegExp('^' +
  2646. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2647. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2648. );
  2649. /** Built-in value references. */
  2650. var Buffer = moduleExports ? context.Buffer : undefined,
  2651. Symbol = context.Symbol,
  2652. Uint8Array = context.Uint8Array,
  2653. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2654. getPrototype = overArg(Object.getPrototypeOf, Object),
  2655. objectCreate = Object.create,
  2656. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2657. splice = arrayProto.splice,
  2658. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2659. symIterator = Symbol ? Symbol.iterator : undefined,
  2660. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2661. var defineProperty = (function() {
  2662. try {
  2663. var func = getNative(Object, 'defineProperty');
  2664. func({}, '', {});
  2665. return func;
  2666. } catch (e) {}
  2667. }());
  2668. /** Mocked built-ins. */
  2669. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2670. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2671. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2672. /* Built-in method references for those with the same name as other `lodash` methods. */
  2673. var nativeCeil = Math.ceil,
  2674. nativeFloor = Math.floor,
  2675. nativeGetSymbols = Object.getOwnPropertySymbols,
  2676. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2677. nativeIsFinite = context.isFinite,
  2678. nativeJoin = arrayProto.join,
  2679. nativeKeys = overArg(Object.keys, Object),
  2680. nativeMax = Math.max,
  2681. nativeMin = Math.min,
  2682. nativeNow = Date.now,
  2683. nativeParseInt = context.parseInt,
  2684. nativeRandom = Math.random,
  2685. nativeReverse = arrayProto.reverse;
  2686. /* Built-in method references that are verified to be native. */
  2687. var DataView = getNative(context, 'DataView'),
  2688. Map = getNative(context, 'Map'),
  2689. Promise = getNative(context, 'Promise'),
  2690. Set = getNative(context, 'Set'),
  2691. WeakMap = getNative(context, 'WeakMap'),
  2692. nativeCreate = getNative(Object, 'create');
  2693. /** Used to store function metadata. */
  2694. var metaMap = WeakMap && new WeakMap;
  2695. /** Used to lookup unminified function names. */
  2696. var realNames = {};
  2697. /** Used to detect maps, sets, and weakmaps. */
  2698. var dataViewCtorString = toSource(DataView),
  2699. mapCtorString = toSource(Map),
  2700. promiseCtorString = toSource(Promise),
  2701. setCtorString = toSource(Set),
  2702. weakMapCtorString = toSource(WeakMap);
  2703. /** Used to convert symbols to primitives and strings. */
  2704. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2705. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2706. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2707. /*------------------------------------------------------------------------*/
  2708. /**
  2709. * Creates a `lodash` object which wraps `value` to enable implicit method
  2710. * chain sequences. Methods that operate on and return arrays, collections,
  2711. * and functions can be chained together. Methods that retrieve a single value
  2712. * or may return a primitive value will automatically end the chain sequence
  2713. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2714. * with `_#value`.
  2715. *
  2716. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2717. * enabled using `_.chain`.
  2718. *
  2719. * The execution of chained methods is lazy, that is, it's deferred until
  2720. * `_#value` is implicitly or explicitly called.
  2721. *
  2722. * Lazy evaluation allows several methods to support shortcut fusion.
  2723. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2724. * the creation of intermediate arrays and can greatly reduce the number of
  2725. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2726. * fusion if the section is applied to an array and iteratees accept only
  2727. * one argument. The heuristic for whether a section qualifies for shortcut
  2728. * fusion is subject to change.
  2729. *
  2730. * Chaining is supported in custom builds as long as the `_#value` method is
  2731. * directly or indirectly included in the build.
  2732. *
  2733. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2734. *
  2735. * The wrapper `Array` methods are:
  2736. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2737. *
  2738. * The wrapper `String` methods are:
  2739. * `replace` and `split`
  2740. *
  2741. * The wrapper methods that support shortcut fusion are:
  2742. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2743. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2744. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2745. *
  2746. * The chainable wrapper methods are:
  2747. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2748. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2749. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2750. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2751. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2752. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2753. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2754. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2755. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2756. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2757. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2758. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2759. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2760. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2761. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2762. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2763. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2764. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2765. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2766. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2767. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2768. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2769. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2770. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2771. *
  2772. * The wrapper methods that are **not** chainable by default are:
  2773. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2774. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2775. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2776. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2777. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2778. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2779. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2780. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2781. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2782. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2783. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2784. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2785. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2786. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2787. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2788. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2789. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2790. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2791. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2792. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2793. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2794. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2795. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2796. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2797. * `upperFirst`, `value`, and `words`
  2798. *
  2799. * @name _
  2800. * @constructor
  2801. * @category Seq
  2802. * @param {*} value The value to wrap in a `lodash` instance.
  2803. * @returns {Object} Returns the new `lodash` wrapper instance.
  2804. * @example
  2805. *
  2806. * function square(n) {
  2807. * return n * n;
  2808. * }
  2809. *
  2810. * var wrapped = _([1, 2, 3]);
  2811. *
  2812. * // Returns an unwrapped value.
  2813. * wrapped.reduce(_.add);
  2814. * // => 6
  2815. *
  2816. * // Returns a wrapped value.
  2817. * var squares = wrapped.map(square);
  2818. *
  2819. * _.isArray(squares);
  2820. * // => false
  2821. *
  2822. * _.isArray(squares.value());
  2823. * // => true
  2824. */
  2825. function lodash(value) {
  2826. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2827. if (value instanceof LodashWrapper) {
  2828. return value;
  2829. }
  2830. if (hasOwnProperty.call(value, '__wrapped__')) {
  2831. return wrapperClone(value);
  2832. }
  2833. }
  2834. return new LodashWrapper(value);
  2835. }
  2836. /**
  2837. * The base implementation of `_.create` without support for assigning
  2838. * properties to the created object.
  2839. *
  2840. * @private
  2841. * @param {Object} proto The object to inherit from.
  2842. * @returns {Object} Returns the new object.
  2843. */
  2844. var baseCreate = (function() {
  2845. function object() {}
  2846. return function(proto) {
  2847. if (!isObject(proto)) {
  2848. return {};
  2849. }
  2850. if (objectCreate) {
  2851. return objectCreate(proto);
  2852. }
  2853. object.prototype = proto;
  2854. var result = new object;
  2855. object.prototype = undefined;
  2856. return result;
  2857. };
  2858. }());
  2859. /**
  2860. * The function whose prototype chain sequence wrappers inherit from.
  2861. *
  2862. * @private
  2863. */
  2864. function baseLodash() {
  2865. // No operation performed.
  2866. }
  2867. /**
  2868. * The base constructor for creating `lodash` wrapper objects.
  2869. *
  2870. * @private
  2871. * @param {*} value The value to wrap.
  2872. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2873. */
  2874. function LodashWrapper(value, chainAll) {
  2875. this.__wrapped__ = value;
  2876. this.__actions__ = [];
  2877. this.__chain__ = !!chainAll;
  2878. this.__index__ = 0;
  2879. this.__values__ = undefined;
  2880. }
  2881. /**
  2882. * By default, the template delimiters used by lodash are like those in
  2883. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2884. * following template settings to use alternative delimiters.
  2885. *
  2886. * @static
  2887. * @memberOf _
  2888. * @type {Object}
  2889. */
  2890. lodash.templateSettings = {
  2891. /**
  2892. * Used to detect `data` property values to be HTML-escaped.
  2893. *
  2894. * @memberOf _.templateSettings
  2895. * @type {RegExp}
  2896. */
  2897. 'escape': reEscape,
  2898. /**
  2899. * Used to detect code to be evaluated.
  2900. *
  2901. * @memberOf _.templateSettings
  2902. * @type {RegExp}
  2903. */
  2904. 'evaluate': reEvaluate,
  2905. /**
  2906. * Used to detect `data` property values to inject.
  2907. *
  2908. * @memberOf _.templateSettings
  2909. * @type {RegExp}
  2910. */
  2911. 'interpolate': reInterpolate,
  2912. /**
  2913. * Used to reference the data object in the template text.
  2914. *
  2915. * @memberOf _.templateSettings
  2916. * @type {string}
  2917. */
  2918. 'variable': '',
  2919. /**
  2920. * Used to import variables into the compiled template.
  2921. *
  2922. * @memberOf _.templateSettings
  2923. * @type {Object}
  2924. */
  2925. 'imports': {
  2926. /**
  2927. * A reference to the `lodash` function.
  2928. *
  2929. * @memberOf _.templateSettings.imports
  2930. * @type {Function}
  2931. */
  2932. '_': lodash
  2933. }
  2934. };
  2935. // Ensure wrappers are instances of `baseLodash`.
  2936. lodash.prototype = baseLodash.prototype;
  2937. lodash.prototype.constructor = lodash;
  2938. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2939. LodashWrapper.prototype.constructor = LodashWrapper;
  2940. /*------------------------------------------------------------------------*/
  2941. /**
  2942. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2943. *
  2944. * @private
  2945. * @constructor
  2946. * @param {*} value The value to wrap.
  2947. */
  2948. function LazyWrapper(value) {
  2949. this.__wrapped__ = value;
  2950. this.__actions__ = [];
  2951. this.__dir__ = 1;
  2952. this.__filtered__ = false;
  2953. this.__iteratees__ = [];
  2954. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2955. this.__views__ = [];
  2956. }
  2957. /**
  2958. * Creates a clone of the lazy wrapper object.
  2959. *
  2960. * @private
  2961. * @name clone
  2962. * @memberOf LazyWrapper
  2963. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2964. */
  2965. function lazyClone() {
  2966. var result = new LazyWrapper(this.__wrapped__);
  2967. result.__actions__ = copyArray(this.__actions__);
  2968. result.__dir__ = this.__dir__;
  2969. result.__filtered__ = this.__filtered__;
  2970. result.__iteratees__ = copyArray(this.__iteratees__);
  2971. result.__takeCount__ = this.__takeCount__;
  2972. result.__views__ = copyArray(this.__views__);
  2973. return result;
  2974. }
  2975. /**
  2976. * Reverses the direction of lazy iteration.
  2977. *
  2978. * @private
  2979. * @name reverse
  2980. * @memberOf LazyWrapper
  2981. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2982. */
  2983. function lazyReverse() {
  2984. if (this.__filtered__) {
  2985. var result = new LazyWrapper(this);
  2986. result.__dir__ = -1;
  2987. result.__filtered__ = true;
  2988. } else {
  2989. result = this.clone();
  2990. result.__dir__ *= -1;
  2991. }
  2992. return result;
  2993. }
  2994. /**
  2995. * Extracts the unwrapped value from its lazy wrapper.
  2996. *
  2997. * @private
  2998. * @name value
  2999. * @memberOf LazyWrapper
  3000. * @returns {*} Returns the unwrapped value.
  3001. */
  3002. function lazyValue() {
  3003. var array = this.__wrapped__.value(),
  3004. dir = this.__dir__,
  3005. isArr = isArray(array),
  3006. isRight = dir < 0,
  3007. arrLength = isArr ? array.length : 0,
  3008. view = getView(0, arrLength, this.__views__),
  3009. start = view.start,
  3010. end = view.end,
  3011. length = end - start,
  3012. index = isRight ? end : (start - 1),
  3013. iteratees = this.__iteratees__,
  3014. iterLength = iteratees.length,
  3015. resIndex = 0,
  3016. takeCount = nativeMin(length, this.__takeCount__);
  3017. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3018. return baseWrapperValue(array, this.__actions__);
  3019. }
  3020. var result = [];
  3021. outer:
  3022. while (length-- && resIndex < takeCount) {
  3023. index += dir;
  3024. var iterIndex = -1,
  3025. value = array[index];
  3026. while (++iterIndex < iterLength) {
  3027. var data = iteratees[iterIndex],
  3028. iteratee = data.iteratee,
  3029. type = data.type,
  3030. computed = iteratee(value);
  3031. if (type == LAZY_MAP_FLAG) {
  3032. value = computed;
  3033. } else if (!computed) {
  3034. if (type == LAZY_FILTER_FLAG) {
  3035. continue outer;
  3036. } else {
  3037. break outer;
  3038. }
  3039. }
  3040. }
  3041. result[resIndex++] = value;
  3042. }
  3043. return result;
  3044. }
  3045. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3046. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3047. LazyWrapper.prototype.constructor = LazyWrapper;
  3048. /*------------------------------------------------------------------------*/
  3049. /**
  3050. * Creates a hash object.
  3051. *
  3052. * @private
  3053. * @constructor
  3054. * @param {Array} [entries] The key-value pairs to cache.
  3055. */
  3056. function Hash(entries) {
  3057. var index = -1,
  3058. length = entries == null ? 0 : entries.length;
  3059. this.clear();
  3060. while (++index < length) {
  3061. var entry = entries[index];
  3062. this.set(entry[0], entry[1]);
  3063. }
  3064. }
  3065. /**
  3066. * Removes all key-value entries from the hash.
  3067. *
  3068. * @private
  3069. * @name clear
  3070. * @memberOf Hash
  3071. */
  3072. function hashClear() {
  3073. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3074. this.size = 0;
  3075. }
  3076. /**
  3077. * Removes `key` and its value from the hash.
  3078. *
  3079. * @private
  3080. * @name delete
  3081. * @memberOf Hash
  3082. * @param {Object} hash The hash to modify.
  3083. * @param {string} key The key of the value to remove.
  3084. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3085. */
  3086. function hashDelete(key) {
  3087. var result = this.has(key) && delete this.__data__[key];
  3088. this.size -= result ? 1 : 0;
  3089. return result;
  3090. }
  3091. /**
  3092. * Gets the hash value for `key`.
  3093. *
  3094. * @private
  3095. * @name get
  3096. * @memberOf Hash
  3097. * @param {string} key The key of the value to get.
  3098. * @returns {*} Returns the entry value.
  3099. */
  3100. function hashGet(key) {
  3101. var data = this.__data__;
  3102. if (nativeCreate) {
  3103. var result = data[key];
  3104. return result === HASH_UNDEFINED ? undefined : result;
  3105. }
  3106. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3107. }
  3108. /**
  3109. * Checks if a hash value for `key` exists.
  3110. *
  3111. * @private
  3112. * @name has
  3113. * @memberOf Hash
  3114. * @param {string} key The key of the entry to check.
  3115. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3116. */
  3117. function hashHas(key) {
  3118. var data = this.__data__;
  3119. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3120. }
  3121. /**
  3122. * Sets the hash `key` to `value`.
  3123. *
  3124. * @private
  3125. * @name set
  3126. * @memberOf Hash
  3127. * @param {string} key The key of the value to set.
  3128. * @param {*} value The value to set.
  3129. * @returns {Object} Returns the hash instance.
  3130. */
  3131. function hashSet(key, value) {
  3132. var data = this.__data__;
  3133. this.size += this.has(key) ? 0 : 1;
  3134. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3135. return this;
  3136. }
  3137. // Add methods to `Hash`.
  3138. Hash.prototype.clear = hashClear;
  3139. Hash.prototype['delete'] = hashDelete;
  3140. Hash.prototype.get = hashGet;
  3141. Hash.prototype.has = hashHas;
  3142. Hash.prototype.set = hashSet;
  3143. /*------------------------------------------------------------------------*/
  3144. /**
  3145. * Creates an list cache object.
  3146. *
  3147. * @private
  3148. * @constructor
  3149. * @param {Array} [entries] The key-value pairs to cache.
  3150. */
  3151. function ListCache(entries) {
  3152. var index = -1,
  3153. length = entries == null ? 0 : entries.length;
  3154. this.clear();
  3155. while (++index < length) {
  3156. var entry = entries[index];
  3157. this.set(entry[0], entry[1]);
  3158. }
  3159. }
  3160. /**
  3161. * Removes all key-value entries from the list cache.
  3162. *
  3163. * @private
  3164. * @name clear
  3165. * @memberOf ListCache
  3166. */
  3167. function listCacheClear() {
  3168. this.__data__ = [];
  3169. this.size = 0;
  3170. }
  3171. /**
  3172. * Removes `key` and its value from the list cache.
  3173. *
  3174. * @private
  3175. * @name delete
  3176. * @memberOf ListCache
  3177. * @param {string} key The key of the value to remove.
  3178. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3179. */
  3180. function listCacheDelete(key) {
  3181. var data = this.__data__,
  3182. index = assocIndexOf(data, key);
  3183. if (index < 0) {
  3184. return false;
  3185. }
  3186. var lastIndex = data.length - 1;
  3187. if (index == lastIndex) {
  3188. data.pop();
  3189. } else {
  3190. splice.call(data, index, 1);
  3191. }
  3192. --this.size;
  3193. return true;
  3194. }
  3195. /**
  3196. * Gets the list cache value for `key`.
  3197. *
  3198. * @private
  3199. * @name get
  3200. * @memberOf ListCache
  3201. * @param {string} key The key of the value to get.
  3202. * @returns {*} Returns the entry value.
  3203. */
  3204. function listCacheGet(key) {
  3205. var data = this.__data__,
  3206. index = assocIndexOf(data, key);
  3207. return index < 0 ? undefined : data[index][1];
  3208. }
  3209. /**
  3210. * Checks if a list cache value for `key` exists.
  3211. *
  3212. * @private
  3213. * @name has
  3214. * @memberOf ListCache
  3215. * @param {string} key The key of the entry to check.
  3216. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3217. */
  3218. function listCacheHas(key) {
  3219. return assocIndexOf(this.__data__, key) > -1;
  3220. }
  3221. /**
  3222. * Sets the list cache `key` to `value`.
  3223. *
  3224. * @private
  3225. * @name set
  3226. * @memberOf ListCache
  3227. * @param {string} key The key of the value to set.
  3228. * @param {*} value The value to set.
  3229. * @returns {Object} Returns the list cache instance.
  3230. */
  3231. function listCacheSet(key, value) {
  3232. var data = this.__data__,
  3233. index = assocIndexOf(data, key);
  3234. if (index < 0) {
  3235. ++this.size;
  3236. data.push([key, value]);
  3237. } else {
  3238. data[index][1] = value;
  3239. }
  3240. return this;
  3241. }
  3242. // Add methods to `ListCache`.
  3243. ListCache.prototype.clear = listCacheClear;
  3244. ListCache.prototype['delete'] = listCacheDelete;
  3245. ListCache.prototype.get = listCacheGet;
  3246. ListCache.prototype.has = listCacheHas;
  3247. ListCache.prototype.set = listCacheSet;
  3248. /*------------------------------------------------------------------------*/
  3249. /**
  3250. * Creates a map cache object to store key-value pairs.
  3251. *
  3252. * @private
  3253. * @constructor
  3254. * @param {Array} [entries] The key-value pairs to cache.
  3255. */
  3256. function MapCache(entries) {
  3257. var index = -1,
  3258. length = entries == null ? 0 : entries.length;
  3259. this.clear();
  3260. while (++index < length) {
  3261. var entry = entries[index];
  3262. this.set(entry[0], entry[1]);
  3263. }
  3264. }
  3265. /**
  3266. * Removes all key-value entries from the map.
  3267. *
  3268. * @private
  3269. * @name clear
  3270. * @memberOf MapCache
  3271. */
  3272. function mapCacheClear() {
  3273. this.size = 0;
  3274. this.__data__ = {
  3275. 'hash': new Hash,
  3276. 'map': new (Map || ListCache),
  3277. 'string': new Hash
  3278. };
  3279. }
  3280. /**
  3281. * Removes `key` and its value from the map.
  3282. *
  3283. * @private
  3284. * @name delete
  3285. * @memberOf MapCache
  3286. * @param {string} key The key of the value to remove.
  3287. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3288. */
  3289. function mapCacheDelete(key) {
  3290. var result = getMapData(this, key)['delete'](key);
  3291. this.size -= result ? 1 : 0;
  3292. return result;
  3293. }
  3294. /**
  3295. * Gets the map value for `key`.
  3296. *
  3297. * @private
  3298. * @name get
  3299. * @memberOf MapCache
  3300. * @param {string} key The key of the value to get.
  3301. * @returns {*} Returns the entry value.
  3302. */
  3303. function mapCacheGet(key) {
  3304. return getMapData(this, key).get(key);
  3305. }
  3306. /**
  3307. * Checks if a map value for `key` exists.
  3308. *
  3309. * @private
  3310. * @name has
  3311. * @memberOf MapCache
  3312. * @param {string} key The key of the entry to check.
  3313. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3314. */
  3315. function mapCacheHas(key) {
  3316. return getMapData(this, key).has(key);
  3317. }
  3318. /**
  3319. * Sets the map `key` to `value`.
  3320. *
  3321. * @private
  3322. * @name set
  3323. * @memberOf MapCache
  3324. * @param {string} key The key of the value to set.
  3325. * @param {*} value The value to set.
  3326. * @returns {Object} Returns the map cache instance.
  3327. */
  3328. function mapCacheSet(key, value) {
  3329. var data = getMapData(this, key),
  3330. size = data.size;
  3331. data.set(key, value);
  3332. this.size += data.size == size ? 0 : 1;
  3333. return this;
  3334. }
  3335. // Add methods to `MapCache`.
  3336. MapCache.prototype.clear = mapCacheClear;
  3337. MapCache.prototype['delete'] = mapCacheDelete;
  3338. MapCache.prototype.get = mapCacheGet;
  3339. MapCache.prototype.has = mapCacheHas;
  3340. MapCache.prototype.set = mapCacheSet;
  3341. /*------------------------------------------------------------------------*/
  3342. /**
  3343. *
  3344. * Creates an array cache object to store unique values.
  3345. *
  3346. * @private
  3347. * @constructor
  3348. * @param {Array} [values] The values to cache.
  3349. */
  3350. function SetCache(values) {
  3351. var index = -1,
  3352. length = values == null ? 0 : values.length;
  3353. this.__data__ = new MapCache;
  3354. while (++index < length) {
  3355. this.add(values[index]);
  3356. }
  3357. }
  3358. /**
  3359. * Adds `value` to the array cache.
  3360. *
  3361. * @private
  3362. * @name add
  3363. * @memberOf SetCache
  3364. * @alias push
  3365. * @param {*} value The value to cache.
  3366. * @returns {Object} Returns the cache instance.
  3367. */
  3368. function setCacheAdd(value) {
  3369. this.__data__.set(value, HASH_UNDEFINED);
  3370. return this;
  3371. }
  3372. /**
  3373. * Checks if `value` is in the array cache.
  3374. *
  3375. * @private
  3376. * @name has
  3377. * @memberOf SetCache
  3378. * @param {*} value The value to search for.
  3379. * @returns {number} Returns `true` if `value` is found, else `false`.
  3380. */
  3381. function setCacheHas(value) {
  3382. return this.__data__.has(value);
  3383. }
  3384. // Add methods to `SetCache`.
  3385. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3386. SetCache.prototype.has = setCacheHas;
  3387. /*------------------------------------------------------------------------*/
  3388. /**
  3389. * Creates a stack cache object to store key-value pairs.
  3390. *
  3391. * @private
  3392. * @constructor
  3393. * @param {Array} [entries] The key-value pairs to cache.
  3394. */
  3395. function Stack(entries) {
  3396. var data = this.__data__ = new ListCache(entries);
  3397. this.size = data.size;
  3398. }
  3399. /**
  3400. * Removes all key-value entries from the stack.
  3401. *
  3402. * @private
  3403. * @name clear
  3404. * @memberOf Stack
  3405. */
  3406. function stackClear() {
  3407. this.__data__ = new ListCache;
  3408. this.size = 0;
  3409. }
  3410. /**
  3411. * Removes `key` and its value from the stack.
  3412. *
  3413. * @private
  3414. * @name delete
  3415. * @memberOf Stack
  3416. * @param {string} key The key of the value to remove.
  3417. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3418. */
  3419. function stackDelete(key) {
  3420. var data = this.__data__,
  3421. result = data['delete'](key);
  3422. this.size = data.size;
  3423. return result;
  3424. }
  3425. /**
  3426. * Gets the stack value for `key`.
  3427. *
  3428. * @private
  3429. * @name get
  3430. * @memberOf Stack
  3431. * @param {string} key The key of the value to get.
  3432. * @returns {*} Returns the entry value.
  3433. */
  3434. function stackGet(key) {
  3435. return this.__data__.get(key);
  3436. }
  3437. /**
  3438. * Checks if a stack value for `key` exists.
  3439. *
  3440. * @private
  3441. * @name has
  3442. * @memberOf Stack
  3443. * @param {string} key The key of the entry to check.
  3444. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3445. */
  3446. function stackHas(key) {
  3447. return this.__data__.has(key);
  3448. }
  3449. /**
  3450. * Sets the stack `key` to `value`.
  3451. *
  3452. * @private
  3453. * @name set
  3454. * @memberOf Stack
  3455. * @param {string} key The key of the value to set.
  3456. * @param {*} value The value to set.
  3457. * @returns {Object} Returns the stack cache instance.
  3458. */
  3459. function stackSet(key, value) {
  3460. var data = this.__data__;
  3461. if (data instanceof ListCache) {
  3462. var pairs = data.__data__;
  3463. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3464. pairs.push([key, value]);
  3465. this.size = ++data.size;
  3466. return this;
  3467. }
  3468. data = this.__data__ = new MapCache(pairs);
  3469. }
  3470. data.set(key, value);
  3471. this.size = data.size;
  3472. return this;
  3473. }
  3474. // Add methods to `Stack`.
  3475. Stack.prototype.clear = stackClear;
  3476. Stack.prototype['delete'] = stackDelete;
  3477. Stack.prototype.get = stackGet;
  3478. Stack.prototype.has = stackHas;
  3479. Stack.prototype.set = stackSet;
  3480. /*------------------------------------------------------------------------*/
  3481. /**
  3482. * Creates an array of the enumerable property names of the array-like `value`.
  3483. *
  3484. * @private
  3485. * @param {*} value The value to query.
  3486. * @param {boolean} inherited Specify returning inherited property names.
  3487. * @returns {Array} Returns the array of property names.
  3488. */
  3489. function arrayLikeKeys(value, inherited) {
  3490. var isArr = isArray(value),
  3491. isArg = !isArr && isArguments(value),
  3492. isBuff = !isArr && !isArg && isBuffer(value),
  3493. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3494. skipIndexes = isArr || isArg || isBuff || isType,
  3495. result = skipIndexes ? baseTimes(value.length, String) : [],
  3496. length = result.length;
  3497. for (var key in value) {
  3498. if ((inherited || hasOwnProperty.call(value, key)) &&
  3499. !(skipIndexes && (
  3500. // Safari 9 has enumerable `arguments.length` in strict mode.
  3501. key == 'length' ||
  3502. // Node.js 0.10 has enumerable non-index properties on buffers.
  3503. (isBuff && (key == 'offset' || key == 'parent')) ||
  3504. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3505. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3506. // Skip index properties.
  3507. isIndex(key, length)
  3508. ))) {
  3509. result.push(key);
  3510. }
  3511. }
  3512. return result;
  3513. }
  3514. /**
  3515. * A specialized version of `_.sample` for arrays.
  3516. *
  3517. * @private
  3518. * @param {Array} array The array to sample.
  3519. * @returns {*} Returns the random element.
  3520. */
  3521. function arraySample(array) {
  3522. var length = array.length;
  3523. return length ? array[baseRandom(0, length - 1)] : undefined;
  3524. }
  3525. /**
  3526. * A specialized version of `_.sampleSize` for arrays.
  3527. *
  3528. * @private
  3529. * @param {Array} array The array to sample.
  3530. * @param {number} n The number of elements to sample.
  3531. * @returns {Array} Returns the random elements.
  3532. */
  3533. function arraySampleSize(array, n) {
  3534. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3535. }
  3536. /**
  3537. * A specialized version of `_.shuffle` for arrays.
  3538. *
  3539. * @private
  3540. * @param {Array} array The array to shuffle.
  3541. * @returns {Array} Returns the new shuffled array.
  3542. */
  3543. function arrayShuffle(array) {
  3544. return shuffleSelf(copyArray(array));
  3545. }
  3546. /**
  3547. * This function is like `assignValue` except that it doesn't assign
  3548. * `undefined` values.
  3549. *
  3550. * @private
  3551. * @param {Object} object The object to modify.
  3552. * @param {string} key The key of the property to assign.
  3553. * @param {*} value The value to assign.
  3554. */
  3555. function assignMergeValue(object, key, value) {
  3556. if ((value !== undefined && !eq(object[key], value)) ||
  3557. (value === undefined && !(key in object))) {
  3558. baseAssignValue(object, key, value);
  3559. }
  3560. }
  3561. /**
  3562. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3563. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3564. * for equality comparisons.
  3565. *
  3566. * @private
  3567. * @param {Object} object The object to modify.
  3568. * @param {string} key The key of the property to assign.
  3569. * @param {*} value The value to assign.
  3570. */
  3571. function assignValue(object, key, value) {
  3572. var objValue = object[key];
  3573. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3574. (value === undefined && !(key in object))) {
  3575. baseAssignValue(object, key, value);
  3576. }
  3577. }
  3578. /**
  3579. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3580. *
  3581. * @private
  3582. * @param {Array} array The array to inspect.
  3583. * @param {*} key The key to search for.
  3584. * @returns {number} Returns the index of the matched value, else `-1`.
  3585. */
  3586. function assocIndexOf(array, key) {
  3587. var length = array.length;
  3588. while (length--) {
  3589. if (eq(array[length][0], key)) {
  3590. return length;
  3591. }
  3592. }
  3593. return -1;
  3594. }
  3595. /**
  3596. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3597. * by `iteratee` and values set by `setter`.
  3598. *
  3599. * @private
  3600. * @param {Array|Object} collection The collection to iterate over.
  3601. * @param {Function} setter The function to set `accumulator` values.
  3602. * @param {Function} iteratee The iteratee to transform keys.
  3603. * @param {Object} accumulator The initial aggregated object.
  3604. * @returns {Function} Returns `accumulator`.
  3605. */
  3606. function baseAggregator(collection, setter, iteratee, accumulator) {
  3607. baseEach(collection, function(value, key, collection) {
  3608. setter(accumulator, value, iteratee(value), collection);
  3609. });
  3610. return accumulator;
  3611. }
  3612. /**
  3613. * The base implementation of `_.assign` without support for multiple sources
  3614. * or `customizer` functions.
  3615. *
  3616. * @private
  3617. * @param {Object} object The destination object.
  3618. * @param {Object} source The source object.
  3619. * @returns {Object} Returns `object`.
  3620. */
  3621. function baseAssign(object, source) {
  3622. return object && copyObject(source, keys(source), object);
  3623. }
  3624. /**
  3625. * The base implementation of `_.assignIn` without support for multiple sources
  3626. * or `customizer` functions.
  3627. *
  3628. * @private
  3629. * @param {Object} object The destination object.
  3630. * @param {Object} source The source object.
  3631. * @returns {Object} Returns `object`.
  3632. */
  3633. function baseAssignIn(object, source) {
  3634. return object && copyObject(source, keysIn(source), object);
  3635. }
  3636. /**
  3637. * The base implementation of `assignValue` and `assignMergeValue` without
  3638. * value checks.
  3639. *
  3640. * @private
  3641. * @param {Object} object The object to modify.
  3642. * @param {string} key The key of the property to assign.
  3643. * @param {*} value The value to assign.
  3644. */
  3645. function baseAssignValue(object, key, value) {
  3646. if (key == '__proto__' && defineProperty) {
  3647. defineProperty(object, key, {
  3648. 'configurable': true,
  3649. 'enumerable': true,
  3650. 'value': value,
  3651. 'writable': true
  3652. });
  3653. } else {
  3654. object[key] = value;
  3655. }
  3656. }
  3657. /**
  3658. * The base implementation of `_.at` without support for individual paths.
  3659. *
  3660. * @private
  3661. * @param {Object} object The object to iterate over.
  3662. * @param {string[]} paths The property paths to pick.
  3663. * @returns {Array} Returns the picked elements.
  3664. */
  3665. function baseAt(object, paths) {
  3666. var index = -1,
  3667. length = paths.length,
  3668. result = Array(length),
  3669. skip = object == null;
  3670. while (++index < length) {
  3671. result[index] = skip ? undefined : get(object, paths[index]);
  3672. }
  3673. return result;
  3674. }
  3675. /**
  3676. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3677. *
  3678. * @private
  3679. * @param {number} number The number to clamp.
  3680. * @param {number} [lower] The lower bound.
  3681. * @param {number} upper The upper bound.
  3682. * @returns {number} Returns the clamped number.
  3683. */
  3684. function baseClamp(number, lower, upper) {
  3685. if (number === number) {
  3686. if (upper !== undefined) {
  3687. number = number <= upper ? number : upper;
  3688. }
  3689. if (lower !== undefined) {
  3690. number = number >= lower ? number : lower;
  3691. }
  3692. }
  3693. return number;
  3694. }
  3695. /**
  3696. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3697. * traversed objects.
  3698. *
  3699. * @private
  3700. * @param {*} value The value to clone.
  3701. * @param {boolean} bitmask The bitmask flags.
  3702. * 1 - Deep clone
  3703. * 2 - Flatten inherited properties
  3704. * 4 - Clone symbols
  3705. * @param {Function} [customizer] The function to customize cloning.
  3706. * @param {string} [key] The key of `value`.
  3707. * @param {Object} [object] The parent object of `value`.
  3708. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3709. * @returns {*} Returns the cloned value.
  3710. */
  3711. function baseClone(value, bitmask, customizer, key, object, stack) {
  3712. var result,
  3713. isDeep = bitmask & CLONE_DEEP_FLAG,
  3714. isFlat = bitmask & CLONE_FLAT_FLAG,
  3715. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3716. if (customizer) {
  3717. result = object ? customizer(value, key, object, stack) : customizer(value);
  3718. }
  3719. if (result !== undefined) {
  3720. return result;
  3721. }
  3722. if (!isObject(value)) {
  3723. return value;
  3724. }
  3725. var isArr = isArray(value);
  3726. if (isArr) {
  3727. result = initCloneArray(value);
  3728. if (!isDeep) {
  3729. return copyArray(value, result);
  3730. }
  3731. } else {
  3732. var tag = getTag(value),
  3733. isFunc = tag == funcTag || tag == genTag;
  3734. if (isBuffer(value)) {
  3735. return cloneBuffer(value, isDeep);
  3736. }
  3737. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3738. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3739. if (!isDeep) {
  3740. return isFlat
  3741. ? copySymbolsIn(value, baseAssignIn(result, value))
  3742. : copySymbols(value, baseAssign(result, value));
  3743. }
  3744. } else {
  3745. if (!cloneableTags[tag]) {
  3746. return object ? value : {};
  3747. }
  3748. result = initCloneByTag(value, tag, isDeep);
  3749. }
  3750. }
  3751. // Check for circular references and return its corresponding clone.
  3752. stack || (stack = new Stack);
  3753. var stacked = stack.get(value);
  3754. if (stacked) {
  3755. return stacked;
  3756. }
  3757. stack.set(value, result);
  3758. if (isSet(value)) {
  3759. value.forEach(function(subValue) {
  3760. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3761. });
  3762. } else if (isMap(value)) {
  3763. value.forEach(function(subValue, key) {
  3764. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3765. });
  3766. }
  3767. var keysFunc = isFull
  3768. ? (isFlat ? getAllKeysIn : getAllKeys)
  3769. : (isFlat ? keysIn : keys);
  3770. var props = isArr ? undefined : keysFunc(value);
  3771. arrayEach(props || value, function(subValue, key) {
  3772. if (props) {
  3773. key = subValue;
  3774. subValue = value[key];
  3775. }
  3776. // Recursively populate clone (susceptible to call stack limits).
  3777. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3778. });
  3779. return result;
  3780. }
  3781. /**
  3782. * The base implementation of `_.conforms` which doesn't clone `source`.
  3783. *
  3784. * @private
  3785. * @param {Object} source The object of property predicates to conform to.
  3786. * @returns {Function} Returns the new spec function.
  3787. */
  3788. function baseConforms(source) {
  3789. var props = keys(source);
  3790. return function(object) {
  3791. return baseConformsTo(object, source, props);
  3792. };
  3793. }
  3794. /**
  3795. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3796. *
  3797. * @private
  3798. * @param {Object} object The object to inspect.
  3799. * @param {Object} source The object of property predicates to conform to.
  3800. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3801. */
  3802. function baseConformsTo(object, source, props) {
  3803. var length = props.length;
  3804. if (object == null) {
  3805. return !length;
  3806. }
  3807. object = Object(object);
  3808. while (length--) {
  3809. var key = props[length],
  3810. predicate = source[key],
  3811. value = object[key];
  3812. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3813. return false;
  3814. }
  3815. }
  3816. return true;
  3817. }
  3818. /**
  3819. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3820. * to provide to `func`.
  3821. *
  3822. * @private
  3823. * @param {Function} func The function to delay.
  3824. * @param {number} wait The number of milliseconds to delay invocation.
  3825. * @param {Array} args The arguments to provide to `func`.
  3826. * @returns {number|Object} Returns the timer id or timeout object.
  3827. */
  3828. function baseDelay(func, wait, args) {
  3829. if (typeof func != 'function') {
  3830. throw new TypeError(FUNC_ERROR_TEXT);
  3831. }
  3832. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3833. }
  3834. /**
  3835. * The base implementation of methods like `_.difference` without support
  3836. * for excluding multiple arrays or iteratee shorthands.
  3837. *
  3838. * @private
  3839. * @param {Array} array The array to inspect.
  3840. * @param {Array} values The values to exclude.
  3841. * @param {Function} [iteratee] The iteratee invoked per element.
  3842. * @param {Function} [comparator] The comparator invoked per element.
  3843. * @returns {Array} Returns the new array of filtered values.
  3844. */
  3845. function baseDifference(array, values, iteratee, comparator) {
  3846. var index = -1,
  3847. includes = arrayIncludes,
  3848. isCommon = true,
  3849. length = array.length,
  3850. result = [],
  3851. valuesLength = values.length;
  3852. if (!length) {
  3853. return result;
  3854. }
  3855. if (iteratee) {
  3856. values = arrayMap(values, baseUnary(iteratee));
  3857. }
  3858. if (comparator) {
  3859. includes = arrayIncludesWith;
  3860. isCommon = false;
  3861. }
  3862. else if (values.length >= LARGE_ARRAY_SIZE) {
  3863. includes = cacheHas;
  3864. isCommon = false;
  3865. values = new SetCache(values);
  3866. }
  3867. outer:
  3868. while (++index < length) {
  3869. var value = array[index],
  3870. computed = iteratee == null ? value : iteratee(value);
  3871. value = (comparator || value !== 0) ? value : 0;
  3872. if (isCommon && computed === computed) {
  3873. var valuesIndex = valuesLength;
  3874. while (valuesIndex--) {
  3875. if (values[valuesIndex] === computed) {
  3876. continue outer;
  3877. }
  3878. }
  3879. result.push(value);
  3880. }
  3881. else if (!includes(values, computed, comparator)) {
  3882. result.push(value);
  3883. }
  3884. }
  3885. return result;
  3886. }
  3887. /**
  3888. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3889. *
  3890. * @private
  3891. * @param {Array|Object} collection The collection to iterate over.
  3892. * @param {Function} iteratee The function invoked per iteration.
  3893. * @returns {Array|Object} Returns `collection`.
  3894. */
  3895. var baseEach = createBaseEach(baseForOwn);
  3896. /**
  3897. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3898. *
  3899. * @private
  3900. * @param {Array|Object} collection The collection to iterate over.
  3901. * @param {Function} iteratee The function invoked per iteration.
  3902. * @returns {Array|Object} Returns `collection`.
  3903. */
  3904. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3905. /**
  3906. * The base implementation of `_.every` without support for iteratee shorthands.
  3907. *
  3908. * @private
  3909. * @param {Array|Object} collection The collection to iterate over.
  3910. * @param {Function} predicate The function invoked per iteration.
  3911. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3912. * else `false`
  3913. */
  3914. function baseEvery(collection, predicate) {
  3915. var result = true;
  3916. baseEach(collection, function(value, index, collection) {
  3917. result = !!predicate(value, index, collection);
  3918. return result;
  3919. });
  3920. return result;
  3921. }
  3922. /**
  3923. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3924. * `comparator` to determine the extremum value.
  3925. *
  3926. * @private
  3927. * @param {Array} array The array to iterate over.
  3928. * @param {Function} iteratee The iteratee invoked per iteration.
  3929. * @param {Function} comparator The comparator used to compare values.
  3930. * @returns {*} Returns the extremum value.
  3931. */
  3932. function baseExtremum(array, iteratee, comparator) {
  3933. var index = -1,
  3934. length = array.length;
  3935. while (++index < length) {
  3936. var value = array[index],
  3937. current = iteratee(value);
  3938. if (current != null && (computed === undefined
  3939. ? (current === current && !isSymbol(current))
  3940. : comparator(current, computed)
  3941. )) {
  3942. var computed = current,
  3943. result = value;
  3944. }
  3945. }
  3946. return result;
  3947. }
  3948. /**
  3949. * The base implementation of `_.fill` without an iteratee call guard.
  3950. *
  3951. * @private
  3952. * @param {Array} array The array to fill.
  3953. * @param {*} value The value to fill `array` with.
  3954. * @param {number} [start=0] The start position.
  3955. * @param {number} [end=array.length] The end position.
  3956. * @returns {Array} Returns `array`.
  3957. */
  3958. function baseFill(array, value, start, end) {
  3959. var length = array.length;
  3960. start = toInteger(start);
  3961. if (start < 0) {
  3962. start = -start > length ? 0 : (length + start);
  3963. }
  3964. end = (end === undefined || end > length) ? length : toInteger(end);
  3965. if (end < 0) {
  3966. end += length;
  3967. }
  3968. end = start > end ? 0 : toLength(end);
  3969. while (start < end) {
  3970. array[start++] = value;
  3971. }
  3972. return array;
  3973. }
  3974. /**
  3975. * The base implementation of `_.filter` without support for iteratee shorthands.
  3976. *
  3977. * @private
  3978. * @param {Array|Object} collection The collection to iterate over.
  3979. * @param {Function} predicate The function invoked per iteration.
  3980. * @returns {Array} Returns the new filtered array.
  3981. */
  3982. function baseFilter(collection, predicate) {
  3983. var result = [];
  3984. baseEach(collection, function(value, index, collection) {
  3985. if (predicate(value, index, collection)) {
  3986. result.push(value);
  3987. }
  3988. });
  3989. return result;
  3990. }
  3991. /**
  3992. * The base implementation of `_.flatten` with support for restricting flattening.
  3993. *
  3994. * @private
  3995. * @param {Array} array The array to flatten.
  3996. * @param {number} depth The maximum recursion depth.
  3997. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3998. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3999. * @param {Array} [result=[]] The initial result value.
  4000. * @returns {Array} Returns the new flattened array.
  4001. */
  4002. function baseFlatten(array, depth, predicate, isStrict, result) {
  4003. var index = -1,
  4004. length = array.length;
  4005. predicate || (predicate = isFlattenable);
  4006. result || (result = []);
  4007. while (++index < length) {
  4008. var value = array[index];
  4009. if (depth > 0 && predicate(value)) {
  4010. if (depth > 1) {
  4011. // Recursively flatten arrays (susceptible to call stack limits).
  4012. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4013. } else {
  4014. arrayPush(result, value);
  4015. }
  4016. } else if (!isStrict) {
  4017. result[result.length] = value;
  4018. }
  4019. }
  4020. return result;
  4021. }
  4022. /**
  4023. * The base implementation of `baseForOwn` which iterates over `object`
  4024. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4025. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4026. *
  4027. * @private
  4028. * @param {Object} object The object to iterate over.
  4029. * @param {Function} iteratee The function invoked per iteration.
  4030. * @param {Function} keysFunc The function to get the keys of `object`.
  4031. * @returns {Object} Returns `object`.
  4032. */
  4033. var baseFor = createBaseFor();
  4034. /**
  4035. * This function is like `baseFor` except that it iterates over properties
  4036. * in the opposite order.
  4037. *
  4038. * @private
  4039. * @param {Object} object The object to iterate over.
  4040. * @param {Function} iteratee The function invoked per iteration.
  4041. * @param {Function} keysFunc The function to get the keys of `object`.
  4042. * @returns {Object} Returns `object`.
  4043. */
  4044. var baseForRight = createBaseFor(true);
  4045. /**
  4046. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4047. *
  4048. * @private
  4049. * @param {Object} object The object to iterate over.
  4050. * @param {Function} iteratee The function invoked per iteration.
  4051. * @returns {Object} Returns `object`.
  4052. */
  4053. function baseForOwn(object, iteratee) {
  4054. return object && baseFor(object, iteratee, keys);
  4055. }
  4056. /**
  4057. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4058. *
  4059. * @private
  4060. * @param {Object} object The object to iterate over.
  4061. * @param {Function} iteratee The function invoked per iteration.
  4062. * @returns {Object} Returns `object`.
  4063. */
  4064. function baseForOwnRight(object, iteratee) {
  4065. return object && baseForRight(object, iteratee, keys);
  4066. }
  4067. /**
  4068. * The base implementation of `_.functions` which creates an array of
  4069. * `object` function property names filtered from `props`.
  4070. *
  4071. * @private
  4072. * @param {Object} object The object to inspect.
  4073. * @param {Array} props The property names to filter.
  4074. * @returns {Array} Returns the function names.
  4075. */
  4076. function baseFunctions(object, props) {
  4077. return arrayFilter(props, function(key) {
  4078. return isFunction(object[key]);
  4079. });
  4080. }
  4081. /**
  4082. * The base implementation of `_.get` without support for default values.
  4083. *
  4084. * @private
  4085. * @param {Object} object The object to query.
  4086. * @param {Array|string} path The path of the property to get.
  4087. * @returns {*} Returns the resolved value.
  4088. */
  4089. function baseGet(object, path) {
  4090. path = castPath(path, object);
  4091. var index = 0,
  4092. length = path.length;
  4093. while (object != null && index < length) {
  4094. object = object[toKey(path[index++])];
  4095. }
  4096. return (index && index == length) ? object : undefined;
  4097. }
  4098. /**
  4099. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4100. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4101. * symbols of `object`.
  4102. *
  4103. * @private
  4104. * @param {Object} object The object to query.
  4105. * @param {Function} keysFunc The function to get the keys of `object`.
  4106. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4107. * @returns {Array} Returns the array of property names and symbols.
  4108. */
  4109. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4110. var result = keysFunc(object);
  4111. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4112. }
  4113. /**
  4114. * The base implementation of `getTag` without fallbacks for buggy environments.
  4115. *
  4116. * @private
  4117. * @param {*} value The value to query.
  4118. * @returns {string} Returns the `toStringTag`.
  4119. */
  4120. function baseGetTag(value) {
  4121. if (value == null) {
  4122. return value === undefined ? undefinedTag : nullTag;
  4123. }
  4124. return (symToStringTag && symToStringTag in Object(value))
  4125. ? getRawTag(value)
  4126. : objectToString(value);
  4127. }
  4128. /**
  4129. * The base implementation of `_.gt` which doesn't coerce arguments.
  4130. *
  4131. * @private
  4132. * @param {*} value The value to compare.
  4133. * @param {*} other The other value to compare.
  4134. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4135. * else `false`.
  4136. */
  4137. function baseGt(value, other) {
  4138. return value > other;
  4139. }
  4140. /**
  4141. * The base implementation of `_.has` without support for deep paths.
  4142. *
  4143. * @private
  4144. * @param {Object} [object] The object to query.
  4145. * @param {Array|string} key The key to check.
  4146. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4147. */
  4148. function baseHas(object, key) {
  4149. return object != null && hasOwnProperty.call(object, key);
  4150. }
  4151. /**
  4152. * The base implementation of `_.hasIn` without support for deep paths.
  4153. *
  4154. * @private
  4155. * @param {Object} [object] The object to query.
  4156. * @param {Array|string} key The key to check.
  4157. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4158. */
  4159. function baseHasIn(object, key) {
  4160. return object != null && key in Object(object);
  4161. }
  4162. /**
  4163. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4164. *
  4165. * @private
  4166. * @param {number} number The number to check.
  4167. * @param {number} start The start of the range.
  4168. * @param {number} end The end of the range.
  4169. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4170. */
  4171. function baseInRange(number, start, end) {
  4172. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4173. }
  4174. /**
  4175. * The base implementation of methods like `_.intersection`, without support
  4176. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4177. *
  4178. * @private
  4179. * @param {Array} arrays The arrays to inspect.
  4180. * @param {Function} [iteratee] The iteratee invoked per element.
  4181. * @param {Function} [comparator] The comparator invoked per element.
  4182. * @returns {Array} Returns the new array of shared values.
  4183. */
  4184. function baseIntersection(arrays, iteratee, comparator) {
  4185. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4186. length = arrays[0].length,
  4187. othLength = arrays.length,
  4188. othIndex = othLength,
  4189. caches = Array(othLength),
  4190. maxLength = Infinity,
  4191. result = [];
  4192. while (othIndex--) {
  4193. var array = arrays[othIndex];
  4194. if (othIndex && iteratee) {
  4195. array = arrayMap(array, baseUnary(iteratee));
  4196. }
  4197. maxLength = nativeMin(array.length, maxLength);
  4198. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4199. ? new SetCache(othIndex && array)
  4200. : undefined;
  4201. }
  4202. array = arrays[0];
  4203. var index = -1,
  4204. seen = caches[0];
  4205. outer:
  4206. while (++index < length && result.length < maxLength) {
  4207. var value = array[index],
  4208. computed = iteratee ? iteratee(value) : value;
  4209. value = (comparator || value !== 0) ? value : 0;
  4210. if (!(seen
  4211. ? cacheHas(seen, computed)
  4212. : includes(result, computed, comparator)
  4213. )) {
  4214. othIndex = othLength;
  4215. while (--othIndex) {
  4216. var cache = caches[othIndex];
  4217. if (!(cache
  4218. ? cacheHas(cache, computed)
  4219. : includes(arrays[othIndex], computed, comparator))
  4220. ) {
  4221. continue outer;
  4222. }
  4223. }
  4224. if (seen) {
  4225. seen.push(computed);
  4226. }
  4227. result.push(value);
  4228. }
  4229. }
  4230. return result;
  4231. }
  4232. /**
  4233. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4234. * `object` with values transformed by `iteratee` and set by `setter`.
  4235. *
  4236. * @private
  4237. * @param {Object} object The object to iterate over.
  4238. * @param {Function} setter The function to set `accumulator` values.
  4239. * @param {Function} iteratee The iteratee to transform values.
  4240. * @param {Object} accumulator The initial inverted object.
  4241. * @returns {Function} Returns `accumulator`.
  4242. */
  4243. function baseInverter(object, setter, iteratee, accumulator) {
  4244. baseForOwn(object, function(value, key, object) {
  4245. setter(accumulator, iteratee(value), key, object);
  4246. });
  4247. return accumulator;
  4248. }
  4249. /**
  4250. * The base implementation of `_.invoke` without support for individual
  4251. * method arguments.
  4252. *
  4253. * @private
  4254. * @param {Object} object The object to query.
  4255. * @param {Array|string} path The path of the method to invoke.
  4256. * @param {Array} args The arguments to invoke the method with.
  4257. * @returns {*} Returns the result of the invoked method.
  4258. */
  4259. function baseInvoke(object, path, args) {
  4260. path = castPath(path, object);
  4261. object = parent(object, path);
  4262. var func = object == null ? object : object[toKey(last(path))];
  4263. return func == null ? undefined : apply(func, object, args);
  4264. }
  4265. /**
  4266. * The base implementation of `_.isArguments`.
  4267. *
  4268. * @private
  4269. * @param {*} value The value to check.
  4270. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4271. */
  4272. function baseIsArguments(value) {
  4273. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4274. }
  4275. /**
  4276. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4277. *
  4278. * @private
  4279. * @param {*} value The value to check.
  4280. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4281. */
  4282. function baseIsArrayBuffer(value) {
  4283. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4284. }
  4285. /**
  4286. * The base implementation of `_.isDate` without Node.js optimizations.
  4287. *
  4288. * @private
  4289. * @param {*} value The value to check.
  4290. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4291. */
  4292. function baseIsDate(value) {
  4293. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4294. }
  4295. /**
  4296. * The base implementation of `_.isEqual` which supports partial comparisons
  4297. * and tracks traversed objects.
  4298. *
  4299. * @private
  4300. * @param {*} value The value to compare.
  4301. * @param {*} other The other value to compare.
  4302. * @param {boolean} bitmask The bitmask flags.
  4303. * 1 - Unordered comparison
  4304. * 2 - Partial comparison
  4305. * @param {Function} [customizer] The function to customize comparisons.
  4306. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4307. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4308. */
  4309. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4310. if (value === other) {
  4311. return true;
  4312. }
  4313. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4314. return value !== value && other !== other;
  4315. }
  4316. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4317. }
  4318. /**
  4319. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4320. * deep comparisons and tracks traversed objects enabling objects with circular
  4321. * references to be compared.
  4322. *
  4323. * @private
  4324. * @param {Object} object The object to compare.
  4325. * @param {Object} other The other object to compare.
  4326. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4327. * @param {Function} customizer The function to customize comparisons.
  4328. * @param {Function} equalFunc The function to determine equivalents of values.
  4329. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4330. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4331. */
  4332. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4333. var objIsArr = isArray(object),
  4334. othIsArr = isArray(other),
  4335. objTag = objIsArr ? arrayTag : getTag(object),
  4336. othTag = othIsArr ? arrayTag : getTag(other);
  4337. objTag = objTag == argsTag ? objectTag : objTag;
  4338. othTag = othTag == argsTag ? objectTag : othTag;
  4339. var objIsObj = objTag == objectTag,
  4340. othIsObj = othTag == objectTag,
  4341. isSameTag = objTag == othTag;
  4342. if (isSameTag && isBuffer(object)) {
  4343. if (!isBuffer(other)) {
  4344. return false;
  4345. }
  4346. objIsArr = true;
  4347. objIsObj = false;
  4348. }
  4349. if (isSameTag && !objIsObj) {
  4350. stack || (stack = new Stack);
  4351. return (objIsArr || isTypedArray(object))
  4352. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4353. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4354. }
  4355. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4356. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4357. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4358. if (objIsWrapped || othIsWrapped) {
  4359. var objUnwrapped = objIsWrapped ? object.value() : object,
  4360. othUnwrapped = othIsWrapped ? other.value() : other;
  4361. stack || (stack = new Stack);
  4362. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4363. }
  4364. }
  4365. if (!isSameTag) {
  4366. return false;
  4367. }
  4368. stack || (stack = new Stack);
  4369. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4370. }
  4371. /**
  4372. * The base implementation of `_.isMap` without Node.js optimizations.
  4373. *
  4374. * @private
  4375. * @param {*} value The value to check.
  4376. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4377. */
  4378. function baseIsMap(value) {
  4379. return isObjectLike(value) && getTag(value) == mapTag;
  4380. }
  4381. /**
  4382. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4383. *
  4384. * @private
  4385. * @param {Object} object The object to inspect.
  4386. * @param {Object} source The object of property values to match.
  4387. * @param {Array} matchData The property names, values, and compare flags to match.
  4388. * @param {Function} [customizer] The function to customize comparisons.
  4389. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4390. */
  4391. function baseIsMatch(object, source, matchData, customizer) {
  4392. var index = matchData.length,
  4393. length = index,
  4394. noCustomizer = !customizer;
  4395. if (object == null) {
  4396. return !length;
  4397. }
  4398. object = Object(object);
  4399. while (index--) {
  4400. var data = matchData[index];
  4401. if ((noCustomizer && data[2])
  4402. ? data[1] !== object[data[0]]
  4403. : !(data[0] in object)
  4404. ) {
  4405. return false;
  4406. }
  4407. }
  4408. while (++index < length) {
  4409. data = matchData[index];
  4410. var key = data[0],
  4411. objValue = object[key],
  4412. srcValue = data[1];
  4413. if (noCustomizer && data[2]) {
  4414. if (objValue === undefined && !(key in object)) {
  4415. return false;
  4416. }
  4417. } else {
  4418. var stack = new Stack;
  4419. if (customizer) {
  4420. var result = customizer(objValue, srcValue, key, object, source, stack);
  4421. }
  4422. if (!(result === undefined
  4423. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4424. : result
  4425. )) {
  4426. return false;
  4427. }
  4428. }
  4429. }
  4430. return true;
  4431. }
  4432. /**
  4433. * The base implementation of `_.isNative` without bad shim checks.
  4434. *
  4435. * @private
  4436. * @param {*} value The value to check.
  4437. * @returns {boolean} Returns `true` if `value` is a native function,
  4438. * else `false`.
  4439. */
  4440. function baseIsNative(value) {
  4441. if (!isObject(value) || isMasked(value)) {
  4442. return false;
  4443. }
  4444. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4445. return pattern.test(toSource(value));
  4446. }
  4447. /**
  4448. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4449. *
  4450. * @private
  4451. * @param {*} value The value to check.
  4452. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4453. */
  4454. function baseIsRegExp(value) {
  4455. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4456. }
  4457. /**
  4458. * The base implementation of `_.isSet` without Node.js optimizations.
  4459. *
  4460. * @private
  4461. * @param {*} value The value to check.
  4462. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4463. */
  4464. function baseIsSet(value) {
  4465. return isObjectLike(value) && getTag(value) == setTag;
  4466. }
  4467. /**
  4468. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4469. *
  4470. * @private
  4471. * @param {*} value The value to check.
  4472. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4473. */
  4474. function baseIsTypedArray(value) {
  4475. return isObjectLike(value) &&
  4476. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4477. }
  4478. /**
  4479. * The base implementation of `_.iteratee`.
  4480. *
  4481. * @private
  4482. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4483. * @returns {Function} Returns the iteratee.
  4484. */
  4485. function baseIteratee(value) {
  4486. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4487. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4488. if (typeof value == 'function') {
  4489. return value;
  4490. }
  4491. if (value == null) {
  4492. return identity;
  4493. }
  4494. if (typeof value == 'object') {
  4495. return isArray(value)
  4496. ? baseMatchesProperty(value[0], value[1])
  4497. : baseMatches(value);
  4498. }
  4499. return property(value);
  4500. }
  4501. /**
  4502. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4503. *
  4504. * @private
  4505. * @param {Object} object The object to query.
  4506. * @returns {Array} Returns the array of property names.
  4507. */
  4508. function baseKeys(object) {
  4509. if (!isPrototype(object)) {
  4510. return nativeKeys(object);
  4511. }
  4512. var result = [];
  4513. for (var key in Object(object)) {
  4514. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4515. result.push(key);
  4516. }
  4517. }
  4518. return result;
  4519. }
  4520. /**
  4521. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4522. *
  4523. * @private
  4524. * @param {Object} object The object to query.
  4525. * @returns {Array} Returns the array of property names.
  4526. */
  4527. function baseKeysIn(object) {
  4528. if (!isObject(object)) {
  4529. return nativeKeysIn(object);
  4530. }
  4531. var isProto = isPrototype(object),
  4532. result = [];
  4533. for (var key in object) {
  4534. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4535. result.push(key);
  4536. }
  4537. }
  4538. return result;
  4539. }
  4540. /**
  4541. * The base implementation of `_.lt` which doesn't coerce arguments.
  4542. *
  4543. * @private
  4544. * @param {*} value The value to compare.
  4545. * @param {*} other The other value to compare.
  4546. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4547. * else `false`.
  4548. */
  4549. function baseLt(value, other) {
  4550. return value < other;
  4551. }
  4552. /**
  4553. * The base implementation of `_.map` without support for iteratee shorthands.
  4554. *
  4555. * @private
  4556. * @param {Array|Object} collection The collection to iterate over.
  4557. * @param {Function} iteratee The function invoked per iteration.
  4558. * @returns {Array} Returns the new mapped array.
  4559. */
  4560. function baseMap(collection, iteratee) {
  4561. var index = -1,
  4562. result = isArrayLike(collection) ? Array(collection.length) : [];
  4563. baseEach(collection, function(value, key, collection) {
  4564. result[++index] = iteratee(value, key, collection);
  4565. });
  4566. return result;
  4567. }
  4568. /**
  4569. * The base implementation of `_.matches` which doesn't clone `source`.
  4570. *
  4571. * @private
  4572. * @param {Object} source The object of property values to match.
  4573. * @returns {Function} Returns the new spec function.
  4574. */
  4575. function baseMatches(source) {
  4576. var matchData = getMatchData(source);
  4577. if (matchData.length == 1 && matchData[0][2]) {
  4578. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4579. }
  4580. return function(object) {
  4581. return object === source || baseIsMatch(object, source, matchData);
  4582. };
  4583. }
  4584. /**
  4585. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4586. *
  4587. * @private
  4588. * @param {string} path The path of the property to get.
  4589. * @param {*} srcValue The value to match.
  4590. * @returns {Function} Returns the new spec function.
  4591. */
  4592. function baseMatchesProperty(path, srcValue) {
  4593. if (isKey(path) && isStrictComparable(srcValue)) {
  4594. return matchesStrictComparable(toKey(path), srcValue);
  4595. }
  4596. return function(object) {
  4597. var objValue = get(object, path);
  4598. return (objValue === undefined && objValue === srcValue)
  4599. ? hasIn(object, path)
  4600. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4601. };
  4602. }
  4603. /**
  4604. * The base implementation of `_.merge` without support for multiple sources.
  4605. *
  4606. * @private
  4607. * @param {Object} object The destination object.
  4608. * @param {Object} source The source object.
  4609. * @param {number} srcIndex The index of `source`.
  4610. * @param {Function} [customizer] The function to customize merged values.
  4611. * @param {Object} [stack] Tracks traversed source values and their merged
  4612. * counterparts.
  4613. */
  4614. function baseMerge(object, source, srcIndex, customizer, stack) {
  4615. if (object === source) {
  4616. return;
  4617. }
  4618. baseFor(source, function(srcValue, key) {
  4619. stack || (stack = new Stack);
  4620. if (isObject(srcValue)) {
  4621. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4622. }
  4623. else {
  4624. var newValue = customizer
  4625. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4626. : undefined;
  4627. if (newValue === undefined) {
  4628. newValue = srcValue;
  4629. }
  4630. assignMergeValue(object, key, newValue);
  4631. }
  4632. }, keysIn);
  4633. }
  4634. /**
  4635. * A specialized version of `baseMerge` for arrays and objects which performs
  4636. * deep merges and tracks traversed objects enabling objects with circular
  4637. * references to be merged.
  4638. *
  4639. * @private
  4640. * @param {Object} object The destination object.
  4641. * @param {Object} source The source object.
  4642. * @param {string} key The key of the value to merge.
  4643. * @param {number} srcIndex The index of `source`.
  4644. * @param {Function} mergeFunc The function to merge values.
  4645. * @param {Function} [customizer] The function to customize assigned values.
  4646. * @param {Object} [stack] Tracks traversed source values and their merged
  4647. * counterparts.
  4648. */
  4649. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4650. var objValue = safeGet(object, key),
  4651. srcValue = safeGet(source, key),
  4652. stacked = stack.get(srcValue);
  4653. if (stacked) {
  4654. assignMergeValue(object, key, stacked);
  4655. return;
  4656. }
  4657. var newValue = customizer
  4658. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4659. : undefined;
  4660. var isCommon = newValue === undefined;
  4661. if (isCommon) {
  4662. var isArr = isArray(srcValue),
  4663. isBuff = !isArr && isBuffer(srcValue),
  4664. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4665. newValue = srcValue;
  4666. if (isArr || isBuff || isTyped) {
  4667. if (isArray(objValue)) {
  4668. newValue = objValue;
  4669. }
  4670. else if (isArrayLikeObject(objValue)) {
  4671. newValue = copyArray(objValue);
  4672. }
  4673. else if (isBuff) {
  4674. isCommon = false;
  4675. newValue = cloneBuffer(srcValue, true);
  4676. }
  4677. else if (isTyped) {
  4678. isCommon = false;
  4679. newValue = cloneTypedArray(srcValue, true);
  4680. }
  4681. else {
  4682. newValue = [];
  4683. }
  4684. }
  4685. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4686. newValue = objValue;
  4687. if (isArguments(objValue)) {
  4688. newValue = toPlainObject(objValue);
  4689. }
  4690. else if (!isObject(objValue) || isFunction(objValue)) {
  4691. newValue = initCloneObject(srcValue);
  4692. }
  4693. }
  4694. else {
  4695. isCommon = false;
  4696. }
  4697. }
  4698. if (isCommon) {
  4699. // Recursively merge objects and arrays (susceptible to call stack limits).
  4700. stack.set(srcValue, newValue);
  4701. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4702. stack['delete'](srcValue);
  4703. }
  4704. assignMergeValue(object, key, newValue);
  4705. }
  4706. /**
  4707. * The base implementation of `_.nth` which doesn't coerce arguments.
  4708. *
  4709. * @private
  4710. * @param {Array} array The array to query.
  4711. * @param {number} n The index of the element to return.
  4712. * @returns {*} Returns the nth element of `array`.
  4713. */
  4714. function baseNth(array, n) {
  4715. var length = array.length;
  4716. if (!length) {
  4717. return;
  4718. }
  4719. n += n < 0 ? length : 0;
  4720. return isIndex(n, length) ? array[n] : undefined;
  4721. }
  4722. /**
  4723. * The base implementation of `_.orderBy` without param guards.
  4724. *
  4725. * @private
  4726. * @param {Array|Object} collection The collection to iterate over.
  4727. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4728. * @param {string[]} orders The sort orders of `iteratees`.
  4729. * @returns {Array} Returns the new sorted array.
  4730. */
  4731. function baseOrderBy(collection, iteratees, orders) {
  4732. if (iteratees.length) {
  4733. iteratees = arrayMap(iteratees, function(iteratee) {
  4734. if (isArray(iteratee)) {
  4735. return function(value) {
  4736. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4737. }
  4738. }
  4739. return iteratee;
  4740. });
  4741. } else {
  4742. iteratees = [identity];
  4743. }
  4744. var index = -1;
  4745. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4746. var result = baseMap(collection, function(value, key, collection) {
  4747. var criteria = arrayMap(iteratees, function(iteratee) {
  4748. return iteratee(value);
  4749. });
  4750. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4751. });
  4752. return baseSortBy(result, function(object, other) {
  4753. return compareMultiple(object, other, orders);
  4754. });
  4755. }
  4756. /**
  4757. * The base implementation of `_.pick` without support for individual
  4758. * property identifiers.
  4759. *
  4760. * @private
  4761. * @param {Object} object The source object.
  4762. * @param {string[]} paths The property paths to pick.
  4763. * @returns {Object} Returns the new object.
  4764. */
  4765. function basePick(object, paths) {
  4766. return basePickBy(object, paths, function(value, path) {
  4767. return hasIn(object, path);
  4768. });
  4769. }
  4770. /**
  4771. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4772. *
  4773. * @private
  4774. * @param {Object} object The source object.
  4775. * @param {string[]} paths The property paths to pick.
  4776. * @param {Function} predicate The function invoked per property.
  4777. * @returns {Object} Returns the new object.
  4778. */
  4779. function basePickBy(object, paths, predicate) {
  4780. var index = -1,
  4781. length = paths.length,
  4782. result = {};
  4783. while (++index < length) {
  4784. var path = paths[index],
  4785. value = baseGet(object, path);
  4786. if (predicate(value, path)) {
  4787. baseSet(result, castPath(path, object), value);
  4788. }
  4789. }
  4790. return result;
  4791. }
  4792. /**
  4793. * A specialized version of `baseProperty` which supports deep paths.
  4794. *
  4795. * @private
  4796. * @param {Array|string} path The path of the property to get.
  4797. * @returns {Function} Returns the new accessor function.
  4798. */
  4799. function basePropertyDeep(path) {
  4800. return function(object) {
  4801. return baseGet(object, path);
  4802. };
  4803. }
  4804. /**
  4805. * The base implementation of `_.pullAllBy` without support for iteratee
  4806. * shorthands.
  4807. *
  4808. * @private
  4809. * @param {Array} array The array to modify.
  4810. * @param {Array} values The values to remove.
  4811. * @param {Function} [iteratee] The iteratee invoked per element.
  4812. * @param {Function} [comparator] The comparator invoked per element.
  4813. * @returns {Array} Returns `array`.
  4814. */
  4815. function basePullAll(array, values, iteratee, comparator) {
  4816. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4817. index = -1,
  4818. length = values.length,
  4819. seen = array;
  4820. if (array === values) {
  4821. values = copyArray(values);
  4822. }
  4823. if (iteratee) {
  4824. seen = arrayMap(array, baseUnary(iteratee));
  4825. }
  4826. while (++index < length) {
  4827. var fromIndex = 0,
  4828. value = values[index],
  4829. computed = iteratee ? iteratee(value) : value;
  4830. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4831. if (seen !== array) {
  4832. splice.call(seen, fromIndex, 1);
  4833. }
  4834. splice.call(array, fromIndex, 1);
  4835. }
  4836. }
  4837. return array;
  4838. }
  4839. /**
  4840. * The base implementation of `_.pullAt` without support for individual
  4841. * indexes or capturing the removed elements.
  4842. *
  4843. * @private
  4844. * @param {Array} array The array to modify.
  4845. * @param {number[]} indexes The indexes of elements to remove.
  4846. * @returns {Array} Returns `array`.
  4847. */
  4848. function basePullAt(array, indexes) {
  4849. var length = array ? indexes.length : 0,
  4850. lastIndex = length - 1;
  4851. while (length--) {
  4852. var index = indexes[length];
  4853. if (length == lastIndex || index !== previous) {
  4854. var previous = index;
  4855. if (isIndex(index)) {
  4856. splice.call(array, index, 1);
  4857. } else {
  4858. baseUnset(array, index);
  4859. }
  4860. }
  4861. }
  4862. return array;
  4863. }
  4864. /**
  4865. * The base implementation of `_.random` without support for returning
  4866. * floating-point numbers.
  4867. *
  4868. * @private
  4869. * @param {number} lower The lower bound.
  4870. * @param {number} upper The upper bound.
  4871. * @returns {number} Returns the random number.
  4872. */
  4873. function baseRandom(lower, upper) {
  4874. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4875. }
  4876. /**
  4877. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4878. * coerce arguments.
  4879. *
  4880. * @private
  4881. * @param {number} start The start of the range.
  4882. * @param {number} end The end of the range.
  4883. * @param {number} step The value to increment or decrement by.
  4884. * @param {boolean} [fromRight] Specify iterating from right to left.
  4885. * @returns {Array} Returns the range of numbers.
  4886. */
  4887. function baseRange(start, end, step, fromRight) {
  4888. var index = -1,
  4889. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4890. result = Array(length);
  4891. while (length--) {
  4892. result[fromRight ? length : ++index] = start;
  4893. start += step;
  4894. }
  4895. return result;
  4896. }
  4897. /**
  4898. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4899. *
  4900. * @private
  4901. * @param {string} string The string to repeat.
  4902. * @param {number} n The number of times to repeat the string.
  4903. * @returns {string} Returns the repeated string.
  4904. */
  4905. function baseRepeat(string, n) {
  4906. var result = '';
  4907. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4908. return result;
  4909. }
  4910. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4911. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4912. do {
  4913. if (n % 2) {
  4914. result += string;
  4915. }
  4916. n = nativeFloor(n / 2);
  4917. if (n) {
  4918. string += string;
  4919. }
  4920. } while (n);
  4921. return result;
  4922. }
  4923. /**
  4924. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4925. *
  4926. * @private
  4927. * @param {Function} func The function to apply a rest parameter to.
  4928. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4929. * @returns {Function} Returns the new function.
  4930. */
  4931. function baseRest(func, start) {
  4932. return setToString(overRest(func, start, identity), func + '');
  4933. }
  4934. /**
  4935. * The base implementation of `_.sample`.
  4936. *
  4937. * @private
  4938. * @param {Array|Object} collection The collection to sample.
  4939. * @returns {*} Returns the random element.
  4940. */
  4941. function baseSample(collection) {
  4942. return arraySample(values(collection));
  4943. }
  4944. /**
  4945. * The base implementation of `_.sampleSize` without param guards.
  4946. *
  4947. * @private
  4948. * @param {Array|Object} collection The collection to sample.
  4949. * @param {number} n The number of elements to sample.
  4950. * @returns {Array} Returns the random elements.
  4951. */
  4952. function baseSampleSize(collection, n) {
  4953. var array = values(collection);
  4954. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4955. }
  4956. /**
  4957. * The base implementation of `_.set`.
  4958. *
  4959. * @private
  4960. * @param {Object} object The object to modify.
  4961. * @param {Array|string} path The path of the property to set.
  4962. * @param {*} value The value to set.
  4963. * @param {Function} [customizer] The function to customize path creation.
  4964. * @returns {Object} Returns `object`.
  4965. */
  4966. function baseSet(object, path, value, customizer) {
  4967. if (!isObject(object)) {
  4968. return object;
  4969. }
  4970. path = castPath(path, object);
  4971. var index = -1,
  4972. length = path.length,
  4973. lastIndex = length - 1,
  4974. nested = object;
  4975. while (nested != null && ++index < length) {
  4976. var key = toKey(path[index]),
  4977. newValue = value;
  4978. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4979. return object;
  4980. }
  4981. if (index != lastIndex) {
  4982. var objValue = nested[key];
  4983. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4984. if (newValue === undefined) {
  4985. newValue = isObject(objValue)
  4986. ? objValue
  4987. : (isIndex(path[index + 1]) ? [] : {});
  4988. }
  4989. }
  4990. assignValue(nested, key, newValue);
  4991. nested = nested[key];
  4992. }
  4993. return object;
  4994. }
  4995. /**
  4996. * The base implementation of `setData` without support for hot loop shorting.
  4997. *
  4998. * @private
  4999. * @param {Function} func The function to associate metadata with.
  5000. * @param {*} data The metadata.
  5001. * @returns {Function} Returns `func`.
  5002. */
  5003. var baseSetData = !metaMap ? identity : function(func, data) {
  5004. metaMap.set(func, data);
  5005. return func;
  5006. };
  5007. /**
  5008. * The base implementation of `setToString` without support for hot loop shorting.
  5009. *
  5010. * @private
  5011. * @param {Function} func The function to modify.
  5012. * @param {Function} string The `toString` result.
  5013. * @returns {Function} Returns `func`.
  5014. */
  5015. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5016. return defineProperty(func, 'toString', {
  5017. 'configurable': true,
  5018. 'enumerable': false,
  5019. 'value': constant(string),
  5020. 'writable': true
  5021. });
  5022. };
  5023. /**
  5024. * The base implementation of `_.shuffle`.
  5025. *
  5026. * @private
  5027. * @param {Array|Object} collection The collection to shuffle.
  5028. * @returns {Array} Returns the new shuffled array.
  5029. */
  5030. function baseShuffle(collection) {
  5031. return shuffleSelf(values(collection));
  5032. }
  5033. /**
  5034. * The base implementation of `_.slice` without an iteratee call guard.
  5035. *
  5036. * @private
  5037. * @param {Array} array The array to slice.
  5038. * @param {number} [start=0] The start position.
  5039. * @param {number} [end=array.length] The end position.
  5040. * @returns {Array} Returns the slice of `array`.
  5041. */
  5042. function baseSlice(array, start, end) {
  5043. var index = -1,
  5044. length = array.length;
  5045. if (start < 0) {
  5046. start = -start > length ? 0 : (length + start);
  5047. }
  5048. end = end > length ? length : end;
  5049. if (end < 0) {
  5050. end += length;
  5051. }
  5052. length = start > end ? 0 : ((end - start) >>> 0);
  5053. start >>>= 0;
  5054. var result = Array(length);
  5055. while (++index < length) {
  5056. result[index] = array[index + start];
  5057. }
  5058. return result;
  5059. }
  5060. /**
  5061. * The base implementation of `_.some` without support for iteratee shorthands.
  5062. *
  5063. * @private
  5064. * @param {Array|Object} collection The collection to iterate over.
  5065. * @param {Function} predicate The function invoked per iteration.
  5066. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5067. * else `false`.
  5068. */
  5069. function baseSome(collection, predicate) {
  5070. var result;
  5071. baseEach(collection, function(value, index, collection) {
  5072. result = predicate(value, index, collection);
  5073. return !result;
  5074. });
  5075. return !!result;
  5076. }
  5077. /**
  5078. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5079. * performs a binary search of `array` to determine the index at which `value`
  5080. * should be inserted into `array` in order to maintain its sort order.
  5081. *
  5082. * @private
  5083. * @param {Array} array The sorted array to inspect.
  5084. * @param {*} value The value to evaluate.
  5085. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5086. * @returns {number} Returns the index at which `value` should be inserted
  5087. * into `array`.
  5088. */
  5089. function baseSortedIndex(array, value, retHighest) {
  5090. var low = 0,
  5091. high = array == null ? low : array.length;
  5092. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5093. while (low < high) {
  5094. var mid = (low + high) >>> 1,
  5095. computed = array[mid];
  5096. if (computed !== null && !isSymbol(computed) &&
  5097. (retHighest ? (computed <= value) : (computed < value))) {
  5098. low = mid + 1;
  5099. } else {
  5100. high = mid;
  5101. }
  5102. }
  5103. return high;
  5104. }
  5105. return baseSortedIndexBy(array, value, identity, retHighest);
  5106. }
  5107. /**
  5108. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5109. * which invokes `iteratee` for `value` and each element of `array` to compute
  5110. * their sort ranking. The iteratee is invoked with one argument; (value).
  5111. *
  5112. * @private
  5113. * @param {Array} array The sorted array to inspect.
  5114. * @param {*} value The value to evaluate.
  5115. * @param {Function} iteratee The iteratee invoked per element.
  5116. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5117. * @returns {number} Returns the index at which `value` should be inserted
  5118. * into `array`.
  5119. */
  5120. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5121. var low = 0,
  5122. high = array == null ? 0 : array.length;
  5123. if (high === 0) {
  5124. return 0;
  5125. }
  5126. value = iteratee(value);
  5127. var valIsNaN = value !== value,
  5128. valIsNull = value === null,
  5129. valIsSymbol = isSymbol(value),
  5130. valIsUndefined = value === undefined;
  5131. while (low < high) {
  5132. var mid = nativeFloor((low + high) / 2),
  5133. computed = iteratee(array[mid]),
  5134. othIsDefined = computed !== undefined,
  5135. othIsNull = computed === null,
  5136. othIsReflexive = computed === computed,
  5137. othIsSymbol = isSymbol(computed);
  5138. if (valIsNaN) {
  5139. var setLow = retHighest || othIsReflexive;
  5140. } else if (valIsUndefined) {
  5141. setLow = othIsReflexive && (retHighest || othIsDefined);
  5142. } else if (valIsNull) {
  5143. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5144. } else if (valIsSymbol) {
  5145. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5146. } else if (othIsNull || othIsSymbol) {
  5147. setLow = false;
  5148. } else {
  5149. setLow = retHighest ? (computed <= value) : (computed < value);
  5150. }
  5151. if (setLow) {
  5152. low = mid + 1;
  5153. } else {
  5154. high = mid;
  5155. }
  5156. }
  5157. return nativeMin(high, MAX_ARRAY_INDEX);
  5158. }
  5159. /**
  5160. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5161. * support for iteratee shorthands.
  5162. *
  5163. * @private
  5164. * @param {Array} array The array to inspect.
  5165. * @param {Function} [iteratee] The iteratee invoked per element.
  5166. * @returns {Array} Returns the new duplicate free array.
  5167. */
  5168. function baseSortedUniq(array, iteratee) {
  5169. var index = -1,
  5170. length = array.length,
  5171. resIndex = 0,
  5172. result = [];
  5173. while (++index < length) {
  5174. var value = array[index],
  5175. computed = iteratee ? iteratee(value) : value;
  5176. if (!index || !eq(computed, seen)) {
  5177. var seen = computed;
  5178. result[resIndex++] = value === 0 ? 0 : value;
  5179. }
  5180. }
  5181. return result;
  5182. }
  5183. /**
  5184. * The base implementation of `_.toNumber` which doesn't ensure correct
  5185. * conversions of binary, hexadecimal, or octal string values.
  5186. *
  5187. * @private
  5188. * @param {*} value The value to process.
  5189. * @returns {number} Returns the number.
  5190. */
  5191. function baseToNumber(value) {
  5192. if (typeof value == 'number') {
  5193. return value;
  5194. }
  5195. if (isSymbol(value)) {
  5196. return NAN;
  5197. }
  5198. return +value;
  5199. }
  5200. /**
  5201. * The base implementation of `_.toString` which doesn't convert nullish
  5202. * values to empty strings.
  5203. *
  5204. * @private
  5205. * @param {*} value The value to process.
  5206. * @returns {string} Returns the string.
  5207. */
  5208. function baseToString(value) {
  5209. // Exit early for strings to avoid a performance hit in some environments.
  5210. if (typeof value == 'string') {
  5211. return value;
  5212. }
  5213. if (isArray(value)) {
  5214. // Recursively convert values (susceptible to call stack limits).
  5215. return arrayMap(value, baseToString) + '';
  5216. }
  5217. if (isSymbol(value)) {
  5218. return symbolToString ? symbolToString.call(value) : '';
  5219. }
  5220. var result = (value + '');
  5221. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5222. }
  5223. /**
  5224. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5225. *
  5226. * @private
  5227. * @param {Array} array The array to inspect.
  5228. * @param {Function} [iteratee] The iteratee invoked per element.
  5229. * @param {Function} [comparator] The comparator invoked per element.
  5230. * @returns {Array} Returns the new duplicate free array.
  5231. */
  5232. function baseUniq(array, iteratee, comparator) {
  5233. var index = -1,
  5234. includes = arrayIncludes,
  5235. length = array.length,
  5236. isCommon = true,
  5237. result = [],
  5238. seen = result;
  5239. if (comparator) {
  5240. isCommon = false;
  5241. includes = arrayIncludesWith;
  5242. }
  5243. else if (length >= LARGE_ARRAY_SIZE) {
  5244. var set = iteratee ? null : createSet(array);
  5245. if (set) {
  5246. return setToArray(set);
  5247. }
  5248. isCommon = false;
  5249. includes = cacheHas;
  5250. seen = new SetCache;
  5251. }
  5252. else {
  5253. seen = iteratee ? [] : result;
  5254. }
  5255. outer:
  5256. while (++index < length) {
  5257. var value = array[index],
  5258. computed = iteratee ? iteratee(value) : value;
  5259. value = (comparator || value !== 0) ? value : 0;
  5260. if (isCommon && computed === computed) {
  5261. var seenIndex = seen.length;
  5262. while (seenIndex--) {
  5263. if (seen[seenIndex] === computed) {
  5264. continue outer;
  5265. }
  5266. }
  5267. if (iteratee) {
  5268. seen.push(computed);
  5269. }
  5270. result.push(value);
  5271. }
  5272. else if (!includes(seen, computed, comparator)) {
  5273. if (seen !== result) {
  5274. seen.push(computed);
  5275. }
  5276. result.push(value);
  5277. }
  5278. }
  5279. return result;
  5280. }
  5281. /**
  5282. * The base implementation of `_.unset`.
  5283. *
  5284. * @private
  5285. * @param {Object} object The object to modify.
  5286. * @param {Array|string} path The property path to unset.
  5287. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5288. */
  5289. function baseUnset(object, path) {
  5290. path = castPath(path, object);
  5291. object = parent(object, path);
  5292. return object == null || delete object[toKey(last(path))];
  5293. }
  5294. /**
  5295. * The base implementation of `_.update`.
  5296. *
  5297. * @private
  5298. * @param {Object} object The object to modify.
  5299. * @param {Array|string} path The path of the property to update.
  5300. * @param {Function} updater The function to produce the updated value.
  5301. * @param {Function} [customizer] The function to customize path creation.
  5302. * @returns {Object} Returns `object`.
  5303. */
  5304. function baseUpdate(object, path, updater, customizer) {
  5305. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5306. }
  5307. /**
  5308. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5309. * without support for iteratee shorthands.
  5310. *
  5311. * @private
  5312. * @param {Array} array The array to query.
  5313. * @param {Function} predicate The function invoked per iteration.
  5314. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5315. * @param {boolean} [fromRight] Specify iterating from right to left.
  5316. * @returns {Array} Returns the slice of `array`.
  5317. */
  5318. function baseWhile(array, predicate, isDrop, fromRight) {
  5319. var length = array.length,
  5320. index = fromRight ? length : -1;
  5321. while ((fromRight ? index-- : ++index < length) &&
  5322. predicate(array[index], index, array)) {}
  5323. return isDrop
  5324. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5325. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5326. }
  5327. /**
  5328. * The base implementation of `wrapperValue` which returns the result of
  5329. * performing a sequence of actions on the unwrapped `value`, where each
  5330. * successive action is supplied the return value of the previous.
  5331. *
  5332. * @private
  5333. * @param {*} value The unwrapped value.
  5334. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5335. * @returns {*} Returns the resolved value.
  5336. */
  5337. function baseWrapperValue(value, actions) {
  5338. var result = value;
  5339. if (result instanceof LazyWrapper) {
  5340. result = result.value();
  5341. }
  5342. return arrayReduce(actions, function(result, action) {
  5343. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5344. }, result);
  5345. }
  5346. /**
  5347. * The base implementation of methods like `_.xor`, without support for
  5348. * iteratee shorthands, that accepts an array of arrays to inspect.
  5349. *
  5350. * @private
  5351. * @param {Array} arrays The arrays to inspect.
  5352. * @param {Function} [iteratee] The iteratee invoked per element.
  5353. * @param {Function} [comparator] The comparator invoked per element.
  5354. * @returns {Array} Returns the new array of values.
  5355. */
  5356. function baseXor(arrays, iteratee, comparator) {
  5357. var length = arrays.length;
  5358. if (length < 2) {
  5359. return length ? baseUniq(arrays[0]) : [];
  5360. }
  5361. var index = -1,
  5362. result = Array(length);
  5363. while (++index < length) {
  5364. var array = arrays[index],
  5365. othIndex = -1;
  5366. while (++othIndex < length) {
  5367. if (othIndex != index) {
  5368. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5369. }
  5370. }
  5371. }
  5372. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5373. }
  5374. /**
  5375. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5376. *
  5377. * @private
  5378. * @param {Array} props The property identifiers.
  5379. * @param {Array} values The property values.
  5380. * @param {Function} assignFunc The function to assign values.
  5381. * @returns {Object} Returns the new object.
  5382. */
  5383. function baseZipObject(props, values, assignFunc) {
  5384. var index = -1,
  5385. length = props.length,
  5386. valsLength = values.length,
  5387. result = {};
  5388. while (++index < length) {
  5389. var value = index < valsLength ? values[index] : undefined;
  5390. assignFunc(result, props[index], value);
  5391. }
  5392. return result;
  5393. }
  5394. /**
  5395. * Casts `value` to an empty array if it's not an array like object.
  5396. *
  5397. * @private
  5398. * @param {*} value The value to inspect.
  5399. * @returns {Array|Object} Returns the cast array-like object.
  5400. */
  5401. function castArrayLikeObject(value) {
  5402. return isArrayLikeObject(value) ? value : [];
  5403. }
  5404. /**
  5405. * Casts `value` to `identity` if it's not a function.
  5406. *
  5407. * @private
  5408. * @param {*} value The value to inspect.
  5409. * @returns {Function} Returns cast function.
  5410. */
  5411. function castFunction(value) {
  5412. return typeof value == 'function' ? value : identity;
  5413. }
  5414. /**
  5415. * Casts `value` to a path array if it's not one.
  5416. *
  5417. * @private
  5418. * @param {*} value The value to inspect.
  5419. * @param {Object} [object] The object to query keys on.
  5420. * @returns {Array} Returns the cast property path array.
  5421. */
  5422. function castPath(value, object) {
  5423. if (isArray(value)) {
  5424. return value;
  5425. }
  5426. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5427. }
  5428. /**
  5429. * A `baseRest` alias which can be replaced with `identity` by module
  5430. * replacement plugins.
  5431. *
  5432. * @private
  5433. * @type {Function}
  5434. * @param {Function} func The function to apply a rest parameter to.
  5435. * @returns {Function} Returns the new function.
  5436. */
  5437. var castRest = baseRest;
  5438. /**
  5439. * Casts `array` to a slice if it's needed.
  5440. *
  5441. * @private
  5442. * @param {Array} array The array to inspect.
  5443. * @param {number} start The start position.
  5444. * @param {number} [end=array.length] The end position.
  5445. * @returns {Array} Returns the cast slice.
  5446. */
  5447. function castSlice(array, start, end) {
  5448. var length = array.length;
  5449. end = end === undefined ? length : end;
  5450. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5451. }
  5452. /**
  5453. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5454. *
  5455. * @private
  5456. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5457. */
  5458. var clearTimeout = ctxClearTimeout || function(id) {
  5459. return root.clearTimeout(id);
  5460. };
  5461. /**
  5462. * Creates a clone of `buffer`.
  5463. *
  5464. * @private
  5465. * @param {Buffer} buffer The buffer to clone.
  5466. * @param {boolean} [isDeep] Specify a deep clone.
  5467. * @returns {Buffer} Returns the cloned buffer.
  5468. */
  5469. function cloneBuffer(buffer, isDeep) {
  5470. if (isDeep) {
  5471. return buffer.slice();
  5472. }
  5473. var length = buffer.length,
  5474. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5475. buffer.copy(result);
  5476. return result;
  5477. }
  5478. /**
  5479. * Creates a clone of `arrayBuffer`.
  5480. *
  5481. * @private
  5482. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5483. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5484. */
  5485. function cloneArrayBuffer(arrayBuffer) {
  5486. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5487. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5488. return result;
  5489. }
  5490. /**
  5491. * Creates a clone of `dataView`.
  5492. *
  5493. * @private
  5494. * @param {Object} dataView The data view to clone.
  5495. * @param {boolean} [isDeep] Specify a deep clone.
  5496. * @returns {Object} Returns the cloned data view.
  5497. */
  5498. function cloneDataView(dataView, isDeep) {
  5499. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5500. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5501. }
  5502. /**
  5503. * Creates a clone of `regexp`.
  5504. *
  5505. * @private
  5506. * @param {Object} regexp The regexp to clone.
  5507. * @returns {Object} Returns the cloned regexp.
  5508. */
  5509. function cloneRegExp(regexp) {
  5510. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5511. result.lastIndex = regexp.lastIndex;
  5512. return result;
  5513. }
  5514. /**
  5515. * Creates a clone of the `symbol` object.
  5516. *
  5517. * @private
  5518. * @param {Object} symbol The symbol object to clone.
  5519. * @returns {Object} Returns the cloned symbol object.
  5520. */
  5521. function cloneSymbol(symbol) {
  5522. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5523. }
  5524. /**
  5525. * Creates a clone of `typedArray`.
  5526. *
  5527. * @private
  5528. * @param {Object} typedArray The typed array to clone.
  5529. * @param {boolean} [isDeep] Specify a deep clone.
  5530. * @returns {Object} Returns the cloned typed array.
  5531. */
  5532. function cloneTypedArray(typedArray, isDeep) {
  5533. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5534. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5535. }
  5536. /**
  5537. * Compares values to sort them in ascending order.
  5538. *
  5539. * @private
  5540. * @param {*} value The value to compare.
  5541. * @param {*} other The other value to compare.
  5542. * @returns {number} Returns the sort order indicator for `value`.
  5543. */
  5544. function compareAscending(value, other) {
  5545. if (value !== other) {
  5546. var valIsDefined = value !== undefined,
  5547. valIsNull = value === null,
  5548. valIsReflexive = value === value,
  5549. valIsSymbol = isSymbol(value);
  5550. var othIsDefined = other !== undefined,
  5551. othIsNull = other === null,
  5552. othIsReflexive = other === other,
  5553. othIsSymbol = isSymbol(other);
  5554. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5555. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5556. (valIsNull && othIsDefined && othIsReflexive) ||
  5557. (!valIsDefined && othIsReflexive) ||
  5558. !valIsReflexive) {
  5559. return 1;
  5560. }
  5561. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5562. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5563. (othIsNull && valIsDefined && valIsReflexive) ||
  5564. (!othIsDefined && valIsReflexive) ||
  5565. !othIsReflexive) {
  5566. return -1;
  5567. }
  5568. }
  5569. return 0;
  5570. }
  5571. /**
  5572. * Used by `_.orderBy` to compare multiple properties of a value to another
  5573. * and stable sort them.
  5574. *
  5575. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5576. * specify an order of "desc" for descending or "asc" for ascending sort order
  5577. * of corresponding values.
  5578. *
  5579. * @private
  5580. * @param {Object} object The object to compare.
  5581. * @param {Object} other The other object to compare.
  5582. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5583. * @returns {number} Returns the sort order indicator for `object`.
  5584. */
  5585. function compareMultiple(object, other, orders) {
  5586. var index = -1,
  5587. objCriteria = object.criteria,
  5588. othCriteria = other.criteria,
  5589. length = objCriteria.length,
  5590. ordersLength = orders.length;
  5591. while (++index < length) {
  5592. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5593. if (result) {
  5594. if (index >= ordersLength) {
  5595. return result;
  5596. }
  5597. var order = orders[index];
  5598. return result * (order == 'desc' ? -1 : 1);
  5599. }
  5600. }
  5601. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5602. // that causes it, under certain circumstances, to provide the same value for
  5603. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5604. // for more details.
  5605. //
  5606. // This also ensures a stable sort in V8 and other engines.
  5607. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5608. return object.index - other.index;
  5609. }
  5610. /**
  5611. * Creates an array that is the composition of partially applied arguments,
  5612. * placeholders, and provided arguments into a single array of arguments.
  5613. *
  5614. * @private
  5615. * @param {Array} args The provided arguments.
  5616. * @param {Array} partials The arguments to prepend to those provided.
  5617. * @param {Array} holders The `partials` placeholder indexes.
  5618. * @params {boolean} [isCurried] Specify composing for a curried function.
  5619. * @returns {Array} Returns the new array of composed arguments.
  5620. */
  5621. function composeArgs(args, partials, holders, isCurried) {
  5622. var argsIndex = -1,
  5623. argsLength = args.length,
  5624. holdersLength = holders.length,
  5625. leftIndex = -1,
  5626. leftLength = partials.length,
  5627. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5628. result = Array(leftLength + rangeLength),
  5629. isUncurried = !isCurried;
  5630. while (++leftIndex < leftLength) {
  5631. result[leftIndex] = partials[leftIndex];
  5632. }
  5633. while (++argsIndex < holdersLength) {
  5634. if (isUncurried || argsIndex < argsLength) {
  5635. result[holders[argsIndex]] = args[argsIndex];
  5636. }
  5637. }
  5638. while (rangeLength--) {
  5639. result[leftIndex++] = args[argsIndex++];
  5640. }
  5641. return result;
  5642. }
  5643. /**
  5644. * This function is like `composeArgs` except that the arguments composition
  5645. * is tailored for `_.partialRight`.
  5646. *
  5647. * @private
  5648. * @param {Array} args The provided arguments.
  5649. * @param {Array} partials The arguments to append to those provided.
  5650. * @param {Array} holders The `partials` placeholder indexes.
  5651. * @params {boolean} [isCurried] Specify composing for a curried function.
  5652. * @returns {Array} Returns the new array of composed arguments.
  5653. */
  5654. function composeArgsRight(args, partials, holders, isCurried) {
  5655. var argsIndex = -1,
  5656. argsLength = args.length,
  5657. holdersIndex = -1,
  5658. holdersLength = holders.length,
  5659. rightIndex = -1,
  5660. rightLength = partials.length,
  5661. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5662. result = Array(rangeLength + rightLength),
  5663. isUncurried = !isCurried;
  5664. while (++argsIndex < rangeLength) {
  5665. result[argsIndex] = args[argsIndex];
  5666. }
  5667. var offset = argsIndex;
  5668. while (++rightIndex < rightLength) {
  5669. result[offset + rightIndex] = partials[rightIndex];
  5670. }
  5671. while (++holdersIndex < holdersLength) {
  5672. if (isUncurried || argsIndex < argsLength) {
  5673. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5674. }
  5675. }
  5676. return result;
  5677. }
  5678. /**
  5679. * Copies the values of `source` to `array`.
  5680. *
  5681. * @private
  5682. * @param {Array} source The array to copy values from.
  5683. * @param {Array} [array=[]] The array to copy values to.
  5684. * @returns {Array} Returns `array`.
  5685. */
  5686. function copyArray(source, array) {
  5687. var index = -1,
  5688. length = source.length;
  5689. array || (array = Array(length));
  5690. while (++index < length) {
  5691. array[index] = source[index];
  5692. }
  5693. return array;
  5694. }
  5695. /**
  5696. * Copies properties of `source` to `object`.
  5697. *
  5698. * @private
  5699. * @param {Object} source The object to copy properties from.
  5700. * @param {Array} props The property identifiers to copy.
  5701. * @param {Object} [object={}] The object to copy properties to.
  5702. * @param {Function} [customizer] The function to customize copied values.
  5703. * @returns {Object} Returns `object`.
  5704. */
  5705. function copyObject(source, props, object, customizer) {
  5706. var isNew = !object;
  5707. object || (object = {});
  5708. var index = -1,
  5709. length = props.length;
  5710. while (++index < length) {
  5711. var key = props[index];
  5712. var newValue = customizer
  5713. ? customizer(object[key], source[key], key, object, source)
  5714. : undefined;
  5715. if (newValue === undefined) {
  5716. newValue = source[key];
  5717. }
  5718. if (isNew) {
  5719. baseAssignValue(object, key, newValue);
  5720. } else {
  5721. assignValue(object, key, newValue);
  5722. }
  5723. }
  5724. return object;
  5725. }
  5726. /**
  5727. * Copies own symbols of `source` to `object`.
  5728. *
  5729. * @private
  5730. * @param {Object} source The object to copy symbols from.
  5731. * @param {Object} [object={}] The object to copy symbols to.
  5732. * @returns {Object} Returns `object`.
  5733. */
  5734. function copySymbols(source, object) {
  5735. return copyObject(source, getSymbols(source), object);
  5736. }
  5737. /**
  5738. * Copies own and inherited symbols of `source` to `object`.
  5739. *
  5740. * @private
  5741. * @param {Object} source The object to copy symbols from.
  5742. * @param {Object} [object={}] The object to copy symbols to.
  5743. * @returns {Object} Returns `object`.
  5744. */
  5745. function copySymbolsIn(source, object) {
  5746. return copyObject(source, getSymbolsIn(source), object);
  5747. }
  5748. /**
  5749. * Creates a function like `_.groupBy`.
  5750. *
  5751. * @private
  5752. * @param {Function} setter The function to set accumulator values.
  5753. * @param {Function} [initializer] The accumulator object initializer.
  5754. * @returns {Function} Returns the new aggregator function.
  5755. */
  5756. function createAggregator(setter, initializer) {
  5757. return function(collection, iteratee) {
  5758. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5759. accumulator = initializer ? initializer() : {};
  5760. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5761. };
  5762. }
  5763. /**
  5764. * Creates a function like `_.assign`.
  5765. *
  5766. * @private
  5767. * @param {Function} assigner The function to assign values.
  5768. * @returns {Function} Returns the new assigner function.
  5769. */
  5770. function createAssigner(assigner) {
  5771. return baseRest(function(object, sources) {
  5772. var index = -1,
  5773. length = sources.length,
  5774. customizer = length > 1 ? sources[length - 1] : undefined,
  5775. guard = length > 2 ? sources[2] : undefined;
  5776. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5777. ? (length--, customizer)
  5778. : undefined;
  5779. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5780. customizer = length < 3 ? undefined : customizer;
  5781. length = 1;
  5782. }
  5783. object = Object(object);
  5784. while (++index < length) {
  5785. var source = sources[index];
  5786. if (source) {
  5787. assigner(object, source, index, customizer);
  5788. }
  5789. }
  5790. return object;
  5791. });
  5792. }
  5793. /**
  5794. * Creates a `baseEach` or `baseEachRight` function.
  5795. *
  5796. * @private
  5797. * @param {Function} eachFunc The function to iterate over a collection.
  5798. * @param {boolean} [fromRight] Specify iterating from right to left.
  5799. * @returns {Function} Returns the new base function.
  5800. */
  5801. function createBaseEach(eachFunc, fromRight) {
  5802. return function(collection, iteratee) {
  5803. if (collection == null) {
  5804. return collection;
  5805. }
  5806. if (!isArrayLike(collection)) {
  5807. return eachFunc(collection, iteratee);
  5808. }
  5809. var length = collection.length,
  5810. index = fromRight ? length : -1,
  5811. iterable = Object(collection);
  5812. while ((fromRight ? index-- : ++index < length)) {
  5813. if (iteratee(iterable[index], index, iterable) === false) {
  5814. break;
  5815. }
  5816. }
  5817. return collection;
  5818. };
  5819. }
  5820. /**
  5821. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5822. *
  5823. * @private
  5824. * @param {boolean} [fromRight] Specify iterating from right to left.
  5825. * @returns {Function} Returns the new base function.
  5826. */
  5827. function createBaseFor(fromRight) {
  5828. return function(object, iteratee, keysFunc) {
  5829. var index = -1,
  5830. iterable = Object(object),
  5831. props = keysFunc(object),
  5832. length = props.length;
  5833. while (length--) {
  5834. var key = props[fromRight ? length : ++index];
  5835. if (iteratee(iterable[key], key, iterable) === false) {
  5836. break;
  5837. }
  5838. }
  5839. return object;
  5840. };
  5841. }
  5842. /**
  5843. * Creates a function that wraps `func` to invoke it with the optional `this`
  5844. * binding of `thisArg`.
  5845. *
  5846. * @private
  5847. * @param {Function} func The function to wrap.
  5848. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5849. * @param {*} [thisArg] The `this` binding of `func`.
  5850. * @returns {Function} Returns the new wrapped function.
  5851. */
  5852. function createBind(func, bitmask, thisArg) {
  5853. var isBind = bitmask & WRAP_BIND_FLAG,
  5854. Ctor = createCtor(func);
  5855. function wrapper() {
  5856. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5857. return fn.apply(isBind ? thisArg : this, arguments);
  5858. }
  5859. return wrapper;
  5860. }
  5861. /**
  5862. * Creates a function like `_.lowerFirst`.
  5863. *
  5864. * @private
  5865. * @param {string} methodName The name of the `String` case method to use.
  5866. * @returns {Function} Returns the new case function.
  5867. */
  5868. function createCaseFirst(methodName) {
  5869. return function(string) {
  5870. string = toString(string);
  5871. var strSymbols = hasUnicode(string)
  5872. ? stringToArray(string)
  5873. : undefined;
  5874. var chr = strSymbols
  5875. ? strSymbols[0]
  5876. : string.charAt(0);
  5877. var trailing = strSymbols
  5878. ? castSlice(strSymbols, 1).join('')
  5879. : string.slice(1);
  5880. return chr[methodName]() + trailing;
  5881. };
  5882. }
  5883. /**
  5884. * Creates a function like `_.camelCase`.
  5885. *
  5886. * @private
  5887. * @param {Function} callback The function to combine each word.
  5888. * @returns {Function} Returns the new compounder function.
  5889. */
  5890. function createCompounder(callback) {
  5891. return function(string) {
  5892. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5893. };
  5894. }
  5895. /**
  5896. * Creates a function that produces an instance of `Ctor` regardless of
  5897. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5898. *
  5899. * @private
  5900. * @param {Function} Ctor The constructor to wrap.
  5901. * @returns {Function} Returns the new wrapped function.
  5902. */
  5903. function createCtor(Ctor) {
  5904. return function() {
  5905. // Use a `switch` statement to work with class constructors. See
  5906. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5907. // for more details.
  5908. var args = arguments;
  5909. switch (args.length) {
  5910. case 0: return new Ctor;
  5911. case 1: return new Ctor(args[0]);
  5912. case 2: return new Ctor(args[0], args[1]);
  5913. case 3: return new Ctor(args[0], args[1], args[2]);
  5914. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5915. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5916. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5917. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5918. }
  5919. var thisBinding = baseCreate(Ctor.prototype),
  5920. result = Ctor.apply(thisBinding, args);
  5921. // Mimic the constructor's `return` behavior.
  5922. // See https://es5.github.io/#x13.2.2 for more details.
  5923. return isObject(result) ? result : thisBinding;
  5924. };
  5925. }
  5926. /**
  5927. * Creates a function that wraps `func` to enable currying.
  5928. *
  5929. * @private
  5930. * @param {Function} func The function to wrap.
  5931. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5932. * @param {number} arity The arity of `func`.
  5933. * @returns {Function} Returns the new wrapped function.
  5934. */
  5935. function createCurry(func, bitmask, arity) {
  5936. var Ctor = createCtor(func);
  5937. function wrapper() {
  5938. var length = arguments.length,
  5939. args = Array(length),
  5940. index = length,
  5941. placeholder = getHolder(wrapper);
  5942. while (index--) {
  5943. args[index] = arguments[index];
  5944. }
  5945. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5946. ? []
  5947. : replaceHolders(args, placeholder);
  5948. length -= holders.length;
  5949. if (length < arity) {
  5950. return createRecurry(
  5951. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5952. args, holders, undefined, undefined, arity - length);
  5953. }
  5954. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5955. return apply(fn, this, args);
  5956. }
  5957. return wrapper;
  5958. }
  5959. /**
  5960. * Creates a `_.find` or `_.findLast` function.
  5961. *
  5962. * @private
  5963. * @param {Function} findIndexFunc The function to find the collection index.
  5964. * @returns {Function} Returns the new find function.
  5965. */
  5966. function createFind(findIndexFunc) {
  5967. return function(collection, predicate, fromIndex) {
  5968. var iterable = Object(collection);
  5969. if (!isArrayLike(collection)) {
  5970. var iteratee = getIteratee(predicate, 3);
  5971. collection = keys(collection);
  5972. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5973. }
  5974. var index = findIndexFunc(collection, predicate, fromIndex);
  5975. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5976. };
  5977. }
  5978. /**
  5979. * Creates a `_.flow` or `_.flowRight` function.
  5980. *
  5981. * @private
  5982. * @param {boolean} [fromRight] Specify iterating from right to left.
  5983. * @returns {Function} Returns the new flow function.
  5984. */
  5985. function createFlow(fromRight) {
  5986. return flatRest(function(funcs) {
  5987. var length = funcs.length,
  5988. index = length,
  5989. prereq = LodashWrapper.prototype.thru;
  5990. if (fromRight) {
  5991. funcs.reverse();
  5992. }
  5993. while (index--) {
  5994. var func = funcs[index];
  5995. if (typeof func != 'function') {
  5996. throw new TypeError(FUNC_ERROR_TEXT);
  5997. }
  5998. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5999. var wrapper = new LodashWrapper([], true);
  6000. }
  6001. }
  6002. index = wrapper ? index : length;
  6003. while (++index < length) {
  6004. func = funcs[index];
  6005. var funcName = getFuncName(func),
  6006. data = funcName == 'wrapper' ? getData(func) : undefined;
  6007. if (data && isLaziable(data[0]) &&
  6008. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6009. !data[4].length && data[9] == 1
  6010. ) {
  6011. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6012. } else {
  6013. wrapper = (func.length == 1 && isLaziable(func))
  6014. ? wrapper[funcName]()
  6015. : wrapper.thru(func);
  6016. }
  6017. }
  6018. return function() {
  6019. var args = arguments,
  6020. value = args[0];
  6021. if (wrapper && args.length == 1 && isArray(value)) {
  6022. return wrapper.plant(value).value();
  6023. }
  6024. var index = 0,
  6025. result = length ? funcs[index].apply(this, args) : value;
  6026. while (++index < length) {
  6027. result = funcs[index].call(this, result);
  6028. }
  6029. return result;
  6030. };
  6031. });
  6032. }
  6033. /**
  6034. * Creates a function that wraps `func` to invoke it with optional `this`
  6035. * binding of `thisArg`, partial application, and currying.
  6036. *
  6037. * @private
  6038. * @param {Function|string} func The function or method name to wrap.
  6039. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6040. * @param {*} [thisArg] The `this` binding of `func`.
  6041. * @param {Array} [partials] The arguments to prepend to those provided to
  6042. * the new function.
  6043. * @param {Array} [holders] The `partials` placeholder indexes.
  6044. * @param {Array} [partialsRight] The arguments to append to those provided
  6045. * to the new function.
  6046. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6047. * @param {Array} [argPos] The argument positions of the new function.
  6048. * @param {number} [ary] The arity cap of `func`.
  6049. * @param {number} [arity] The arity of `func`.
  6050. * @returns {Function} Returns the new wrapped function.
  6051. */
  6052. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6053. var isAry = bitmask & WRAP_ARY_FLAG,
  6054. isBind = bitmask & WRAP_BIND_FLAG,
  6055. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6056. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6057. isFlip = bitmask & WRAP_FLIP_FLAG,
  6058. Ctor = isBindKey ? undefined : createCtor(func);
  6059. function wrapper() {
  6060. var length = arguments.length,
  6061. args = Array(length),
  6062. index = length;
  6063. while (index--) {
  6064. args[index] = arguments[index];
  6065. }
  6066. if (isCurried) {
  6067. var placeholder = getHolder(wrapper),
  6068. holdersCount = countHolders(args, placeholder);
  6069. }
  6070. if (partials) {
  6071. args = composeArgs(args, partials, holders, isCurried);
  6072. }
  6073. if (partialsRight) {
  6074. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6075. }
  6076. length -= holdersCount;
  6077. if (isCurried && length < arity) {
  6078. var newHolders = replaceHolders(args, placeholder);
  6079. return createRecurry(
  6080. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6081. args, newHolders, argPos, ary, arity - length
  6082. );
  6083. }
  6084. var thisBinding = isBind ? thisArg : this,
  6085. fn = isBindKey ? thisBinding[func] : func;
  6086. length = args.length;
  6087. if (argPos) {
  6088. args = reorder(args, argPos);
  6089. } else if (isFlip && length > 1) {
  6090. args.reverse();
  6091. }
  6092. if (isAry && ary < length) {
  6093. args.length = ary;
  6094. }
  6095. if (this && this !== root && this instanceof wrapper) {
  6096. fn = Ctor || createCtor(fn);
  6097. }
  6098. return fn.apply(thisBinding, args);
  6099. }
  6100. return wrapper;
  6101. }
  6102. /**
  6103. * Creates a function like `_.invertBy`.
  6104. *
  6105. * @private
  6106. * @param {Function} setter The function to set accumulator values.
  6107. * @param {Function} toIteratee The function to resolve iteratees.
  6108. * @returns {Function} Returns the new inverter function.
  6109. */
  6110. function createInverter(setter, toIteratee) {
  6111. return function(object, iteratee) {
  6112. return baseInverter(object, setter, toIteratee(iteratee), {});
  6113. };
  6114. }
  6115. /**
  6116. * Creates a function that performs a mathematical operation on two values.
  6117. *
  6118. * @private
  6119. * @param {Function} operator The function to perform the operation.
  6120. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6121. * @returns {Function} Returns the new mathematical operation function.
  6122. */
  6123. function createMathOperation(operator, defaultValue) {
  6124. return function(value, other) {
  6125. var result;
  6126. if (value === undefined && other === undefined) {
  6127. return defaultValue;
  6128. }
  6129. if (value !== undefined) {
  6130. result = value;
  6131. }
  6132. if (other !== undefined) {
  6133. if (result === undefined) {
  6134. return other;
  6135. }
  6136. if (typeof value == 'string' || typeof other == 'string') {
  6137. value = baseToString(value);
  6138. other = baseToString(other);
  6139. } else {
  6140. value = baseToNumber(value);
  6141. other = baseToNumber(other);
  6142. }
  6143. result = operator(value, other);
  6144. }
  6145. return result;
  6146. };
  6147. }
  6148. /**
  6149. * Creates a function like `_.over`.
  6150. *
  6151. * @private
  6152. * @param {Function} arrayFunc The function to iterate over iteratees.
  6153. * @returns {Function} Returns the new over function.
  6154. */
  6155. function createOver(arrayFunc) {
  6156. return flatRest(function(iteratees) {
  6157. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6158. return baseRest(function(args) {
  6159. var thisArg = this;
  6160. return arrayFunc(iteratees, function(iteratee) {
  6161. return apply(iteratee, thisArg, args);
  6162. });
  6163. });
  6164. });
  6165. }
  6166. /**
  6167. * Creates the padding for `string` based on `length`. The `chars` string
  6168. * is truncated if the number of characters exceeds `length`.
  6169. *
  6170. * @private
  6171. * @param {number} length The padding length.
  6172. * @param {string} [chars=' '] The string used as padding.
  6173. * @returns {string} Returns the padding for `string`.
  6174. */
  6175. function createPadding(length, chars) {
  6176. chars = chars === undefined ? ' ' : baseToString(chars);
  6177. var charsLength = chars.length;
  6178. if (charsLength < 2) {
  6179. return charsLength ? baseRepeat(chars, length) : chars;
  6180. }
  6181. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6182. return hasUnicode(chars)
  6183. ? castSlice(stringToArray(result), 0, length).join('')
  6184. : result.slice(0, length);
  6185. }
  6186. /**
  6187. * Creates a function that wraps `func` to invoke it with the `this` binding
  6188. * of `thisArg` and `partials` prepended to the arguments it receives.
  6189. *
  6190. * @private
  6191. * @param {Function} func The function to wrap.
  6192. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6193. * @param {*} thisArg The `this` binding of `func`.
  6194. * @param {Array} partials The arguments to prepend to those provided to
  6195. * the new function.
  6196. * @returns {Function} Returns the new wrapped function.
  6197. */
  6198. function createPartial(func, bitmask, thisArg, partials) {
  6199. var isBind = bitmask & WRAP_BIND_FLAG,
  6200. Ctor = createCtor(func);
  6201. function wrapper() {
  6202. var argsIndex = -1,
  6203. argsLength = arguments.length,
  6204. leftIndex = -1,
  6205. leftLength = partials.length,
  6206. args = Array(leftLength + argsLength),
  6207. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6208. while (++leftIndex < leftLength) {
  6209. args[leftIndex] = partials[leftIndex];
  6210. }
  6211. while (argsLength--) {
  6212. args[leftIndex++] = arguments[++argsIndex];
  6213. }
  6214. return apply(fn, isBind ? thisArg : this, args);
  6215. }
  6216. return wrapper;
  6217. }
  6218. /**
  6219. * Creates a `_.range` or `_.rangeRight` function.
  6220. *
  6221. * @private
  6222. * @param {boolean} [fromRight] Specify iterating from right to left.
  6223. * @returns {Function} Returns the new range function.
  6224. */
  6225. function createRange(fromRight) {
  6226. return function(start, end, step) {
  6227. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6228. end = step = undefined;
  6229. }
  6230. // Ensure the sign of `-0` is preserved.
  6231. start = toFinite(start);
  6232. if (end === undefined) {
  6233. end = start;
  6234. start = 0;
  6235. } else {
  6236. end = toFinite(end);
  6237. }
  6238. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6239. return baseRange(start, end, step, fromRight);
  6240. };
  6241. }
  6242. /**
  6243. * Creates a function that performs a relational operation on two values.
  6244. *
  6245. * @private
  6246. * @param {Function} operator The function to perform the operation.
  6247. * @returns {Function} Returns the new relational operation function.
  6248. */
  6249. function createRelationalOperation(operator) {
  6250. return function(value, other) {
  6251. if (!(typeof value == 'string' && typeof other == 'string')) {
  6252. value = toNumber(value);
  6253. other = toNumber(other);
  6254. }
  6255. return operator(value, other);
  6256. };
  6257. }
  6258. /**
  6259. * Creates a function that wraps `func` to continue currying.
  6260. *
  6261. * @private
  6262. * @param {Function} func The function to wrap.
  6263. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6264. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6265. * @param {*} placeholder The placeholder value.
  6266. * @param {*} [thisArg] The `this` binding of `func`.
  6267. * @param {Array} [partials] The arguments to prepend to those provided to
  6268. * the new function.
  6269. * @param {Array} [holders] The `partials` placeholder indexes.
  6270. * @param {Array} [argPos] The argument positions of the new function.
  6271. * @param {number} [ary] The arity cap of `func`.
  6272. * @param {number} [arity] The arity of `func`.
  6273. * @returns {Function} Returns the new wrapped function.
  6274. */
  6275. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6276. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6277. newHolders = isCurry ? holders : undefined,
  6278. newHoldersRight = isCurry ? undefined : holders,
  6279. newPartials = isCurry ? partials : undefined,
  6280. newPartialsRight = isCurry ? undefined : partials;
  6281. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6282. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6283. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6284. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6285. }
  6286. var newData = [
  6287. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6288. newHoldersRight, argPos, ary, arity
  6289. ];
  6290. var result = wrapFunc.apply(undefined, newData);
  6291. if (isLaziable(func)) {
  6292. setData(result, newData);
  6293. }
  6294. result.placeholder = placeholder;
  6295. return setWrapToString(result, func, bitmask);
  6296. }
  6297. /**
  6298. * Creates a function like `_.round`.
  6299. *
  6300. * @private
  6301. * @param {string} methodName The name of the `Math` method to use when rounding.
  6302. * @returns {Function} Returns the new round function.
  6303. */
  6304. function createRound(methodName) {
  6305. var func = Math[methodName];
  6306. return function(number, precision) {
  6307. number = toNumber(number);
  6308. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6309. if (precision && nativeIsFinite(number)) {
  6310. // Shift with exponential notation to avoid floating-point issues.
  6311. // See [MDN](https://mdn.io/round#Examples) for more details.
  6312. var pair = (toString(number) + 'e').split('e'),
  6313. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6314. pair = (toString(value) + 'e').split('e');
  6315. return +(pair[0] + 'e' + (+pair[1] - precision));
  6316. }
  6317. return func(number);
  6318. };
  6319. }
  6320. /**
  6321. * Creates a set object of `values`.
  6322. *
  6323. * @private
  6324. * @param {Array} values The values to add to the set.
  6325. * @returns {Object} Returns the new set.
  6326. */
  6327. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6328. return new Set(values);
  6329. };
  6330. /**
  6331. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6332. *
  6333. * @private
  6334. * @param {Function} keysFunc The function to get the keys of a given object.
  6335. * @returns {Function} Returns the new pairs function.
  6336. */
  6337. function createToPairs(keysFunc) {
  6338. return function(object) {
  6339. var tag = getTag(object);
  6340. if (tag == mapTag) {
  6341. return mapToArray(object);
  6342. }
  6343. if (tag == setTag) {
  6344. return setToPairs(object);
  6345. }
  6346. return baseToPairs(object, keysFunc(object));
  6347. };
  6348. }
  6349. /**
  6350. * Creates a function that either curries or invokes `func` with optional
  6351. * `this` binding and partially applied arguments.
  6352. *
  6353. * @private
  6354. * @param {Function|string} func The function or method name to wrap.
  6355. * @param {number} bitmask The bitmask flags.
  6356. * 1 - `_.bind`
  6357. * 2 - `_.bindKey`
  6358. * 4 - `_.curry` or `_.curryRight` of a bound function
  6359. * 8 - `_.curry`
  6360. * 16 - `_.curryRight`
  6361. * 32 - `_.partial`
  6362. * 64 - `_.partialRight`
  6363. * 128 - `_.rearg`
  6364. * 256 - `_.ary`
  6365. * 512 - `_.flip`
  6366. * @param {*} [thisArg] The `this` binding of `func`.
  6367. * @param {Array} [partials] The arguments to be partially applied.
  6368. * @param {Array} [holders] The `partials` placeholder indexes.
  6369. * @param {Array} [argPos] The argument positions of the new function.
  6370. * @param {number} [ary] The arity cap of `func`.
  6371. * @param {number} [arity] The arity of `func`.
  6372. * @returns {Function} Returns the new wrapped function.
  6373. */
  6374. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6375. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6376. if (!isBindKey && typeof func != 'function') {
  6377. throw new TypeError(FUNC_ERROR_TEXT);
  6378. }
  6379. var length = partials ? partials.length : 0;
  6380. if (!length) {
  6381. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6382. partials = holders = undefined;
  6383. }
  6384. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6385. arity = arity === undefined ? arity : toInteger(arity);
  6386. length -= holders ? holders.length : 0;
  6387. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6388. var partialsRight = partials,
  6389. holdersRight = holders;
  6390. partials = holders = undefined;
  6391. }
  6392. var data = isBindKey ? undefined : getData(func);
  6393. var newData = [
  6394. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6395. argPos, ary, arity
  6396. ];
  6397. if (data) {
  6398. mergeData(newData, data);
  6399. }
  6400. func = newData[0];
  6401. bitmask = newData[1];
  6402. thisArg = newData[2];
  6403. partials = newData[3];
  6404. holders = newData[4];
  6405. arity = newData[9] = newData[9] === undefined
  6406. ? (isBindKey ? 0 : func.length)
  6407. : nativeMax(newData[9] - length, 0);
  6408. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6409. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6410. }
  6411. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6412. var result = createBind(func, bitmask, thisArg);
  6413. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6414. result = createCurry(func, bitmask, arity);
  6415. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6416. result = createPartial(func, bitmask, thisArg, partials);
  6417. } else {
  6418. result = createHybrid.apply(undefined, newData);
  6419. }
  6420. var setter = data ? baseSetData : setData;
  6421. return setWrapToString(setter(result, newData), func, bitmask);
  6422. }
  6423. /**
  6424. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6425. * of source objects to the destination object for all destination properties
  6426. * that resolve to `undefined`.
  6427. *
  6428. * @private
  6429. * @param {*} objValue The destination value.
  6430. * @param {*} srcValue The source value.
  6431. * @param {string} key The key of the property to assign.
  6432. * @param {Object} object The parent object of `objValue`.
  6433. * @returns {*} Returns the value to assign.
  6434. */
  6435. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6436. if (objValue === undefined ||
  6437. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6438. return srcValue;
  6439. }
  6440. return objValue;
  6441. }
  6442. /**
  6443. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6444. * objects into destination objects that are passed thru.
  6445. *
  6446. * @private
  6447. * @param {*} objValue The destination value.
  6448. * @param {*} srcValue The source value.
  6449. * @param {string} key The key of the property to merge.
  6450. * @param {Object} object The parent object of `objValue`.
  6451. * @param {Object} source The parent object of `srcValue`.
  6452. * @param {Object} [stack] Tracks traversed source values and their merged
  6453. * counterparts.
  6454. * @returns {*} Returns the value to assign.
  6455. */
  6456. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6457. if (isObject(objValue) && isObject(srcValue)) {
  6458. // Recursively merge objects and arrays (susceptible to call stack limits).
  6459. stack.set(srcValue, objValue);
  6460. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6461. stack['delete'](srcValue);
  6462. }
  6463. return objValue;
  6464. }
  6465. /**
  6466. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6467. * objects.
  6468. *
  6469. * @private
  6470. * @param {*} value The value to inspect.
  6471. * @param {string} key The key of the property to inspect.
  6472. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6473. */
  6474. function customOmitClone(value) {
  6475. return isPlainObject(value) ? undefined : value;
  6476. }
  6477. /**
  6478. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6479. * partial deep comparisons.
  6480. *
  6481. * @private
  6482. * @param {Array} array The array to compare.
  6483. * @param {Array} other The other array to compare.
  6484. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6485. * @param {Function} customizer The function to customize comparisons.
  6486. * @param {Function} equalFunc The function to determine equivalents of values.
  6487. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6488. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6489. */
  6490. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6491. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6492. arrLength = array.length,
  6493. othLength = other.length;
  6494. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6495. return false;
  6496. }
  6497. // Check that cyclic values are equal.
  6498. var arrStacked = stack.get(array);
  6499. var othStacked = stack.get(other);
  6500. if (arrStacked && othStacked) {
  6501. return arrStacked == other && othStacked == array;
  6502. }
  6503. var index = -1,
  6504. result = true,
  6505. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6506. stack.set(array, other);
  6507. stack.set(other, array);
  6508. // Ignore non-index properties.
  6509. while (++index < arrLength) {
  6510. var arrValue = array[index],
  6511. othValue = other[index];
  6512. if (customizer) {
  6513. var compared = isPartial
  6514. ? customizer(othValue, arrValue, index, other, array, stack)
  6515. : customizer(arrValue, othValue, index, array, other, stack);
  6516. }
  6517. if (compared !== undefined) {
  6518. if (compared) {
  6519. continue;
  6520. }
  6521. result = false;
  6522. break;
  6523. }
  6524. // Recursively compare arrays (susceptible to call stack limits).
  6525. if (seen) {
  6526. if (!arraySome(other, function(othValue, othIndex) {
  6527. if (!cacheHas(seen, othIndex) &&
  6528. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6529. return seen.push(othIndex);
  6530. }
  6531. })) {
  6532. result = false;
  6533. break;
  6534. }
  6535. } else if (!(
  6536. arrValue === othValue ||
  6537. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6538. )) {
  6539. result = false;
  6540. break;
  6541. }
  6542. }
  6543. stack['delete'](array);
  6544. stack['delete'](other);
  6545. return result;
  6546. }
  6547. /**
  6548. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6549. * the same `toStringTag`.
  6550. *
  6551. * **Note:** This function only supports comparing values with tags of
  6552. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6553. *
  6554. * @private
  6555. * @param {Object} object The object to compare.
  6556. * @param {Object} other The other object to compare.
  6557. * @param {string} tag The `toStringTag` of the objects to compare.
  6558. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6559. * @param {Function} customizer The function to customize comparisons.
  6560. * @param {Function} equalFunc The function to determine equivalents of values.
  6561. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6562. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6563. */
  6564. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6565. switch (tag) {
  6566. case dataViewTag:
  6567. if ((object.byteLength != other.byteLength) ||
  6568. (object.byteOffset != other.byteOffset)) {
  6569. return false;
  6570. }
  6571. object = object.buffer;
  6572. other = other.buffer;
  6573. case arrayBufferTag:
  6574. if ((object.byteLength != other.byteLength) ||
  6575. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6576. return false;
  6577. }
  6578. return true;
  6579. case boolTag:
  6580. case dateTag:
  6581. case numberTag:
  6582. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6583. // Invalid dates are coerced to `NaN`.
  6584. return eq(+object, +other);
  6585. case errorTag:
  6586. return object.name == other.name && object.message == other.message;
  6587. case regexpTag:
  6588. case stringTag:
  6589. // Coerce regexes to strings and treat strings, primitives and objects,
  6590. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6591. // for more details.
  6592. return object == (other + '');
  6593. case mapTag:
  6594. var convert = mapToArray;
  6595. case setTag:
  6596. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6597. convert || (convert = setToArray);
  6598. if (object.size != other.size && !isPartial) {
  6599. return false;
  6600. }
  6601. // Assume cyclic values are equal.
  6602. var stacked = stack.get(object);
  6603. if (stacked) {
  6604. return stacked == other;
  6605. }
  6606. bitmask |= COMPARE_UNORDERED_FLAG;
  6607. // Recursively compare objects (susceptible to call stack limits).
  6608. stack.set(object, other);
  6609. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6610. stack['delete'](object);
  6611. return result;
  6612. case symbolTag:
  6613. if (symbolValueOf) {
  6614. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6615. }
  6616. }
  6617. return false;
  6618. }
  6619. /**
  6620. * A specialized version of `baseIsEqualDeep` for objects with support for
  6621. * partial deep comparisons.
  6622. *
  6623. * @private
  6624. * @param {Object} object The object to compare.
  6625. * @param {Object} other The other object to compare.
  6626. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6627. * @param {Function} customizer The function to customize comparisons.
  6628. * @param {Function} equalFunc The function to determine equivalents of values.
  6629. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6630. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6631. */
  6632. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6633. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6634. objProps = getAllKeys(object),
  6635. objLength = objProps.length,
  6636. othProps = getAllKeys(other),
  6637. othLength = othProps.length;
  6638. if (objLength != othLength && !isPartial) {
  6639. return false;
  6640. }
  6641. var index = objLength;
  6642. while (index--) {
  6643. var key = objProps[index];
  6644. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6645. return false;
  6646. }
  6647. }
  6648. // Check that cyclic values are equal.
  6649. var objStacked = stack.get(object);
  6650. var othStacked = stack.get(other);
  6651. if (objStacked && othStacked) {
  6652. return objStacked == other && othStacked == object;
  6653. }
  6654. var result = true;
  6655. stack.set(object, other);
  6656. stack.set(other, object);
  6657. var skipCtor = isPartial;
  6658. while (++index < objLength) {
  6659. key = objProps[index];
  6660. var objValue = object[key],
  6661. othValue = other[key];
  6662. if (customizer) {
  6663. var compared = isPartial
  6664. ? customizer(othValue, objValue, key, other, object, stack)
  6665. : customizer(objValue, othValue, key, object, other, stack);
  6666. }
  6667. // Recursively compare objects (susceptible to call stack limits).
  6668. if (!(compared === undefined
  6669. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6670. : compared
  6671. )) {
  6672. result = false;
  6673. break;
  6674. }
  6675. skipCtor || (skipCtor = key == 'constructor');
  6676. }
  6677. if (result && !skipCtor) {
  6678. var objCtor = object.constructor,
  6679. othCtor = other.constructor;
  6680. // Non `Object` object instances with different constructors are not equal.
  6681. if (objCtor != othCtor &&
  6682. ('constructor' in object && 'constructor' in other) &&
  6683. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6684. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6685. result = false;
  6686. }
  6687. }
  6688. stack['delete'](object);
  6689. stack['delete'](other);
  6690. return result;
  6691. }
  6692. /**
  6693. * A specialized version of `baseRest` which flattens the rest array.
  6694. *
  6695. * @private
  6696. * @param {Function} func The function to apply a rest parameter to.
  6697. * @returns {Function} Returns the new function.
  6698. */
  6699. function flatRest(func) {
  6700. return setToString(overRest(func, undefined, flatten), func + '');
  6701. }
  6702. /**
  6703. * Creates an array of own enumerable property names and symbols of `object`.
  6704. *
  6705. * @private
  6706. * @param {Object} object The object to query.
  6707. * @returns {Array} Returns the array of property names and symbols.
  6708. */
  6709. function getAllKeys(object) {
  6710. return baseGetAllKeys(object, keys, getSymbols);
  6711. }
  6712. /**
  6713. * Creates an array of own and inherited enumerable property names and
  6714. * symbols of `object`.
  6715. *
  6716. * @private
  6717. * @param {Object} object The object to query.
  6718. * @returns {Array} Returns the array of property names and symbols.
  6719. */
  6720. function getAllKeysIn(object) {
  6721. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6722. }
  6723. /**
  6724. * Gets metadata for `func`.
  6725. *
  6726. * @private
  6727. * @param {Function} func The function to query.
  6728. * @returns {*} Returns the metadata for `func`.
  6729. */
  6730. var getData = !metaMap ? noop : function(func) {
  6731. return metaMap.get(func);
  6732. };
  6733. /**
  6734. * Gets the name of `func`.
  6735. *
  6736. * @private
  6737. * @param {Function} func The function to query.
  6738. * @returns {string} Returns the function name.
  6739. */
  6740. function getFuncName(func) {
  6741. var result = (func.name + ''),
  6742. array = realNames[result],
  6743. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6744. while (length--) {
  6745. var data = array[length],
  6746. otherFunc = data.func;
  6747. if (otherFunc == null || otherFunc == func) {
  6748. return data.name;
  6749. }
  6750. }
  6751. return result;
  6752. }
  6753. /**
  6754. * Gets the argument placeholder value for `func`.
  6755. *
  6756. * @private
  6757. * @param {Function} func The function to inspect.
  6758. * @returns {*} Returns the placeholder value.
  6759. */
  6760. function getHolder(func) {
  6761. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6762. return object.placeholder;
  6763. }
  6764. /**
  6765. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6766. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6767. * If arguments are provided, the chosen function is invoked with them and
  6768. * its result is returned.
  6769. *
  6770. * @private
  6771. * @param {*} [value] The value to convert to an iteratee.
  6772. * @param {number} [arity] The arity of the created iteratee.
  6773. * @returns {Function} Returns the chosen function or its result.
  6774. */
  6775. function getIteratee() {
  6776. var result = lodash.iteratee || iteratee;
  6777. result = result === iteratee ? baseIteratee : result;
  6778. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6779. }
  6780. /**
  6781. * Gets the data for `map`.
  6782. *
  6783. * @private
  6784. * @param {Object} map The map to query.
  6785. * @param {string} key The reference key.
  6786. * @returns {*} Returns the map data.
  6787. */
  6788. function getMapData(map, key) {
  6789. var data = map.__data__;
  6790. return isKeyable(key)
  6791. ? data[typeof key == 'string' ? 'string' : 'hash']
  6792. : data.map;
  6793. }
  6794. /**
  6795. * Gets the property names, values, and compare flags of `object`.
  6796. *
  6797. * @private
  6798. * @param {Object} object The object to query.
  6799. * @returns {Array} Returns the match data of `object`.
  6800. */
  6801. function getMatchData(object) {
  6802. var result = keys(object),
  6803. length = result.length;
  6804. while (length--) {
  6805. var key = result[length],
  6806. value = object[key];
  6807. result[length] = [key, value, isStrictComparable(value)];
  6808. }
  6809. return result;
  6810. }
  6811. /**
  6812. * Gets the native function at `key` of `object`.
  6813. *
  6814. * @private
  6815. * @param {Object} object The object to query.
  6816. * @param {string} key The key of the method to get.
  6817. * @returns {*} Returns the function if it's native, else `undefined`.
  6818. */
  6819. function getNative(object, key) {
  6820. var value = getValue(object, key);
  6821. return baseIsNative(value) ? value : undefined;
  6822. }
  6823. /**
  6824. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6825. *
  6826. * @private
  6827. * @param {*} value The value to query.
  6828. * @returns {string} Returns the raw `toStringTag`.
  6829. */
  6830. function getRawTag(value) {
  6831. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6832. tag = value[symToStringTag];
  6833. try {
  6834. value[symToStringTag] = undefined;
  6835. var unmasked = true;
  6836. } catch (e) {}
  6837. var result = nativeObjectToString.call(value);
  6838. if (unmasked) {
  6839. if (isOwn) {
  6840. value[symToStringTag] = tag;
  6841. } else {
  6842. delete value[symToStringTag];
  6843. }
  6844. }
  6845. return result;
  6846. }
  6847. /**
  6848. * Creates an array of the own enumerable symbols of `object`.
  6849. *
  6850. * @private
  6851. * @param {Object} object The object to query.
  6852. * @returns {Array} Returns the array of symbols.
  6853. */
  6854. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6855. if (object == null) {
  6856. return [];
  6857. }
  6858. object = Object(object);
  6859. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6860. return propertyIsEnumerable.call(object, symbol);
  6861. });
  6862. };
  6863. /**
  6864. * Creates an array of the own and inherited enumerable symbols of `object`.
  6865. *
  6866. * @private
  6867. * @param {Object} object The object to query.
  6868. * @returns {Array} Returns the array of symbols.
  6869. */
  6870. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6871. var result = [];
  6872. while (object) {
  6873. arrayPush(result, getSymbols(object));
  6874. object = getPrototype(object);
  6875. }
  6876. return result;
  6877. };
  6878. /**
  6879. * Gets the `toStringTag` of `value`.
  6880. *
  6881. * @private
  6882. * @param {*} value The value to query.
  6883. * @returns {string} Returns the `toStringTag`.
  6884. */
  6885. var getTag = baseGetTag;
  6886. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6887. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6888. (Map && getTag(new Map) != mapTag) ||
  6889. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6890. (Set && getTag(new Set) != setTag) ||
  6891. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6892. getTag = function(value) {
  6893. var result = baseGetTag(value),
  6894. Ctor = result == objectTag ? value.constructor : undefined,
  6895. ctorString = Ctor ? toSource(Ctor) : '';
  6896. if (ctorString) {
  6897. switch (ctorString) {
  6898. case dataViewCtorString: return dataViewTag;
  6899. case mapCtorString: return mapTag;
  6900. case promiseCtorString: return promiseTag;
  6901. case setCtorString: return setTag;
  6902. case weakMapCtorString: return weakMapTag;
  6903. }
  6904. }
  6905. return result;
  6906. };
  6907. }
  6908. /**
  6909. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6910. *
  6911. * @private
  6912. * @param {number} start The start of the view.
  6913. * @param {number} end The end of the view.
  6914. * @param {Array} transforms The transformations to apply to the view.
  6915. * @returns {Object} Returns an object containing the `start` and `end`
  6916. * positions of the view.
  6917. */
  6918. function getView(start, end, transforms) {
  6919. var index = -1,
  6920. length = transforms.length;
  6921. while (++index < length) {
  6922. var data = transforms[index],
  6923. size = data.size;
  6924. switch (data.type) {
  6925. case 'drop': start += size; break;
  6926. case 'dropRight': end -= size; break;
  6927. case 'take': end = nativeMin(end, start + size); break;
  6928. case 'takeRight': start = nativeMax(start, end - size); break;
  6929. }
  6930. }
  6931. return { 'start': start, 'end': end };
  6932. }
  6933. /**
  6934. * Extracts wrapper details from the `source` body comment.
  6935. *
  6936. * @private
  6937. * @param {string} source The source to inspect.
  6938. * @returns {Array} Returns the wrapper details.
  6939. */
  6940. function getWrapDetails(source) {
  6941. var match = source.match(reWrapDetails);
  6942. return match ? match[1].split(reSplitDetails) : [];
  6943. }
  6944. /**
  6945. * Checks if `path` exists on `object`.
  6946. *
  6947. * @private
  6948. * @param {Object} object The object to query.
  6949. * @param {Array|string} path The path to check.
  6950. * @param {Function} hasFunc The function to check properties.
  6951. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6952. */
  6953. function hasPath(object, path, hasFunc) {
  6954. path = castPath(path, object);
  6955. var index = -1,
  6956. length = path.length,
  6957. result = false;
  6958. while (++index < length) {
  6959. var key = toKey(path[index]);
  6960. if (!(result = object != null && hasFunc(object, key))) {
  6961. break;
  6962. }
  6963. object = object[key];
  6964. }
  6965. if (result || ++index != length) {
  6966. return result;
  6967. }
  6968. length = object == null ? 0 : object.length;
  6969. return !!length && isLength(length) && isIndex(key, length) &&
  6970. (isArray(object) || isArguments(object));
  6971. }
  6972. /**
  6973. * Initializes an array clone.
  6974. *
  6975. * @private
  6976. * @param {Array} array The array to clone.
  6977. * @returns {Array} Returns the initialized clone.
  6978. */
  6979. function initCloneArray(array) {
  6980. var length = array.length,
  6981. result = new array.constructor(length);
  6982. // Add properties assigned by `RegExp#exec`.
  6983. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6984. result.index = array.index;
  6985. result.input = array.input;
  6986. }
  6987. return result;
  6988. }
  6989. /**
  6990. * Initializes an object clone.
  6991. *
  6992. * @private
  6993. * @param {Object} object The object to clone.
  6994. * @returns {Object} Returns the initialized clone.
  6995. */
  6996. function initCloneObject(object) {
  6997. return (typeof object.constructor == 'function' && !isPrototype(object))
  6998. ? baseCreate(getPrototype(object))
  6999. : {};
  7000. }
  7001. /**
  7002. * Initializes an object clone based on its `toStringTag`.
  7003. *
  7004. * **Note:** This function only supports cloning values with tags of
  7005. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7006. *
  7007. * @private
  7008. * @param {Object} object The object to clone.
  7009. * @param {string} tag The `toStringTag` of the object to clone.
  7010. * @param {boolean} [isDeep] Specify a deep clone.
  7011. * @returns {Object} Returns the initialized clone.
  7012. */
  7013. function initCloneByTag(object, tag, isDeep) {
  7014. var Ctor = object.constructor;
  7015. switch (tag) {
  7016. case arrayBufferTag:
  7017. return cloneArrayBuffer(object);
  7018. case boolTag:
  7019. case dateTag:
  7020. return new Ctor(+object);
  7021. case dataViewTag:
  7022. return cloneDataView(object, isDeep);
  7023. case float32Tag: case float64Tag:
  7024. case int8Tag: case int16Tag: case int32Tag:
  7025. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7026. return cloneTypedArray(object, isDeep);
  7027. case mapTag:
  7028. return new Ctor;
  7029. case numberTag:
  7030. case stringTag:
  7031. return new Ctor(object);
  7032. case regexpTag:
  7033. return cloneRegExp(object);
  7034. case setTag:
  7035. return new Ctor;
  7036. case symbolTag:
  7037. return cloneSymbol(object);
  7038. }
  7039. }
  7040. /**
  7041. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7042. *
  7043. * @private
  7044. * @param {string} source The source to modify.
  7045. * @returns {Array} details The details to insert.
  7046. * @returns {string} Returns the modified source.
  7047. */
  7048. function insertWrapDetails(source, details) {
  7049. var length = details.length;
  7050. if (!length) {
  7051. return source;
  7052. }
  7053. var lastIndex = length - 1;
  7054. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7055. details = details.join(length > 2 ? ', ' : ' ');
  7056. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7057. }
  7058. /**
  7059. * Checks if `value` is a flattenable `arguments` object or array.
  7060. *
  7061. * @private
  7062. * @param {*} value The value to check.
  7063. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7064. */
  7065. function isFlattenable(value) {
  7066. return isArray(value) || isArguments(value) ||
  7067. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7068. }
  7069. /**
  7070. * Checks if `value` is a valid array-like index.
  7071. *
  7072. * @private
  7073. * @param {*} value The value to check.
  7074. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7075. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7076. */
  7077. function isIndex(value, length) {
  7078. var type = typeof value;
  7079. length = length == null ? MAX_SAFE_INTEGER : length;
  7080. return !!length &&
  7081. (type == 'number' ||
  7082. (type != 'symbol' && reIsUint.test(value))) &&
  7083. (value > -1 && value % 1 == 0 && value < length);
  7084. }
  7085. /**
  7086. * Checks if the given arguments are from an iteratee call.
  7087. *
  7088. * @private
  7089. * @param {*} value The potential iteratee value argument.
  7090. * @param {*} index The potential iteratee index or key argument.
  7091. * @param {*} object The potential iteratee object argument.
  7092. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7093. * else `false`.
  7094. */
  7095. function isIterateeCall(value, index, object) {
  7096. if (!isObject(object)) {
  7097. return false;
  7098. }
  7099. var type = typeof index;
  7100. if (type == 'number'
  7101. ? (isArrayLike(object) && isIndex(index, object.length))
  7102. : (type == 'string' && index in object)
  7103. ) {
  7104. return eq(object[index], value);
  7105. }
  7106. return false;
  7107. }
  7108. /**
  7109. * Checks if `value` is a property name and not a property path.
  7110. *
  7111. * @private
  7112. * @param {*} value The value to check.
  7113. * @param {Object} [object] The object to query keys on.
  7114. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7115. */
  7116. function isKey(value, object) {
  7117. if (isArray(value)) {
  7118. return false;
  7119. }
  7120. var type = typeof value;
  7121. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7122. value == null || isSymbol(value)) {
  7123. return true;
  7124. }
  7125. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7126. (object != null && value in Object(object));
  7127. }
  7128. /**
  7129. * Checks if `value` is suitable for use as unique object key.
  7130. *
  7131. * @private
  7132. * @param {*} value The value to check.
  7133. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7134. */
  7135. function isKeyable(value) {
  7136. var type = typeof value;
  7137. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7138. ? (value !== '__proto__')
  7139. : (value === null);
  7140. }
  7141. /**
  7142. * Checks if `func` has a lazy counterpart.
  7143. *
  7144. * @private
  7145. * @param {Function} func The function to check.
  7146. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7147. * else `false`.
  7148. */
  7149. function isLaziable(func) {
  7150. var funcName = getFuncName(func),
  7151. other = lodash[funcName];
  7152. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7153. return false;
  7154. }
  7155. if (func === other) {
  7156. return true;
  7157. }
  7158. var data = getData(other);
  7159. return !!data && func === data[0];
  7160. }
  7161. /**
  7162. * Checks if `func` has its source masked.
  7163. *
  7164. * @private
  7165. * @param {Function} func The function to check.
  7166. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7167. */
  7168. function isMasked(func) {
  7169. return !!maskSrcKey && (maskSrcKey in func);
  7170. }
  7171. /**
  7172. * Checks if `func` is capable of being masked.
  7173. *
  7174. * @private
  7175. * @param {*} value The value to check.
  7176. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7177. */
  7178. var isMaskable = coreJsData ? isFunction : stubFalse;
  7179. /**
  7180. * Checks if `value` is likely a prototype object.
  7181. *
  7182. * @private
  7183. * @param {*} value The value to check.
  7184. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7185. */
  7186. function isPrototype(value) {
  7187. var Ctor = value && value.constructor,
  7188. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7189. return value === proto;
  7190. }
  7191. /**
  7192. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7193. *
  7194. * @private
  7195. * @param {*} value The value to check.
  7196. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7197. * equality comparisons, else `false`.
  7198. */
  7199. function isStrictComparable(value) {
  7200. return value === value && !isObject(value);
  7201. }
  7202. /**
  7203. * A specialized version of `matchesProperty` for source values suitable
  7204. * for strict equality comparisons, i.e. `===`.
  7205. *
  7206. * @private
  7207. * @param {string} key The key of the property to get.
  7208. * @param {*} srcValue The value to match.
  7209. * @returns {Function} Returns the new spec function.
  7210. */
  7211. function matchesStrictComparable(key, srcValue) {
  7212. return function(object) {
  7213. if (object == null) {
  7214. return false;
  7215. }
  7216. return object[key] === srcValue &&
  7217. (srcValue !== undefined || (key in Object(object)));
  7218. };
  7219. }
  7220. /**
  7221. * A specialized version of `_.memoize` which clears the memoized function's
  7222. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7223. *
  7224. * @private
  7225. * @param {Function} func The function to have its output memoized.
  7226. * @returns {Function} Returns the new memoized function.
  7227. */
  7228. function memoizeCapped(func) {
  7229. var result = memoize(func, function(key) {
  7230. if (cache.size === MAX_MEMOIZE_SIZE) {
  7231. cache.clear();
  7232. }
  7233. return key;
  7234. });
  7235. var cache = result.cache;
  7236. return result;
  7237. }
  7238. /**
  7239. * Merges the function metadata of `source` into `data`.
  7240. *
  7241. * Merging metadata reduces the number of wrappers used to invoke a function.
  7242. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7243. * may be applied regardless of execution order. Methods like `_.ary` and
  7244. * `_.rearg` modify function arguments, making the order in which they are
  7245. * executed important, preventing the merging of metadata. However, we make
  7246. * an exception for a safe combined case where curried functions have `_.ary`
  7247. * and or `_.rearg` applied.
  7248. *
  7249. * @private
  7250. * @param {Array} data The destination metadata.
  7251. * @param {Array} source The source metadata.
  7252. * @returns {Array} Returns `data`.
  7253. */
  7254. function mergeData(data, source) {
  7255. var bitmask = data[1],
  7256. srcBitmask = source[1],
  7257. newBitmask = bitmask | srcBitmask,
  7258. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7259. var isCombo =
  7260. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7261. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7262. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7263. // Exit early if metadata can't be merged.
  7264. if (!(isCommon || isCombo)) {
  7265. return data;
  7266. }
  7267. // Use source `thisArg` if available.
  7268. if (srcBitmask & WRAP_BIND_FLAG) {
  7269. data[2] = source[2];
  7270. // Set when currying a bound function.
  7271. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7272. }
  7273. // Compose partial arguments.
  7274. var value = source[3];
  7275. if (value) {
  7276. var partials = data[3];
  7277. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7278. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7279. }
  7280. // Compose partial right arguments.
  7281. value = source[5];
  7282. if (value) {
  7283. partials = data[5];
  7284. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7285. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7286. }
  7287. // Use source `argPos` if available.
  7288. value = source[7];
  7289. if (value) {
  7290. data[7] = value;
  7291. }
  7292. // Use source `ary` if it's smaller.
  7293. if (srcBitmask & WRAP_ARY_FLAG) {
  7294. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7295. }
  7296. // Use source `arity` if one is not provided.
  7297. if (data[9] == null) {
  7298. data[9] = source[9];
  7299. }
  7300. // Use source `func` and merge bitmasks.
  7301. data[0] = source[0];
  7302. data[1] = newBitmask;
  7303. return data;
  7304. }
  7305. /**
  7306. * This function is like
  7307. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7308. * except that it includes inherited enumerable properties.
  7309. *
  7310. * @private
  7311. * @param {Object} object The object to query.
  7312. * @returns {Array} Returns the array of property names.
  7313. */
  7314. function nativeKeysIn(object) {
  7315. var result = [];
  7316. if (object != null) {
  7317. for (var key in Object(object)) {
  7318. result.push(key);
  7319. }
  7320. }
  7321. return result;
  7322. }
  7323. /**
  7324. * Converts `value` to a string using `Object.prototype.toString`.
  7325. *
  7326. * @private
  7327. * @param {*} value The value to convert.
  7328. * @returns {string} Returns the converted string.
  7329. */
  7330. function objectToString(value) {
  7331. return nativeObjectToString.call(value);
  7332. }
  7333. /**
  7334. * A specialized version of `baseRest` which transforms the rest array.
  7335. *
  7336. * @private
  7337. * @param {Function} func The function to apply a rest parameter to.
  7338. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7339. * @param {Function} transform The rest array transform.
  7340. * @returns {Function} Returns the new function.
  7341. */
  7342. function overRest(func, start, transform) {
  7343. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7344. return function() {
  7345. var args = arguments,
  7346. index = -1,
  7347. length = nativeMax(args.length - start, 0),
  7348. array = Array(length);
  7349. while (++index < length) {
  7350. array[index] = args[start + index];
  7351. }
  7352. index = -1;
  7353. var otherArgs = Array(start + 1);
  7354. while (++index < start) {
  7355. otherArgs[index] = args[index];
  7356. }
  7357. otherArgs[start] = transform(array);
  7358. return apply(func, this, otherArgs);
  7359. };
  7360. }
  7361. /**
  7362. * Gets the parent value at `path` of `object`.
  7363. *
  7364. * @private
  7365. * @param {Object} object The object to query.
  7366. * @param {Array} path The path to get the parent value of.
  7367. * @returns {*} Returns the parent value.
  7368. */
  7369. function parent(object, path) {
  7370. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7371. }
  7372. /**
  7373. * Reorder `array` according to the specified indexes where the element at
  7374. * the first index is assigned as the first element, the element at
  7375. * the second index is assigned as the second element, and so on.
  7376. *
  7377. * @private
  7378. * @param {Array} array The array to reorder.
  7379. * @param {Array} indexes The arranged array indexes.
  7380. * @returns {Array} Returns `array`.
  7381. */
  7382. function reorder(array, indexes) {
  7383. var arrLength = array.length,
  7384. length = nativeMin(indexes.length, arrLength),
  7385. oldArray = copyArray(array);
  7386. while (length--) {
  7387. var index = indexes[length];
  7388. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7389. }
  7390. return array;
  7391. }
  7392. /**
  7393. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7394. *
  7395. * @private
  7396. * @param {Object} object The object to query.
  7397. * @param {string} key The key of the property to get.
  7398. * @returns {*} Returns the property value.
  7399. */
  7400. function safeGet(object, key) {
  7401. if (key === 'constructor' && typeof object[key] === 'function') {
  7402. return;
  7403. }
  7404. if (key == '__proto__') {
  7405. return;
  7406. }
  7407. return object[key];
  7408. }
  7409. /**
  7410. * Sets metadata for `func`.
  7411. *
  7412. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7413. * period of time, it will trip its breaker and transition to an identity
  7414. * function to avoid garbage collection pauses in V8. See
  7415. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7416. * for more details.
  7417. *
  7418. * @private
  7419. * @param {Function} func The function to associate metadata with.
  7420. * @param {*} data The metadata.
  7421. * @returns {Function} Returns `func`.
  7422. */
  7423. var setData = shortOut(baseSetData);
  7424. /**
  7425. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7426. *
  7427. * @private
  7428. * @param {Function} func The function to delay.
  7429. * @param {number} wait The number of milliseconds to delay invocation.
  7430. * @returns {number|Object} Returns the timer id or timeout object.
  7431. */
  7432. var setTimeout = ctxSetTimeout || function(func, wait) {
  7433. return root.setTimeout(func, wait);
  7434. };
  7435. /**
  7436. * Sets the `toString` method of `func` to return `string`.
  7437. *
  7438. * @private
  7439. * @param {Function} func The function to modify.
  7440. * @param {Function} string The `toString` result.
  7441. * @returns {Function} Returns `func`.
  7442. */
  7443. var setToString = shortOut(baseSetToString);
  7444. /**
  7445. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7446. * with wrapper details in a comment at the top of the source body.
  7447. *
  7448. * @private
  7449. * @param {Function} wrapper The function to modify.
  7450. * @param {Function} reference The reference function.
  7451. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7452. * @returns {Function} Returns `wrapper`.
  7453. */
  7454. function setWrapToString(wrapper, reference, bitmask) {
  7455. var source = (reference + '');
  7456. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7457. }
  7458. /**
  7459. * Creates a function that'll short out and invoke `identity` instead
  7460. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7461. * milliseconds.
  7462. *
  7463. * @private
  7464. * @param {Function} func The function to restrict.
  7465. * @returns {Function} Returns the new shortable function.
  7466. */
  7467. function shortOut(func) {
  7468. var count = 0,
  7469. lastCalled = 0;
  7470. return function() {
  7471. var stamp = nativeNow(),
  7472. remaining = HOT_SPAN - (stamp - lastCalled);
  7473. lastCalled = stamp;
  7474. if (remaining > 0) {
  7475. if (++count >= HOT_COUNT) {
  7476. return arguments[0];
  7477. }
  7478. } else {
  7479. count = 0;
  7480. }
  7481. return func.apply(undefined, arguments);
  7482. };
  7483. }
  7484. /**
  7485. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7486. *
  7487. * @private
  7488. * @param {Array} array The array to shuffle.
  7489. * @param {number} [size=array.length] The size of `array`.
  7490. * @returns {Array} Returns `array`.
  7491. */
  7492. function shuffleSelf(array, size) {
  7493. var index = -1,
  7494. length = array.length,
  7495. lastIndex = length - 1;
  7496. size = size === undefined ? length : size;
  7497. while (++index < size) {
  7498. var rand = baseRandom(index, lastIndex),
  7499. value = array[rand];
  7500. array[rand] = array[index];
  7501. array[index] = value;
  7502. }
  7503. array.length = size;
  7504. return array;
  7505. }
  7506. /**
  7507. * Converts `string` to a property path array.
  7508. *
  7509. * @private
  7510. * @param {string} string The string to convert.
  7511. * @returns {Array} Returns the property path array.
  7512. */
  7513. var stringToPath = memoizeCapped(function(string) {
  7514. var result = [];
  7515. if (string.charCodeAt(0) === 46 /* . */) {
  7516. result.push('');
  7517. }
  7518. string.replace(rePropName, function(match, number, quote, subString) {
  7519. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7520. });
  7521. return result;
  7522. });
  7523. /**
  7524. * Converts `value` to a string key if it's not a string or symbol.
  7525. *
  7526. * @private
  7527. * @param {*} value The value to inspect.
  7528. * @returns {string|symbol} Returns the key.
  7529. */
  7530. function toKey(value) {
  7531. if (typeof value == 'string' || isSymbol(value)) {
  7532. return value;
  7533. }
  7534. var result = (value + '');
  7535. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7536. }
  7537. /**
  7538. * Converts `func` to its source code.
  7539. *
  7540. * @private
  7541. * @param {Function} func The function to convert.
  7542. * @returns {string} Returns the source code.
  7543. */
  7544. function toSource(func) {
  7545. if (func != null) {
  7546. try {
  7547. return funcToString.call(func);
  7548. } catch (e) {}
  7549. try {
  7550. return (func + '');
  7551. } catch (e) {}
  7552. }
  7553. return '';
  7554. }
  7555. /**
  7556. * Updates wrapper `details` based on `bitmask` flags.
  7557. *
  7558. * @private
  7559. * @returns {Array} details The details to modify.
  7560. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7561. * @returns {Array} Returns `details`.
  7562. */
  7563. function updateWrapDetails(details, bitmask) {
  7564. arrayEach(wrapFlags, function(pair) {
  7565. var value = '_.' + pair[0];
  7566. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7567. details.push(value);
  7568. }
  7569. });
  7570. return details.sort();
  7571. }
  7572. /**
  7573. * Creates a clone of `wrapper`.
  7574. *
  7575. * @private
  7576. * @param {Object} wrapper The wrapper to clone.
  7577. * @returns {Object} Returns the cloned wrapper.
  7578. */
  7579. function wrapperClone(wrapper) {
  7580. if (wrapper instanceof LazyWrapper) {
  7581. return wrapper.clone();
  7582. }
  7583. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7584. result.__actions__ = copyArray(wrapper.__actions__);
  7585. result.__index__ = wrapper.__index__;
  7586. result.__values__ = wrapper.__values__;
  7587. return result;
  7588. }
  7589. /*------------------------------------------------------------------------*/
  7590. /**
  7591. * Creates an array of elements split into groups the length of `size`.
  7592. * If `array` can't be split evenly, the final chunk will be the remaining
  7593. * elements.
  7594. *
  7595. * @static
  7596. * @memberOf _
  7597. * @since 3.0.0
  7598. * @category Array
  7599. * @param {Array} array The array to process.
  7600. * @param {number} [size=1] The length of each chunk
  7601. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7602. * @returns {Array} Returns the new array of chunks.
  7603. * @example
  7604. *
  7605. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7606. * // => [['a', 'b'], ['c', 'd']]
  7607. *
  7608. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7609. * // => [['a', 'b', 'c'], ['d']]
  7610. */
  7611. function chunk(array, size, guard) {
  7612. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7613. size = 1;
  7614. } else {
  7615. size = nativeMax(toInteger(size), 0);
  7616. }
  7617. var length = array == null ? 0 : array.length;
  7618. if (!length || size < 1) {
  7619. return [];
  7620. }
  7621. var index = 0,
  7622. resIndex = 0,
  7623. result = Array(nativeCeil(length / size));
  7624. while (index < length) {
  7625. result[resIndex++] = baseSlice(array, index, (index += size));
  7626. }
  7627. return result;
  7628. }
  7629. /**
  7630. * Creates an array with all falsey values removed. The values `false`, `null`,
  7631. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7632. *
  7633. * @static
  7634. * @memberOf _
  7635. * @since 0.1.0
  7636. * @category Array
  7637. * @param {Array} array The array to compact.
  7638. * @returns {Array} Returns the new array of filtered values.
  7639. * @example
  7640. *
  7641. * _.compact([0, 1, false, 2, '', 3]);
  7642. * // => [1, 2, 3]
  7643. */
  7644. function compact(array) {
  7645. var index = -1,
  7646. length = array == null ? 0 : array.length,
  7647. resIndex = 0,
  7648. result = [];
  7649. while (++index < length) {
  7650. var value = array[index];
  7651. if (value) {
  7652. result[resIndex++] = value;
  7653. }
  7654. }
  7655. return result;
  7656. }
  7657. /**
  7658. * Creates a new array concatenating `array` with any additional arrays
  7659. * and/or values.
  7660. *
  7661. * @static
  7662. * @memberOf _
  7663. * @since 4.0.0
  7664. * @category Array
  7665. * @param {Array} array The array to concatenate.
  7666. * @param {...*} [values] The values to concatenate.
  7667. * @returns {Array} Returns the new concatenated array.
  7668. * @example
  7669. *
  7670. * var array = [1];
  7671. * var other = _.concat(array, 2, [3], [[4]]);
  7672. *
  7673. * console.log(other);
  7674. * // => [1, 2, 3, [4]]
  7675. *
  7676. * console.log(array);
  7677. * // => [1]
  7678. */
  7679. function concat() {
  7680. var length = arguments.length;
  7681. if (!length) {
  7682. return [];
  7683. }
  7684. var args = Array(length - 1),
  7685. array = arguments[0],
  7686. index = length;
  7687. while (index--) {
  7688. args[index - 1] = arguments[index];
  7689. }
  7690. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7691. }
  7692. /**
  7693. * Creates an array of `array` values not included in the other given arrays
  7694. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7695. * for equality comparisons. The order and references of result values are
  7696. * determined by the first array.
  7697. *
  7698. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7699. *
  7700. * @static
  7701. * @memberOf _
  7702. * @since 0.1.0
  7703. * @category Array
  7704. * @param {Array} array The array to inspect.
  7705. * @param {...Array} [values] The values to exclude.
  7706. * @returns {Array} Returns the new array of filtered values.
  7707. * @see _.without, _.xor
  7708. * @example
  7709. *
  7710. * _.difference([2, 1], [2, 3]);
  7711. * // => [1]
  7712. */
  7713. var difference = baseRest(function(array, values) {
  7714. return isArrayLikeObject(array)
  7715. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7716. : [];
  7717. });
  7718. /**
  7719. * This method is like `_.difference` except that it accepts `iteratee` which
  7720. * is invoked for each element of `array` and `values` to generate the criterion
  7721. * by which they're compared. The order and references of result values are
  7722. * determined by the first array. The iteratee is invoked with one argument:
  7723. * (value).
  7724. *
  7725. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7726. *
  7727. * @static
  7728. * @memberOf _
  7729. * @since 4.0.0
  7730. * @category Array
  7731. * @param {Array} array The array to inspect.
  7732. * @param {...Array} [values] The values to exclude.
  7733. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7734. * @returns {Array} Returns the new array of filtered values.
  7735. * @example
  7736. *
  7737. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7738. * // => [1.2]
  7739. *
  7740. * // The `_.property` iteratee shorthand.
  7741. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7742. * // => [{ 'x': 2 }]
  7743. */
  7744. var differenceBy = baseRest(function(array, values) {
  7745. var iteratee = last(values);
  7746. if (isArrayLikeObject(iteratee)) {
  7747. iteratee = undefined;
  7748. }
  7749. return isArrayLikeObject(array)
  7750. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7751. : [];
  7752. });
  7753. /**
  7754. * This method is like `_.difference` except that it accepts `comparator`
  7755. * which is invoked to compare elements of `array` to `values`. The order and
  7756. * references of result values are determined by the first array. The comparator
  7757. * is invoked with two arguments: (arrVal, othVal).
  7758. *
  7759. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7760. *
  7761. * @static
  7762. * @memberOf _
  7763. * @since 4.0.0
  7764. * @category Array
  7765. * @param {Array} array The array to inspect.
  7766. * @param {...Array} [values] The values to exclude.
  7767. * @param {Function} [comparator] The comparator invoked per element.
  7768. * @returns {Array} Returns the new array of filtered values.
  7769. * @example
  7770. *
  7771. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7772. *
  7773. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7774. * // => [{ 'x': 2, 'y': 1 }]
  7775. */
  7776. var differenceWith = baseRest(function(array, values) {
  7777. var comparator = last(values);
  7778. if (isArrayLikeObject(comparator)) {
  7779. comparator = undefined;
  7780. }
  7781. return isArrayLikeObject(array)
  7782. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7783. : [];
  7784. });
  7785. /**
  7786. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7787. *
  7788. * @static
  7789. * @memberOf _
  7790. * @since 0.5.0
  7791. * @category Array
  7792. * @param {Array} array The array to query.
  7793. * @param {number} [n=1] The number of elements to drop.
  7794. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7795. * @returns {Array} Returns the slice of `array`.
  7796. * @example
  7797. *
  7798. * _.drop([1, 2, 3]);
  7799. * // => [2, 3]
  7800. *
  7801. * _.drop([1, 2, 3], 2);
  7802. * // => [3]
  7803. *
  7804. * _.drop([1, 2, 3], 5);
  7805. * // => []
  7806. *
  7807. * _.drop([1, 2, 3], 0);
  7808. * // => [1, 2, 3]
  7809. */
  7810. function drop(array, n, guard) {
  7811. var length = array == null ? 0 : array.length;
  7812. if (!length) {
  7813. return [];
  7814. }
  7815. n = (guard || n === undefined) ? 1 : toInteger(n);
  7816. return baseSlice(array, n < 0 ? 0 : n, length);
  7817. }
  7818. /**
  7819. * Creates a slice of `array` with `n` elements dropped from the end.
  7820. *
  7821. * @static
  7822. * @memberOf _
  7823. * @since 3.0.0
  7824. * @category Array
  7825. * @param {Array} array The array to query.
  7826. * @param {number} [n=1] The number of elements to drop.
  7827. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7828. * @returns {Array} Returns the slice of `array`.
  7829. * @example
  7830. *
  7831. * _.dropRight([1, 2, 3]);
  7832. * // => [1, 2]
  7833. *
  7834. * _.dropRight([1, 2, 3], 2);
  7835. * // => [1]
  7836. *
  7837. * _.dropRight([1, 2, 3], 5);
  7838. * // => []
  7839. *
  7840. * _.dropRight([1, 2, 3], 0);
  7841. * // => [1, 2, 3]
  7842. */
  7843. function dropRight(array, n, guard) {
  7844. var length = array == null ? 0 : array.length;
  7845. if (!length) {
  7846. return [];
  7847. }
  7848. n = (guard || n === undefined) ? 1 : toInteger(n);
  7849. n = length - n;
  7850. return baseSlice(array, 0, n < 0 ? 0 : n);
  7851. }
  7852. /**
  7853. * Creates a slice of `array` excluding elements dropped from the end.
  7854. * Elements are dropped until `predicate` returns falsey. The predicate is
  7855. * invoked with three arguments: (value, index, array).
  7856. *
  7857. * @static
  7858. * @memberOf _
  7859. * @since 3.0.0
  7860. * @category Array
  7861. * @param {Array} array The array to query.
  7862. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7863. * @returns {Array} Returns the slice of `array`.
  7864. * @example
  7865. *
  7866. * var users = [
  7867. * { 'user': 'barney', 'active': true },
  7868. * { 'user': 'fred', 'active': false },
  7869. * { 'user': 'pebbles', 'active': false }
  7870. * ];
  7871. *
  7872. * _.dropRightWhile(users, function(o) { return !o.active; });
  7873. * // => objects for ['barney']
  7874. *
  7875. * // The `_.matches` iteratee shorthand.
  7876. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7877. * // => objects for ['barney', 'fred']
  7878. *
  7879. * // The `_.matchesProperty` iteratee shorthand.
  7880. * _.dropRightWhile(users, ['active', false]);
  7881. * // => objects for ['barney']
  7882. *
  7883. * // The `_.property` iteratee shorthand.
  7884. * _.dropRightWhile(users, 'active');
  7885. * // => objects for ['barney', 'fred', 'pebbles']
  7886. */
  7887. function dropRightWhile(array, predicate) {
  7888. return (array && array.length)
  7889. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7890. : [];
  7891. }
  7892. /**
  7893. * Creates a slice of `array` excluding elements dropped from the beginning.
  7894. * Elements are dropped until `predicate` returns falsey. The predicate is
  7895. * invoked with three arguments: (value, index, array).
  7896. *
  7897. * @static
  7898. * @memberOf _
  7899. * @since 3.0.0
  7900. * @category Array
  7901. * @param {Array} array The array to query.
  7902. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7903. * @returns {Array} Returns the slice of `array`.
  7904. * @example
  7905. *
  7906. * var users = [
  7907. * { 'user': 'barney', 'active': false },
  7908. * { 'user': 'fred', 'active': false },
  7909. * { 'user': 'pebbles', 'active': true }
  7910. * ];
  7911. *
  7912. * _.dropWhile(users, function(o) { return !o.active; });
  7913. * // => objects for ['pebbles']
  7914. *
  7915. * // The `_.matches` iteratee shorthand.
  7916. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7917. * // => objects for ['fred', 'pebbles']
  7918. *
  7919. * // The `_.matchesProperty` iteratee shorthand.
  7920. * _.dropWhile(users, ['active', false]);
  7921. * // => objects for ['pebbles']
  7922. *
  7923. * // The `_.property` iteratee shorthand.
  7924. * _.dropWhile(users, 'active');
  7925. * // => objects for ['barney', 'fred', 'pebbles']
  7926. */
  7927. function dropWhile(array, predicate) {
  7928. return (array && array.length)
  7929. ? baseWhile(array, getIteratee(predicate, 3), true)
  7930. : [];
  7931. }
  7932. /**
  7933. * Fills elements of `array` with `value` from `start` up to, but not
  7934. * including, `end`.
  7935. *
  7936. * **Note:** This method mutates `array`.
  7937. *
  7938. * @static
  7939. * @memberOf _
  7940. * @since 3.2.0
  7941. * @category Array
  7942. * @param {Array} array The array to fill.
  7943. * @param {*} value The value to fill `array` with.
  7944. * @param {number} [start=0] The start position.
  7945. * @param {number} [end=array.length] The end position.
  7946. * @returns {Array} Returns `array`.
  7947. * @example
  7948. *
  7949. * var array = [1, 2, 3];
  7950. *
  7951. * _.fill(array, 'a');
  7952. * console.log(array);
  7953. * // => ['a', 'a', 'a']
  7954. *
  7955. * _.fill(Array(3), 2);
  7956. * // => [2, 2, 2]
  7957. *
  7958. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7959. * // => [4, '*', '*', 10]
  7960. */
  7961. function fill(array, value, start, end) {
  7962. var length = array == null ? 0 : array.length;
  7963. if (!length) {
  7964. return [];
  7965. }
  7966. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7967. start = 0;
  7968. end = length;
  7969. }
  7970. return baseFill(array, value, start, end);
  7971. }
  7972. /**
  7973. * This method is like `_.find` except that it returns the index of the first
  7974. * element `predicate` returns truthy for instead of the element itself.
  7975. *
  7976. * @static
  7977. * @memberOf _
  7978. * @since 1.1.0
  7979. * @category Array
  7980. * @param {Array} array The array to inspect.
  7981. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7982. * @param {number} [fromIndex=0] The index to search from.
  7983. * @returns {number} Returns the index of the found element, else `-1`.
  7984. * @example
  7985. *
  7986. * var users = [
  7987. * { 'user': 'barney', 'active': false },
  7988. * { 'user': 'fred', 'active': false },
  7989. * { 'user': 'pebbles', 'active': true }
  7990. * ];
  7991. *
  7992. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7993. * // => 0
  7994. *
  7995. * // The `_.matches` iteratee shorthand.
  7996. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7997. * // => 1
  7998. *
  7999. * // The `_.matchesProperty` iteratee shorthand.
  8000. * _.findIndex(users, ['active', false]);
  8001. * // => 0
  8002. *
  8003. * // The `_.property` iteratee shorthand.
  8004. * _.findIndex(users, 'active');
  8005. * // => 2
  8006. */
  8007. function findIndex(array, predicate, fromIndex) {
  8008. var length = array == null ? 0 : array.length;
  8009. if (!length) {
  8010. return -1;
  8011. }
  8012. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8013. if (index < 0) {
  8014. index = nativeMax(length + index, 0);
  8015. }
  8016. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8017. }
  8018. /**
  8019. * This method is like `_.findIndex` except that it iterates over elements
  8020. * of `collection` from right to left.
  8021. *
  8022. * @static
  8023. * @memberOf _
  8024. * @since 2.0.0
  8025. * @category Array
  8026. * @param {Array} array The array to inspect.
  8027. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8028. * @param {number} [fromIndex=array.length-1] The index to search from.
  8029. * @returns {number} Returns the index of the found element, else `-1`.
  8030. * @example
  8031. *
  8032. * var users = [
  8033. * { 'user': 'barney', 'active': true },
  8034. * { 'user': 'fred', 'active': false },
  8035. * { 'user': 'pebbles', 'active': false }
  8036. * ];
  8037. *
  8038. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8039. * // => 2
  8040. *
  8041. * // The `_.matches` iteratee shorthand.
  8042. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8043. * // => 0
  8044. *
  8045. * // The `_.matchesProperty` iteratee shorthand.
  8046. * _.findLastIndex(users, ['active', false]);
  8047. * // => 2
  8048. *
  8049. * // The `_.property` iteratee shorthand.
  8050. * _.findLastIndex(users, 'active');
  8051. * // => 0
  8052. */
  8053. function findLastIndex(array, predicate, fromIndex) {
  8054. var length = array == null ? 0 : array.length;
  8055. if (!length) {
  8056. return -1;
  8057. }
  8058. var index = length - 1;
  8059. if (fromIndex !== undefined) {
  8060. index = toInteger(fromIndex);
  8061. index = fromIndex < 0
  8062. ? nativeMax(length + index, 0)
  8063. : nativeMin(index, length - 1);
  8064. }
  8065. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8066. }
  8067. /**
  8068. * Flattens `array` a single level deep.
  8069. *
  8070. * @static
  8071. * @memberOf _
  8072. * @since 0.1.0
  8073. * @category Array
  8074. * @param {Array} array The array to flatten.
  8075. * @returns {Array} Returns the new flattened array.
  8076. * @example
  8077. *
  8078. * _.flatten([1, [2, [3, [4]], 5]]);
  8079. * // => [1, 2, [3, [4]], 5]
  8080. */
  8081. function flatten(array) {
  8082. var length = array == null ? 0 : array.length;
  8083. return length ? baseFlatten(array, 1) : [];
  8084. }
  8085. /**
  8086. * Recursively flattens `array`.
  8087. *
  8088. * @static
  8089. * @memberOf _
  8090. * @since 3.0.0
  8091. * @category Array
  8092. * @param {Array} array The array to flatten.
  8093. * @returns {Array} Returns the new flattened array.
  8094. * @example
  8095. *
  8096. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8097. * // => [1, 2, 3, 4, 5]
  8098. */
  8099. function flattenDeep(array) {
  8100. var length = array == null ? 0 : array.length;
  8101. return length ? baseFlatten(array, INFINITY) : [];
  8102. }
  8103. /**
  8104. * Recursively flatten `array` up to `depth` times.
  8105. *
  8106. * @static
  8107. * @memberOf _
  8108. * @since 4.4.0
  8109. * @category Array
  8110. * @param {Array} array The array to flatten.
  8111. * @param {number} [depth=1] The maximum recursion depth.
  8112. * @returns {Array} Returns the new flattened array.
  8113. * @example
  8114. *
  8115. * var array = [1, [2, [3, [4]], 5]];
  8116. *
  8117. * _.flattenDepth(array, 1);
  8118. * // => [1, 2, [3, [4]], 5]
  8119. *
  8120. * _.flattenDepth(array, 2);
  8121. * // => [1, 2, 3, [4], 5]
  8122. */
  8123. function flattenDepth(array, depth) {
  8124. var length = array == null ? 0 : array.length;
  8125. if (!length) {
  8126. return [];
  8127. }
  8128. depth = depth === undefined ? 1 : toInteger(depth);
  8129. return baseFlatten(array, depth);
  8130. }
  8131. /**
  8132. * The inverse of `_.toPairs`; this method returns an object composed
  8133. * from key-value `pairs`.
  8134. *
  8135. * @static
  8136. * @memberOf _
  8137. * @since 4.0.0
  8138. * @category Array
  8139. * @param {Array} pairs The key-value pairs.
  8140. * @returns {Object} Returns the new object.
  8141. * @example
  8142. *
  8143. * _.fromPairs([['a', 1], ['b', 2]]);
  8144. * // => { 'a': 1, 'b': 2 }
  8145. */
  8146. function fromPairs(pairs) {
  8147. var index = -1,
  8148. length = pairs == null ? 0 : pairs.length,
  8149. result = {};
  8150. while (++index < length) {
  8151. var pair = pairs[index];
  8152. result[pair[0]] = pair[1];
  8153. }
  8154. return result;
  8155. }
  8156. /**
  8157. * Gets the first element of `array`.
  8158. *
  8159. * @static
  8160. * @memberOf _
  8161. * @since 0.1.0
  8162. * @alias first
  8163. * @category Array
  8164. * @param {Array} array The array to query.
  8165. * @returns {*} Returns the first element of `array`.
  8166. * @example
  8167. *
  8168. * _.head([1, 2, 3]);
  8169. * // => 1
  8170. *
  8171. * _.head([]);
  8172. * // => undefined
  8173. */
  8174. function head(array) {
  8175. return (array && array.length) ? array[0] : undefined;
  8176. }
  8177. /**
  8178. * Gets the index at which the first occurrence of `value` is found in `array`
  8179. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8180. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8181. * offset from the end of `array`.
  8182. *
  8183. * @static
  8184. * @memberOf _
  8185. * @since 0.1.0
  8186. * @category Array
  8187. * @param {Array} array The array to inspect.
  8188. * @param {*} value The value to search for.
  8189. * @param {number} [fromIndex=0] The index to search from.
  8190. * @returns {number} Returns the index of the matched value, else `-1`.
  8191. * @example
  8192. *
  8193. * _.indexOf([1, 2, 1, 2], 2);
  8194. * // => 1
  8195. *
  8196. * // Search from the `fromIndex`.
  8197. * _.indexOf([1, 2, 1, 2], 2, 2);
  8198. * // => 3
  8199. */
  8200. function indexOf(array, value, fromIndex) {
  8201. var length = array == null ? 0 : array.length;
  8202. if (!length) {
  8203. return -1;
  8204. }
  8205. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8206. if (index < 0) {
  8207. index = nativeMax(length + index, 0);
  8208. }
  8209. return baseIndexOf(array, value, index);
  8210. }
  8211. /**
  8212. * Gets all but the last element of `array`.
  8213. *
  8214. * @static
  8215. * @memberOf _
  8216. * @since 0.1.0
  8217. * @category Array
  8218. * @param {Array} array The array to query.
  8219. * @returns {Array} Returns the slice of `array`.
  8220. * @example
  8221. *
  8222. * _.initial([1, 2, 3]);
  8223. * // => [1, 2]
  8224. */
  8225. function initial(array) {
  8226. var length = array == null ? 0 : array.length;
  8227. return length ? baseSlice(array, 0, -1) : [];
  8228. }
  8229. /**
  8230. * Creates an array of unique values that are included in all given arrays
  8231. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8232. * for equality comparisons. The order and references of result values are
  8233. * determined by the first array.
  8234. *
  8235. * @static
  8236. * @memberOf _
  8237. * @since 0.1.0
  8238. * @category Array
  8239. * @param {...Array} [arrays] The arrays to inspect.
  8240. * @returns {Array} Returns the new array of intersecting values.
  8241. * @example
  8242. *
  8243. * _.intersection([2, 1], [2, 3]);
  8244. * // => [2]
  8245. */
  8246. var intersection = baseRest(function(arrays) {
  8247. var mapped = arrayMap(arrays, castArrayLikeObject);
  8248. return (mapped.length && mapped[0] === arrays[0])
  8249. ? baseIntersection(mapped)
  8250. : [];
  8251. });
  8252. /**
  8253. * This method is like `_.intersection` except that it accepts `iteratee`
  8254. * which is invoked for each element of each `arrays` to generate the criterion
  8255. * by which they're compared. The order and references of result values are
  8256. * determined by the first array. The iteratee is invoked with one argument:
  8257. * (value).
  8258. *
  8259. * @static
  8260. * @memberOf _
  8261. * @since 4.0.0
  8262. * @category Array
  8263. * @param {...Array} [arrays] The arrays to inspect.
  8264. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8265. * @returns {Array} Returns the new array of intersecting values.
  8266. * @example
  8267. *
  8268. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8269. * // => [2.1]
  8270. *
  8271. * // The `_.property` iteratee shorthand.
  8272. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8273. * // => [{ 'x': 1 }]
  8274. */
  8275. var intersectionBy = baseRest(function(arrays) {
  8276. var iteratee = last(arrays),
  8277. mapped = arrayMap(arrays, castArrayLikeObject);
  8278. if (iteratee === last(mapped)) {
  8279. iteratee = undefined;
  8280. } else {
  8281. mapped.pop();
  8282. }
  8283. return (mapped.length && mapped[0] === arrays[0])
  8284. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8285. : [];
  8286. });
  8287. /**
  8288. * This method is like `_.intersection` except that it accepts `comparator`
  8289. * which is invoked to compare elements of `arrays`. The order and references
  8290. * of result values are determined by the first array. The comparator is
  8291. * invoked with two arguments: (arrVal, othVal).
  8292. *
  8293. * @static
  8294. * @memberOf _
  8295. * @since 4.0.0
  8296. * @category Array
  8297. * @param {...Array} [arrays] The arrays to inspect.
  8298. * @param {Function} [comparator] The comparator invoked per element.
  8299. * @returns {Array} Returns the new array of intersecting values.
  8300. * @example
  8301. *
  8302. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8303. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8304. *
  8305. * _.intersectionWith(objects, others, _.isEqual);
  8306. * // => [{ 'x': 1, 'y': 2 }]
  8307. */
  8308. var intersectionWith = baseRest(function(arrays) {
  8309. var comparator = last(arrays),
  8310. mapped = arrayMap(arrays, castArrayLikeObject);
  8311. comparator = typeof comparator == 'function' ? comparator : undefined;
  8312. if (comparator) {
  8313. mapped.pop();
  8314. }
  8315. return (mapped.length && mapped[0] === arrays[0])
  8316. ? baseIntersection(mapped, undefined, comparator)
  8317. : [];
  8318. });
  8319. /**
  8320. * Converts all elements in `array` into a string separated by `separator`.
  8321. *
  8322. * @static
  8323. * @memberOf _
  8324. * @since 4.0.0
  8325. * @category Array
  8326. * @param {Array} array The array to convert.
  8327. * @param {string} [separator=','] The element separator.
  8328. * @returns {string} Returns the joined string.
  8329. * @example
  8330. *
  8331. * _.join(['a', 'b', 'c'], '~');
  8332. * // => 'a~b~c'
  8333. */
  8334. function join(array, separator) {
  8335. return array == null ? '' : nativeJoin.call(array, separator);
  8336. }
  8337. /**
  8338. * Gets the last element of `array`.
  8339. *
  8340. * @static
  8341. * @memberOf _
  8342. * @since 0.1.0
  8343. * @category Array
  8344. * @param {Array} array The array to query.
  8345. * @returns {*} Returns the last element of `array`.
  8346. * @example
  8347. *
  8348. * _.last([1, 2, 3]);
  8349. * // => 3
  8350. */
  8351. function last(array) {
  8352. var length = array == null ? 0 : array.length;
  8353. return length ? array[length - 1] : undefined;
  8354. }
  8355. /**
  8356. * This method is like `_.indexOf` except that it iterates over elements of
  8357. * `array` from right to left.
  8358. *
  8359. * @static
  8360. * @memberOf _
  8361. * @since 0.1.0
  8362. * @category Array
  8363. * @param {Array} array The array to inspect.
  8364. * @param {*} value The value to search for.
  8365. * @param {number} [fromIndex=array.length-1] The index to search from.
  8366. * @returns {number} Returns the index of the matched value, else `-1`.
  8367. * @example
  8368. *
  8369. * _.lastIndexOf([1, 2, 1, 2], 2);
  8370. * // => 3
  8371. *
  8372. * // Search from the `fromIndex`.
  8373. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8374. * // => 1
  8375. */
  8376. function lastIndexOf(array, value, fromIndex) {
  8377. var length = array == null ? 0 : array.length;
  8378. if (!length) {
  8379. return -1;
  8380. }
  8381. var index = length;
  8382. if (fromIndex !== undefined) {
  8383. index = toInteger(fromIndex);
  8384. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8385. }
  8386. return value === value
  8387. ? strictLastIndexOf(array, value, index)
  8388. : baseFindIndex(array, baseIsNaN, index, true);
  8389. }
  8390. /**
  8391. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8392. * element from the end is returned.
  8393. *
  8394. * @static
  8395. * @memberOf _
  8396. * @since 4.11.0
  8397. * @category Array
  8398. * @param {Array} array The array to query.
  8399. * @param {number} [n=0] The index of the element to return.
  8400. * @returns {*} Returns the nth element of `array`.
  8401. * @example
  8402. *
  8403. * var array = ['a', 'b', 'c', 'd'];
  8404. *
  8405. * _.nth(array, 1);
  8406. * // => 'b'
  8407. *
  8408. * _.nth(array, -2);
  8409. * // => 'c';
  8410. */
  8411. function nth(array, n) {
  8412. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8413. }
  8414. /**
  8415. * Removes all given values from `array` using
  8416. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8417. * for equality comparisons.
  8418. *
  8419. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8420. * to remove elements from an array by predicate.
  8421. *
  8422. * @static
  8423. * @memberOf _
  8424. * @since 2.0.0
  8425. * @category Array
  8426. * @param {Array} array The array to modify.
  8427. * @param {...*} [values] The values to remove.
  8428. * @returns {Array} Returns `array`.
  8429. * @example
  8430. *
  8431. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8432. *
  8433. * _.pull(array, 'a', 'c');
  8434. * console.log(array);
  8435. * // => ['b', 'b']
  8436. */
  8437. var pull = baseRest(pullAll);
  8438. /**
  8439. * This method is like `_.pull` except that it accepts an array of values to remove.
  8440. *
  8441. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8442. *
  8443. * @static
  8444. * @memberOf _
  8445. * @since 4.0.0
  8446. * @category Array
  8447. * @param {Array} array The array to modify.
  8448. * @param {Array} values The values to remove.
  8449. * @returns {Array} Returns `array`.
  8450. * @example
  8451. *
  8452. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8453. *
  8454. * _.pullAll(array, ['a', 'c']);
  8455. * console.log(array);
  8456. * // => ['b', 'b']
  8457. */
  8458. function pullAll(array, values) {
  8459. return (array && array.length && values && values.length)
  8460. ? basePullAll(array, values)
  8461. : array;
  8462. }
  8463. /**
  8464. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8465. * invoked for each element of `array` and `values` to generate the criterion
  8466. * by which they're compared. The iteratee is invoked with one argument: (value).
  8467. *
  8468. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8469. *
  8470. * @static
  8471. * @memberOf _
  8472. * @since 4.0.0
  8473. * @category Array
  8474. * @param {Array} array The array to modify.
  8475. * @param {Array} values The values to remove.
  8476. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8477. * @returns {Array} Returns `array`.
  8478. * @example
  8479. *
  8480. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8481. *
  8482. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8483. * console.log(array);
  8484. * // => [{ 'x': 2 }]
  8485. */
  8486. function pullAllBy(array, values, iteratee) {
  8487. return (array && array.length && values && values.length)
  8488. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8489. : array;
  8490. }
  8491. /**
  8492. * This method is like `_.pullAll` except that it accepts `comparator` which
  8493. * is invoked to compare elements of `array` to `values`. The comparator is
  8494. * invoked with two arguments: (arrVal, othVal).
  8495. *
  8496. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8497. *
  8498. * @static
  8499. * @memberOf _
  8500. * @since 4.6.0
  8501. * @category Array
  8502. * @param {Array} array The array to modify.
  8503. * @param {Array} values The values to remove.
  8504. * @param {Function} [comparator] The comparator invoked per element.
  8505. * @returns {Array} Returns `array`.
  8506. * @example
  8507. *
  8508. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8509. *
  8510. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8511. * console.log(array);
  8512. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8513. */
  8514. function pullAllWith(array, values, comparator) {
  8515. return (array && array.length && values && values.length)
  8516. ? basePullAll(array, values, undefined, comparator)
  8517. : array;
  8518. }
  8519. /**
  8520. * Removes elements from `array` corresponding to `indexes` and returns an
  8521. * array of removed elements.
  8522. *
  8523. * **Note:** Unlike `_.at`, this method mutates `array`.
  8524. *
  8525. * @static
  8526. * @memberOf _
  8527. * @since 3.0.0
  8528. * @category Array
  8529. * @param {Array} array The array to modify.
  8530. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8531. * @returns {Array} Returns the new array of removed elements.
  8532. * @example
  8533. *
  8534. * var array = ['a', 'b', 'c', 'd'];
  8535. * var pulled = _.pullAt(array, [1, 3]);
  8536. *
  8537. * console.log(array);
  8538. * // => ['a', 'c']
  8539. *
  8540. * console.log(pulled);
  8541. * // => ['b', 'd']
  8542. */
  8543. var pullAt = flatRest(function(array, indexes) {
  8544. var length = array == null ? 0 : array.length,
  8545. result = baseAt(array, indexes);
  8546. basePullAt(array, arrayMap(indexes, function(index) {
  8547. return isIndex(index, length) ? +index : index;
  8548. }).sort(compareAscending));
  8549. return result;
  8550. });
  8551. /**
  8552. * Removes all elements from `array` that `predicate` returns truthy for
  8553. * and returns an array of the removed elements. The predicate is invoked
  8554. * with three arguments: (value, index, array).
  8555. *
  8556. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8557. * to pull elements from an array by value.
  8558. *
  8559. * @static
  8560. * @memberOf _
  8561. * @since 2.0.0
  8562. * @category Array
  8563. * @param {Array} array The array to modify.
  8564. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8565. * @returns {Array} Returns the new array of removed elements.
  8566. * @example
  8567. *
  8568. * var array = [1, 2, 3, 4];
  8569. * var evens = _.remove(array, function(n) {
  8570. * return n % 2 == 0;
  8571. * });
  8572. *
  8573. * console.log(array);
  8574. * // => [1, 3]
  8575. *
  8576. * console.log(evens);
  8577. * // => [2, 4]
  8578. */
  8579. function remove(array, predicate) {
  8580. var result = [];
  8581. if (!(array && array.length)) {
  8582. return result;
  8583. }
  8584. var index = -1,
  8585. indexes = [],
  8586. length = array.length;
  8587. predicate = getIteratee(predicate, 3);
  8588. while (++index < length) {
  8589. var value = array[index];
  8590. if (predicate(value, index, array)) {
  8591. result.push(value);
  8592. indexes.push(index);
  8593. }
  8594. }
  8595. basePullAt(array, indexes);
  8596. return result;
  8597. }
  8598. /**
  8599. * Reverses `array` so that the first element becomes the last, the second
  8600. * element becomes the second to last, and so on.
  8601. *
  8602. * **Note:** This method mutates `array` and is based on
  8603. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8604. *
  8605. * @static
  8606. * @memberOf _
  8607. * @since 4.0.0
  8608. * @category Array
  8609. * @param {Array} array The array to modify.
  8610. * @returns {Array} Returns `array`.
  8611. * @example
  8612. *
  8613. * var array = [1, 2, 3];
  8614. *
  8615. * _.reverse(array);
  8616. * // => [3, 2, 1]
  8617. *
  8618. * console.log(array);
  8619. * // => [3, 2, 1]
  8620. */
  8621. function reverse(array) {
  8622. return array == null ? array : nativeReverse.call(array);
  8623. }
  8624. /**
  8625. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8626. *
  8627. * **Note:** This method is used instead of
  8628. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8629. * returned.
  8630. *
  8631. * @static
  8632. * @memberOf _
  8633. * @since 3.0.0
  8634. * @category Array
  8635. * @param {Array} array The array to slice.
  8636. * @param {number} [start=0] The start position.
  8637. * @param {number} [end=array.length] The end position.
  8638. * @returns {Array} Returns the slice of `array`.
  8639. */
  8640. function slice(array, start, end) {
  8641. var length = array == null ? 0 : array.length;
  8642. if (!length) {
  8643. return [];
  8644. }
  8645. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8646. start = 0;
  8647. end = length;
  8648. }
  8649. else {
  8650. start = start == null ? 0 : toInteger(start);
  8651. end = end === undefined ? length : toInteger(end);
  8652. }
  8653. return baseSlice(array, start, end);
  8654. }
  8655. /**
  8656. * Uses a binary search to determine the lowest index at which `value`
  8657. * should be inserted into `array` in order to maintain its sort order.
  8658. *
  8659. * @static
  8660. * @memberOf _
  8661. * @since 0.1.0
  8662. * @category Array
  8663. * @param {Array} array The sorted array to inspect.
  8664. * @param {*} value The value to evaluate.
  8665. * @returns {number} Returns the index at which `value` should be inserted
  8666. * into `array`.
  8667. * @example
  8668. *
  8669. * _.sortedIndex([30, 50], 40);
  8670. * // => 1
  8671. */
  8672. function sortedIndex(array, value) {
  8673. return baseSortedIndex(array, value);
  8674. }
  8675. /**
  8676. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8677. * which is invoked for `value` and each element of `array` to compute their
  8678. * sort ranking. The iteratee is invoked with one argument: (value).
  8679. *
  8680. * @static
  8681. * @memberOf _
  8682. * @since 4.0.0
  8683. * @category Array
  8684. * @param {Array} array The sorted array to inspect.
  8685. * @param {*} value The value to evaluate.
  8686. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8687. * @returns {number} Returns the index at which `value` should be inserted
  8688. * into `array`.
  8689. * @example
  8690. *
  8691. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8692. *
  8693. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8694. * // => 0
  8695. *
  8696. * // The `_.property` iteratee shorthand.
  8697. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8698. * // => 0
  8699. */
  8700. function sortedIndexBy(array, value, iteratee) {
  8701. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8702. }
  8703. /**
  8704. * This method is like `_.indexOf` except that it performs a binary
  8705. * search on a sorted `array`.
  8706. *
  8707. * @static
  8708. * @memberOf _
  8709. * @since 4.0.0
  8710. * @category Array
  8711. * @param {Array} array The array to inspect.
  8712. * @param {*} value The value to search for.
  8713. * @returns {number} Returns the index of the matched value, else `-1`.
  8714. * @example
  8715. *
  8716. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8717. * // => 1
  8718. */
  8719. function sortedIndexOf(array, value) {
  8720. var length = array == null ? 0 : array.length;
  8721. if (length) {
  8722. var index = baseSortedIndex(array, value);
  8723. if (index < length && eq(array[index], value)) {
  8724. return index;
  8725. }
  8726. }
  8727. return -1;
  8728. }
  8729. /**
  8730. * This method is like `_.sortedIndex` except that it returns the highest
  8731. * index at which `value` should be inserted into `array` in order to
  8732. * maintain its sort order.
  8733. *
  8734. * @static
  8735. * @memberOf _
  8736. * @since 3.0.0
  8737. * @category Array
  8738. * @param {Array} array The sorted array to inspect.
  8739. * @param {*} value The value to evaluate.
  8740. * @returns {number} Returns the index at which `value` should be inserted
  8741. * into `array`.
  8742. * @example
  8743. *
  8744. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8745. * // => 4
  8746. */
  8747. function sortedLastIndex(array, value) {
  8748. return baseSortedIndex(array, value, true);
  8749. }
  8750. /**
  8751. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8752. * which is invoked for `value` and each element of `array` to compute their
  8753. * sort ranking. The iteratee is invoked with one argument: (value).
  8754. *
  8755. * @static
  8756. * @memberOf _
  8757. * @since 4.0.0
  8758. * @category Array
  8759. * @param {Array} array The sorted array to inspect.
  8760. * @param {*} value The value to evaluate.
  8761. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8762. * @returns {number} Returns the index at which `value` should be inserted
  8763. * into `array`.
  8764. * @example
  8765. *
  8766. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8767. *
  8768. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8769. * // => 1
  8770. *
  8771. * // The `_.property` iteratee shorthand.
  8772. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8773. * // => 1
  8774. */
  8775. function sortedLastIndexBy(array, value, iteratee) {
  8776. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8777. }
  8778. /**
  8779. * This method is like `_.lastIndexOf` except that it performs a binary
  8780. * search on a sorted `array`.
  8781. *
  8782. * @static
  8783. * @memberOf _
  8784. * @since 4.0.0
  8785. * @category Array
  8786. * @param {Array} array The array to inspect.
  8787. * @param {*} value The value to search for.
  8788. * @returns {number} Returns the index of the matched value, else `-1`.
  8789. * @example
  8790. *
  8791. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8792. * // => 3
  8793. */
  8794. function sortedLastIndexOf(array, value) {
  8795. var length = array == null ? 0 : array.length;
  8796. if (length) {
  8797. var index = baseSortedIndex(array, value, true) - 1;
  8798. if (eq(array[index], value)) {
  8799. return index;
  8800. }
  8801. }
  8802. return -1;
  8803. }
  8804. /**
  8805. * This method is like `_.uniq` except that it's designed and optimized
  8806. * for sorted arrays.
  8807. *
  8808. * @static
  8809. * @memberOf _
  8810. * @since 4.0.0
  8811. * @category Array
  8812. * @param {Array} array The array to inspect.
  8813. * @returns {Array} Returns the new duplicate free array.
  8814. * @example
  8815. *
  8816. * _.sortedUniq([1, 1, 2]);
  8817. * // => [1, 2]
  8818. */
  8819. function sortedUniq(array) {
  8820. return (array && array.length)
  8821. ? baseSortedUniq(array)
  8822. : [];
  8823. }
  8824. /**
  8825. * This method is like `_.uniqBy` except that it's designed and optimized
  8826. * for sorted arrays.
  8827. *
  8828. * @static
  8829. * @memberOf _
  8830. * @since 4.0.0
  8831. * @category Array
  8832. * @param {Array} array The array to inspect.
  8833. * @param {Function} [iteratee] The iteratee invoked per element.
  8834. * @returns {Array} Returns the new duplicate free array.
  8835. * @example
  8836. *
  8837. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8838. * // => [1.1, 2.3]
  8839. */
  8840. function sortedUniqBy(array, iteratee) {
  8841. return (array && array.length)
  8842. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8843. : [];
  8844. }
  8845. /**
  8846. * Gets all but the first element of `array`.
  8847. *
  8848. * @static
  8849. * @memberOf _
  8850. * @since 4.0.0
  8851. * @category Array
  8852. * @param {Array} array The array to query.
  8853. * @returns {Array} Returns the slice of `array`.
  8854. * @example
  8855. *
  8856. * _.tail([1, 2, 3]);
  8857. * // => [2, 3]
  8858. */
  8859. function tail(array) {
  8860. var length = array == null ? 0 : array.length;
  8861. return length ? baseSlice(array, 1, length) : [];
  8862. }
  8863. /**
  8864. * Creates a slice of `array` with `n` elements taken from the beginning.
  8865. *
  8866. * @static
  8867. * @memberOf _
  8868. * @since 0.1.0
  8869. * @category Array
  8870. * @param {Array} array The array to query.
  8871. * @param {number} [n=1] The number of elements to take.
  8872. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8873. * @returns {Array} Returns the slice of `array`.
  8874. * @example
  8875. *
  8876. * _.take([1, 2, 3]);
  8877. * // => [1]
  8878. *
  8879. * _.take([1, 2, 3], 2);
  8880. * // => [1, 2]
  8881. *
  8882. * _.take([1, 2, 3], 5);
  8883. * // => [1, 2, 3]
  8884. *
  8885. * _.take([1, 2, 3], 0);
  8886. * // => []
  8887. */
  8888. function take(array, n, guard) {
  8889. if (!(array && array.length)) {
  8890. return [];
  8891. }
  8892. n = (guard || n === undefined) ? 1 : toInteger(n);
  8893. return baseSlice(array, 0, n < 0 ? 0 : n);
  8894. }
  8895. /**
  8896. * Creates a slice of `array` with `n` elements taken from the end.
  8897. *
  8898. * @static
  8899. * @memberOf _
  8900. * @since 3.0.0
  8901. * @category Array
  8902. * @param {Array} array The array to query.
  8903. * @param {number} [n=1] The number of elements to take.
  8904. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8905. * @returns {Array} Returns the slice of `array`.
  8906. * @example
  8907. *
  8908. * _.takeRight([1, 2, 3]);
  8909. * // => [3]
  8910. *
  8911. * _.takeRight([1, 2, 3], 2);
  8912. * // => [2, 3]
  8913. *
  8914. * _.takeRight([1, 2, 3], 5);
  8915. * // => [1, 2, 3]
  8916. *
  8917. * _.takeRight([1, 2, 3], 0);
  8918. * // => []
  8919. */
  8920. function takeRight(array, n, guard) {
  8921. var length = array == null ? 0 : array.length;
  8922. if (!length) {
  8923. return [];
  8924. }
  8925. n = (guard || n === undefined) ? 1 : toInteger(n);
  8926. n = length - n;
  8927. return baseSlice(array, n < 0 ? 0 : n, length);
  8928. }
  8929. /**
  8930. * Creates a slice of `array` with elements taken from the end. Elements are
  8931. * taken until `predicate` returns falsey. The predicate is invoked with
  8932. * three arguments: (value, index, array).
  8933. *
  8934. * @static
  8935. * @memberOf _
  8936. * @since 3.0.0
  8937. * @category Array
  8938. * @param {Array} array The array to query.
  8939. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8940. * @returns {Array} Returns the slice of `array`.
  8941. * @example
  8942. *
  8943. * var users = [
  8944. * { 'user': 'barney', 'active': true },
  8945. * { 'user': 'fred', 'active': false },
  8946. * { 'user': 'pebbles', 'active': false }
  8947. * ];
  8948. *
  8949. * _.takeRightWhile(users, function(o) { return !o.active; });
  8950. * // => objects for ['fred', 'pebbles']
  8951. *
  8952. * // The `_.matches` iteratee shorthand.
  8953. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8954. * // => objects for ['pebbles']
  8955. *
  8956. * // The `_.matchesProperty` iteratee shorthand.
  8957. * _.takeRightWhile(users, ['active', false]);
  8958. * // => objects for ['fred', 'pebbles']
  8959. *
  8960. * // The `_.property` iteratee shorthand.
  8961. * _.takeRightWhile(users, 'active');
  8962. * // => []
  8963. */
  8964. function takeRightWhile(array, predicate) {
  8965. return (array && array.length)
  8966. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8967. : [];
  8968. }
  8969. /**
  8970. * Creates a slice of `array` with elements taken from the beginning. Elements
  8971. * are taken until `predicate` returns falsey. The predicate is invoked with
  8972. * three arguments: (value, index, array).
  8973. *
  8974. * @static
  8975. * @memberOf _
  8976. * @since 3.0.0
  8977. * @category Array
  8978. * @param {Array} array The array to query.
  8979. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8980. * @returns {Array} Returns the slice of `array`.
  8981. * @example
  8982. *
  8983. * var users = [
  8984. * { 'user': 'barney', 'active': false },
  8985. * { 'user': 'fred', 'active': false },
  8986. * { 'user': 'pebbles', 'active': true }
  8987. * ];
  8988. *
  8989. * _.takeWhile(users, function(o) { return !o.active; });
  8990. * // => objects for ['barney', 'fred']
  8991. *
  8992. * // The `_.matches` iteratee shorthand.
  8993. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8994. * // => objects for ['barney']
  8995. *
  8996. * // The `_.matchesProperty` iteratee shorthand.
  8997. * _.takeWhile(users, ['active', false]);
  8998. * // => objects for ['barney', 'fred']
  8999. *
  9000. * // The `_.property` iteratee shorthand.
  9001. * _.takeWhile(users, 'active');
  9002. * // => []
  9003. */
  9004. function takeWhile(array, predicate) {
  9005. return (array && array.length)
  9006. ? baseWhile(array, getIteratee(predicate, 3))
  9007. : [];
  9008. }
  9009. /**
  9010. * Creates an array of unique values, in order, from all given arrays using
  9011. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9012. * for equality comparisons.
  9013. *
  9014. * @static
  9015. * @memberOf _
  9016. * @since 0.1.0
  9017. * @category Array
  9018. * @param {...Array} [arrays] The arrays to inspect.
  9019. * @returns {Array} Returns the new array of combined values.
  9020. * @example
  9021. *
  9022. * _.union([2], [1, 2]);
  9023. * // => [2, 1]
  9024. */
  9025. var union = baseRest(function(arrays) {
  9026. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9027. });
  9028. /**
  9029. * This method is like `_.union` except that it accepts `iteratee` which is
  9030. * invoked for each element of each `arrays` to generate the criterion by
  9031. * which uniqueness is computed. Result values are chosen from the first
  9032. * array in which the value occurs. The iteratee is invoked with one argument:
  9033. * (value).
  9034. *
  9035. * @static
  9036. * @memberOf _
  9037. * @since 4.0.0
  9038. * @category Array
  9039. * @param {...Array} [arrays] The arrays to inspect.
  9040. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9041. * @returns {Array} Returns the new array of combined values.
  9042. * @example
  9043. *
  9044. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9045. * // => [2.1, 1.2]
  9046. *
  9047. * // The `_.property` iteratee shorthand.
  9048. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9049. * // => [{ 'x': 1 }, { 'x': 2 }]
  9050. */
  9051. var unionBy = baseRest(function(arrays) {
  9052. var iteratee = last(arrays);
  9053. if (isArrayLikeObject(iteratee)) {
  9054. iteratee = undefined;
  9055. }
  9056. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9057. });
  9058. /**
  9059. * This method is like `_.union` except that it accepts `comparator` which
  9060. * is invoked to compare elements of `arrays`. Result values are chosen from
  9061. * the first array in which the value occurs. The comparator is invoked
  9062. * with two arguments: (arrVal, othVal).
  9063. *
  9064. * @static
  9065. * @memberOf _
  9066. * @since 4.0.0
  9067. * @category Array
  9068. * @param {...Array} [arrays] The arrays to inspect.
  9069. * @param {Function} [comparator] The comparator invoked per element.
  9070. * @returns {Array} Returns the new array of combined values.
  9071. * @example
  9072. *
  9073. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9074. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9075. *
  9076. * _.unionWith(objects, others, _.isEqual);
  9077. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9078. */
  9079. var unionWith = baseRest(function(arrays) {
  9080. var comparator = last(arrays);
  9081. comparator = typeof comparator == 'function' ? comparator : undefined;
  9082. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9083. });
  9084. /**
  9085. * Creates a duplicate-free version of an array, using
  9086. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9087. * for equality comparisons, in which only the first occurrence of each element
  9088. * is kept. The order of result values is determined by the order they occur
  9089. * in the array.
  9090. *
  9091. * @static
  9092. * @memberOf _
  9093. * @since 0.1.0
  9094. * @category Array
  9095. * @param {Array} array The array to inspect.
  9096. * @returns {Array} Returns the new duplicate free array.
  9097. * @example
  9098. *
  9099. * _.uniq([2, 1, 2]);
  9100. * // => [2, 1]
  9101. */
  9102. function uniq(array) {
  9103. return (array && array.length) ? baseUniq(array) : [];
  9104. }
  9105. /**
  9106. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9107. * invoked for each element in `array` to generate the criterion by which
  9108. * uniqueness is computed. The order of result values is determined by the
  9109. * order they occur in the array. The iteratee is invoked with one argument:
  9110. * (value).
  9111. *
  9112. * @static
  9113. * @memberOf _
  9114. * @since 4.0.0
  9115. * @category Array
  9116. * @param {Array} array The array to inspect.
  9117. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9118. * @returns {Array} Returns the new duplicate free array.
  9119. * @example
  9120. *
  9121. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9122. * // => [2.1, 1.2]
  9123. *
  9124. * // The `_.property` iteratee shorthand.
  9125. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9126. * // => [{ 'x': 1 }, { 'x': 2 }]
  9127. */
  9128. function uniqBy(array, iteratee) {
  9129. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9130. }
  9131. /**
  9132. * This method is like `_.uniq` except that it accepts `comparator` which
  9133. * is invoked to compare elements of `array`. The order of result values is
  9134. * determined by the order they occur in the array.The comparator is invoked
  9135. * with two arguments: (arrVal, othVal).
  9136. *
  9137. * @static
  9138. * @memberOf _
  9139. * @since 4.0.0
  9140. * @category Array
  9141. * @param {Array} array The array to inspect.
  9142. * @param {Function} [comparator] The comparator invoked per element.
  9143. * @returns {Array} Returns the new duplicate free array.
  9144. * @example
  9145. *
  9146. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9147. *
  9148. * _.uniqWith(objects, _.isEqual);
  9149. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9150. */
  9151. function uniqWith(array, comparator) {
  9152. comparator = typeof comparator == 'function' ? comparator : undefined;
  9153. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9154. }
  9155. /**
  9156. * This method is like `_.zip` except that it accepts an array of grouped
  9157. * elements and creates an array regrouping the elements to their pre-zip
  9158. * configuration.
  9159. *
  9160. * @static
  9161. * @memberOf _
  9162. * @since 1.2.0
  9163. * @category Array
  9164. * @param {Array} array The array of grouped elements to process.
  9165. * @returns {Array} Returns the new array of regrouped elements.
  9166. * @example
  9167. *
  9168. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9169. * // => [['a', 1, true], ['b', 2, false]]
  9170. *
  9171. * _.unzip(zipped);
  9172. * // => [['a', 'b'], [1, 2], [true, false]]
  9173. */
  9174. function unzip(array) {
  9175. if (!(array && array.length)) {
  9176. return [];
  9177. }
  9178. var length = 0;
  9179. array = arrayFilter(array, function(group) {
  9180. if (isArrayLikeObject(group)) {
  9181. length = nativeMax(group.length, length);
  9182. return true;
  9183. }
  9184. });
  9185. return baseTimes(length, function(index) {
  9186. return arrayMap(array, baseProperty(index));
  9187. });
  9188. }
  9189. /**
  9190. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9191. * how regrouped values should be combined. The iteratee is invoked with the
  9192. * elements of each group: (...group).
  9193. *
  9194. * @static
  9195. * @memberOf _
  9196. * @since 3.8.0
  9197. * @category Array
  9198. * @param {Array} array The array of grouped elements to process.
  9199. * @param {Function} [iteratee=_.identity] The function to combine
  9200. * regrouped values.
  9201. * @returns {Array} Returns the new array of regrouped elements.
  9202. * @example
  9203. *
  9204. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9205. * // => [[1, 10, 100], [2, 20, 200]]
  9206. *
  9207. * _.unzipWith(zipped, _.add);
  9208. * // => [3, 30, 300]
  9209. */
  9210. function unzipWith(array, iteratee) {
  9211. if (!(array && array.length)) {
  9212. return [];
  9213. }
  9214. var result = unzip(array);
  9215. if (iteratee == null) {
  9216. return result;
  9217. }
  9218. return arrayMap(result, function(group) {
  9219. return apply(iteratee, undefined, group);
  9220. });
  9221. }
  9222. /**
  9223. * Creates an array excluding all given values using
  9224. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9225. * for equality comparisons.
  9226. *
  9227. * **Note:** Unlike `_.pull`, this method returns a new array.
  9228. *
  9229. * @static
  9230. * @memberOf _
  9231. * @since 0.1.0
  9232. * @category Array
  9233. * @param {Array} array The array to inspect.
  9234. * @param {...*} [values] The values to exclude.
  9235. * @returns {Array} Returns the new array of filtered values.
  9236. * @see _.difference, _.xor
  9237. * @example
  9238. *
  9239. * _.without([2, 1, 2, 3], 1, 2);
  9240. * // => [3]
  9241. */
  9242. var without = baseRest(function(array, values) {
  9243. return isArrayLikeObject(array)
  9244. ? baseDifference(array, values)
  9245. : [];
  9246. });
  9247. /**
  9248. * Creates an array of unique values that is the
  9249. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9250. * of the given arrays. The order of result values is determined by the order
  9251. * they occur in the arrays.
  9252. *
  9253. * @static
  9254. * @memberOf _
  9255. * @since 2.4.0
  9256. * @category Array
  9257. * @param {...Array} [arrays] The arrays to inspect.
  9258. * @returns {Array} Returns the new array of filtered values.
  9259. * @see _.difference, _.without
  9260. * @example
  9261. *
  9262. * _.xor([2, 1], [2, 3]);
  9263. * // => [1, 3]
  9264. */
  9265. var xor = baseRest(function(arrays) {
  9266. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9267. });
  9268. /**
  9269. * This method is like `_.xor` except that it accepts `iteratee` which is
  9270. * invoked for each element of each `arrays` to generate the criterion by
  9271. * which by which they're compared. The order of result values is determined
  9272. * by the order they occur in the arrays. The iteratee is invoked with one
  9273. * argument: (value).
  9274. *
  9275. * @static
  9276. * @memberOf _
  9277. * @since 4.0.0
  9278. * @category Array
  9279. * @param {...Array} [arrays] The arrays to inspect.
  9280. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9281. * @returns {Array} Returns the new array of filtered values.
  9282. * @example
  9283. *
  9284. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9285. * // => [1.2, 3.4]
  9286. *
  9287. * // The `_.property` iteratee shorthand.
  9288. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9289. * // => [{ 'x': 2 }]
  9290. */
  9291. var xorBy = baseRest(function(arrays) {
  9292. var iteratee = last(arrays);
  9293. if (isArrayLikeObject(iteratee)) {
  9294. iteratee = undefined;
  9295. }
  9296. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9297. });
  9298. /**
  9299. * This method is like `_.xor` except that it accepts `comparator` which is
  9300. * invoked to compare elements of `arrays`. The order of result values is
  9301. * determined by the order they occur in the arrays. The comparator is invoked
  9302. * with two arguments: (arrVal, othVal).
  9303. *
  9304. * @static
  9305. * @memberOf _
  9306. * @since 4.0.0
  9307. * @category Array
  9308. * @param {...Array} [arrays] The arrays to inspect.
  9309. * @param {Function} [comparator] The comparator invoked per element.
  9310. * @returns {Array} Returns the new array of filtered values.
  9311. * @example
  9312. *
  9313. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9314. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9315. *
  9316. * _.xorWith(objects, others, _.isEqual);
  9317. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9318. */
  9319. var xorWith = baseRest(function(arrays) {
  9320. var comparator = last(arrays);
  9321. comparator = typeof comparator == 'function' ? comparator : undefined;
  9322. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9323. });
  9324. /**
  9325. * Creates an array of grouped elements, the first of which contains the
  9326. * first elements of the given arrays, the second of which contains the
  9327. * second elements of the given arrays, and so on.
  9328. *
  9329. * @static
  9330. * @memberOf _
  9331. * @since 0.1.0
  9332. * @category Array
  9333. * @param {...Array} [arrays] The arrays to process.
  9334. * @returns {Array} Returns the new array of grouped elements.
  9335. * @example
  9336. *
  9337. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9338. * // => [['a', 1, true], ['b', 2, false]]
  9339. */
  9340. var zip = baseRest(unzip);
  9341. /**
  9342. * This method is like `_.fromPairs` except that it accepts two arrays,
  9343. * one of property identifiers and one of corresponding values.
  9344. *
  9345. * @static
  9346. * @memberOf _
  9347. * @since 0.4.0
  9348. * @category Array
  9349. * @param {Array} [props=[]] The property identifiers.
  9350. * @param {Array} [values=[]] The property values.
  9351. * @returns {Object} Returns the new object.
  9352. * @example
  9353. *
  9354. * _.zipObject(['a', 'b'], [1, 2]);
  9355. * // => { 'a': 1, 'b': 2 }
  9356. */
  9357. function zipObject(props, values) {
  9358. return baseZipObject(props || [], values || [], assignValue);
  9359. }
  9360. /**
  9361. * This method is like `_.zipObject` except that it supports property paths.
  9362. *
  9363. * @static
  9364. * @memberOf _
  9365. * @since 4.1.0
  9366. * @category Array
  9367. * @param {Array} [props=[]] The property identifiers.
  9368. * @param {Array} [values=[]] The property values.
  9369. * @returns {Object} Returns the new object.
  9370. * @example
  9371. *
  9372. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9373. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9374. */
  9375. function zipObjectDeep(props, values) {
  9376. return baseZipObject(props || [], values || [], baseSet);
  9377. }
  9378. /**
  9379. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9380. * how grouped values should be combined. The iteratee is invoked with the
  9381. * elements of each group: (...group).
  9382. *
  9383. * @static
  9384. * @memberOf _
  9385. * @since 3.8.0
  9386. * @category Array
  9387. * @param {...Array} [arrays] The arrays to process.
  9388. * @param {Function} [iteratee=_.identity] The function to combine
  9389. * grouped values.
  9390. * @returns {Array} Returns the new array of grouped elements.
  9391. * @example
  9392. *
  9393. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9394. * return a + b + c;
  9395. * });
  9396. * // => [111, 222]
  9397. */
  9398. var zipWith = baseRest(function(arrays) {
  9399. var length = arrays.length,
  9400. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9401. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9402. return unzipWith(arrays, iteratee);
  9403. });
  9404. /*------------------------------------------------------------------------*/
  9405. /**
  9406. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9407. * chain sequences enabled. The result of such sequences must be unwrapped
  9408. * with `_#value`.
  9409. *
  9410. * @static
  9411. * @memberOf _
  9412. * @since 1.3.0
  9413. * @category Seq
  9414. * @param {*} value The value to wrap.
  9415. * @returns {Object} Returns the new `lodash` wrapper instance.
  9416. * @example
  9417. *
  9418. * var users = [
  9419. * { 'user': 'barney', 'age': 36 },
  9420. * { 'user': 'fred', 'age': 40 },
  9421. * { 'user': 'pebbles', 'age': 1 }
  9422. * ];
  9423. *
  9424. * var youngest = _
  9425. * .chain(users)
  9426. * .sortBy('age')
  9427. * .map(function(o) {
  9428. * return o.user + ' is ' + o.age;
  9429. * })
  9430. * .head()
  9431. * .value();
  9432. * // => 'pebbles is 1'
  9433. */
  9434. function chain(value) {
  9435. var result = lodash(value);
  9436. result.__chain__ = true;
  9437. return result;
  9438. }
  9439. /**
  9440. * This method invokes `interceptor` and returns `value`. The interceptor
  9441. * is invoked with one argument; (value). The purpose of this method is to
  9442. * "tap into" a method chain sequence in order to modify intermediate results.
  9443. *
  9444. * @static
  9445. * @memberOf _
  9446. * @since 0.1.0
  9447. * @category Seq
  9448. * @param {*} value The value to provide to `interceptor`.
  9449. * @param {Function} interceptor The function to invoke.
  9450. * @returns {*} Returns `value`.
  9451. * @example
  9452. *
  9453. * _([1, 2, 3])
  9454. * .tap(function(array) {
  9455. * // Mutate input array.
  9456. * array.pop();
  9457. * })
  9458. * .reverse()
  9459. * .value();
  9460. * // => [2, 1]
  9461. */
  9462. function tap(value, interceptor) {
  9463. interceptor(value);
  9464. return value;
  9465. }
  9466. /**
  9467. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9468. * The purpose of this method is to "pass thru" values replacing intermediate
  9469. * results in a method chain sequence.
  9470. *
  9471. * @static
  9472. * @memberOf _
  9473. * @since 3.0.0
  9474. * @category Seq
  9475. * @param {*} value The value to provide to `interceptor`.
  9476. * @param {Function} interceptor The function to invoke.
  9477. * @returns {*} Returns the result of `interceptor`.
  9478. * @example
  9479. *
  9480. * _(' abc ')
  9481. * .chain()
  9482. * .trim()
  9483. * .thru(function(value) {
  9484. * return [value];
  9485. * })
  9486. * .value();
  9487. * // => ['abc']
  9488. */
  9489. function thru(value, interceptor) {
  9490. return interceptor(value);
  9491. }
  9492. /**
  9493. * This method is the wrapper version of `_.at`.
  9494. *
  9495. * @name at
  9496. * @memberOf _
  9497. * @since 1.0.0
  9498. * @category Seq
  9499. * @param {...(string|string[])} [paths] The property paths to pick.
  9500. * @returns {Object} Returns the new `lodash` wrapper instance.
  9501. * @example
  9502. *
  9503. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9504. *
  9505. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9506. * // => [3, 4]
  9507. */
  9508. var wrapperAt = flatRest(function(paths) {
  9509. var length = paths.length,
  9510. start = length ? paths[0] : 0,
  9511. value = this.__wrapped__,
  9512. interceptor = function(object) { return baseAt(object, paths); };
  9513. if (length > 1 || this.__actions__.length ||
  9514. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9515. return this.thru(interceptor);
  9516. }
  9517. value = value.slice(start, +start + (length ? 1 : 0));
  9518. value.__actions__.push({
  9519. 'func': thru,
  9520. 'args': [interceptor],
  9521. 'thisArg': undefined
  9522. });
  9523. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9524. if (length && !array.length) {
  9525. array.push(undefined);
  9526. }
  9527. return array;
  9528. });
  9529. });
  9530. /**
  9531. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9532. *
  9533. * @name chain
  9534. * @memberOf _
  9535. * @since 0.1.0
  9536. * @category Seq
  9537. * @returns {Object} Returns the new `lodash` wrapper instance.
  9538. * @example
  9539. *
  9540. * var users = [
  9541. * { 'user': 'barney', 'age': 36 },
  9542. * { 'user': 'fred', 'age': 40 }
  9543. * ];
  9544. *
  9545. * // A sequence without explicit chaining.
  9546. * _(users).head();
  9547. * // => { 'user': 'barney', 'age': 36 }
  9548. *
  9549. * // A sequence with explicit chaining.
  9550. * _(users)
  9551. * .chain()
  9552. * .head()
  9553. * .pick('user')
  9554. * .value();
  9555. * // => { 'user': 'barney' }
  9556. */
  9557. function wrapperChain() {
  9558. return chain(this);
  9559. }
  9560. /**
  9561. * Executes the chain sequence and returns the wrapped result.
  9562. *
  9563. * @name commit
  9564. * @memberOf _
  9565. * @since 3.2.0
  9566. * @category Seq
  9567. * @returns {Object} Returns the new `lodash` wrapper instance.
  9568. * @example
  9569. *
  9570. * var array = [1, 2];
  9571. * var wrapped = _(array).push(3);
  9572. *
  9573. * console.log(array);
  9574. * // => [1, 2]
  9575. *
  9576. * wrapped = wrapped.commit();
  9577. * console.log(array);
  9578. * // => [1, 2, 3]
  9579. *
  9580. * wrapped.last();
  9581. * // => 3
  9582. *
  9583. * console.log(array);
  9584. * // => [1, 2, 3]
  9585. */
  9586. function wrapperCommit() {
  9587. return new LodashWrapper(this.value(), this.__chain__);
  9588. }
  9589. /**
  9590. * Gets the next value on a wrapped object following the
  9591. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9592. *
  9593. * @name next
  9594. * @memberOf _
  9595. * @since 4.0.0
  9596. * @category Seq
  9597. * @returns {Object} Returns the next iterator value.
  9598. * @example
  9599. *
  9600. * var wrapped = _([1, 2]);
  9601. *
  9602. * wrapped.next();
  9603. * // => { 'done': false, 'value': 1 }
  9604. *
  9605. * wrapped.next();
  9606. * // => { 'done': false, 'value': 2 }
  9607. *
  9608. * wrapped.next();
  9609. * // => { 'done': true, 'value': undefined }
  9610. */
  9611. function wrapperNext() {
  9612. if (this.__values__ === undefined) {
  9613. this.__values__ = toArray(this.value());
  9614. }
  9615. var done = this.__index__ >= this.__values__.length,
  9616. value = done ? undefined : this.__values__[this.__index__++];
  9617. return { 'done': done, 'value': value };
  9618. }
  9619. /**
  9620. * Enables the wrapper to be iterable.
  9621. *
  9622. * @name Symbol.iterator
  9623. * @memberOf _
  9624. * @since 4.0.0
  9625. * @category Seq
  9626. * @returns {Object} Returns the wrapper object.
  9627. * @example
  9628. *
  9629. * var wrapped = _([1, 2]);
  9630. *
  9631. * wrapped[Symbol.iterator]() === wrapped;
  9632. * // => true
  9633. *
  9634. * Array.from(wrapped);
  9635. * // => [1, 2]
  9636. */
  9637. function wrapperToIterator() {
  9638. return this;
  9639. }
  9640. /**
  9641. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9642. *
  9643. * @name plant
  9644. * @memberOf _
  9645. * @since 3.2.0
  9646. * @category Seq
  9647. * @param {*} value The value to plant.
  9648. * @returns {Object} Returns the new `lodash` wrapper instance.
  9649. * @example
  9650. *
  9651. * function square(n) {
  9652. * return n * n;
  9653. * }
  9654. *
  9655. * var wrapped = _([1, 2]).map(square);
  9656. * var other = wrapped.plant([3, 4]);
  9657. *
  9658. * other.value();
  9659. * // => [9, 16]
  9660. *
  9661. * wrapped.value();
  9662. * // => [1, 4]
  9663. */
  9664. function wrapperPlant(value) {
  9665. var result,
  9666. parent = this;
  9667. while (parent instanceof baseLodash) {
  9668. var clone = wrapperClone(parent);
  9669. clone.__index__ = 0;
  9670. clone.__values__ = undefined;
  9671. if (result) {
  9672. previous.__wrapped__ = clone;
  9673. } else {
  9674. result = clone;
  9675. }
  9676. var previous = clone;
  9677. parent = parent.__wrapped__;
  9678. }
  9679. previous.__wrapped__ = value;
  9680. return result;
  9681. }
  9682. /**
  9683. * This method is the wrapper version of `_.reverse`.
  9684. *
  9685. * **Note:** This method mutates the wrapped array.
  9686. *
  9687. * @name reverse
  9688. * @memberOf _
  9689. * @since 0.1.0
  9690. * @category Seq
  9691. * @returns {Object} Returns the new `lodash` wrapper instance.
  9692. * @example
  9693. *
  9694. * var array = [1, 2, 3];
  9695. *
  9696. * _(array).reverse().value()
  9697. * // => [3, 2, 1]
  9698. *
  9699. * console.log(array);
  9700. * // => [3, 2, 1]
  9701. */
  9702. function wrapperReverse() {
  9703. var value = this.__wrapped__;
  9704. if (value instanceof LazyWrapper) {
  9705. var wrapped = value;
  9706. if (this.__actions__.length) {
  9707. wrapped = new LazyWrapper(this);
  9708. }
  9709. wrapped = wrapped.reverse();
  9710. wrapped.__actions__.push({
  9711. 'func': thru,
  9712. 'args': [reverse],
  9713. 'thisArg': undefined
  9714. });
  9715. return new LodashWrapper(wrapped, this.__chain__);
  9716. }
  9717. return this.thru(reverse);
  9718. }
  9719. /**
  9720. * Executes the chain sequence to resolve the unwrapped value.
  9721. *
  9722. * @name value
  9723. * @memberOf _
  9724. * @since 0.1.0
  9725. * @alias toJSON, valueOf
  9726. * @category Seq
  9727. * @returns {*} Returns the resolved unwrapped value.
  9728. * @example
  9729. *
  9730. * _([1, 2, 3]).value();
  9731. * // => [1, 2, 3]
  9732. */
  9733. function wrapperValue() {
  9734. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9735. }
  9736. /*------------------------------------------------------------------------*/
  9737. /**
  9738. * Creates an object composed of keys generated from the results of running
  9739. * each element of `collection` thru `iteratee`. The corresponding value of
  9740. * each key is the number of times the key was returned by `iteratee`. The
  9741. * iteratee is invoked with one argument: (value).
  9742. *
  9743. * @static
  9744. * @memberOf _
  9745. * @since 0.5.0
  9746. * @category Collection
  9747. * @param {Array|Object} collection The collection to iterate over.
  9748. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9749. * @returns {Object} Returns the composed aggregate object.
  9750. * @example
  9751. *
  9752. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9753. * // => { '4': 1, '6': 2 }
  9754. *
  9755. * // The `_.property` iteratee shorthand.
  9756. * _.countBy(['one', 'two', 'three'], 'length');
  9757. * // => { '3': 2, '5': 1 }
  9758. */
  9759. var countBy = createAggregator(function(result, value, key) {
  9760. if (hasOwnProperty.call(result, key)) {
  9761. ++result[key];
  9762. } else {
  9763. baseAssignValue(result, key, 1);
  9764. }
  9765. });
  9766. /**
  9767. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9768. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9769. * invoked with three arguments: (value, index|key, collection).
  9770. *
  9771. * **Note:** This method returns `true` for
  9772. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9773. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9774. * elements of empty collections.
  9775. *
  9776. * @static
  9777. * @memberOf _
  9778. * @since 0.1.0
  9779. * @category Collection
  9780. * @param {Array|Object} collection The collection to iterate over.
  9781. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9782. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9783. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9784. * else `false`.
  9785. * @example
  9786. *
  9787. * _.every([true, 1, null, 'yes'], Boolean);
  9788. * // => false
  9789. *
  9790. * var users = [
  9791. * { 'user': 'barney', 'age': 36, 'active': false },
  9792. * { 'user': 'fred', 'age': 40, 'active': false }
  9793. * ];
  9794. *
  9795. * // The `_.matches` iteratee shorthand.
  9796. * _.every(users, { 'user': 'barney', 'active': false });
  9797. * // => false
  9798. *
  9799. * // The `_.matchesProperty` iteratee shorthand.
  9800. * _.every(users, ['active', false]);
  9801. * // => true
  9802. *
  9803. * // The `_.property` iteratee shorthand.
  9804. * _.every(users, 'active');
  9805. * // => false
  9806. */
  9807. function every(collection, predicate, guard) {
  9808. var func = isArray(collection) ? arrayEvery : baseEvery;
  9809. if (guard && isIterateeCall(collection, predicate, guard)) {
  9810. predicate = undefined;
  9811. }
  9812. return func(collection, getIteratee(predicate, 3));
  9813. }
  9814. /**
  9815. * Iterates over elements of `collection`, returning an array of all elements
  9816. * `predicate` returns truthy for. The predicate is invoked with three
  9817. * arguments: (value, index|key, collection).
  9818. *
  9819. * **Note:** Unlike `_.remove`, this method returns a new array.
  9820. *
  9821. * @static
  9822. * @memberOf _
  9823. * @since 0.1.0
  9824. * @category Collection
  9825. * @param {Array|Object} collection The collection to iterate over.
  9826. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9827. * @returns {Array} Returns the new filtered array.
  9828. * @see _.reject
  9829. * @example
  9830. *
  9831. * var users = [
  9832. * { 'user': 'barney', 'age': 36, 'active': true },
  9833. * { 'user': 'fred', 'age': 40, 'active': false }
  9834. * ];
  9835. *
  9836. * _.filter(users, function(o) { return !o.active; });
  9837. * // => objects for ['fred']
  9838. *
  9839. * // The `_.matches` iteratee shorthand.
  9840. * _.filter(users, { 'age': 36, 'active': true });
  9841. * // => objects for ['barney']
  9842. *
  9843. * // The `_.matchesProperty` iteratee shorthand.
  9844. * _.filter(users, ['active', false]);
  9845. * // => objects for ['fred']
  9846. *
  9847. * // The `_.property` iteratee shorthand.
  9848. * _.filter(users, 'active');
  9849. * // => objects for ['barney']
  9850. *
  9851. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9852. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9853. * // => objects for ['fred', 'barney']
  9854. */
  9855. function filter(collection, predicate) {
  9856. var func = isArray(collection) ? arrayFilter : baseFilter;
  9857. return func(collection, getIteratee(predicate, 3));
  9858. }
  9859. /**
  9860. * Iterates over elements of `collection`, returning the first element
  9861. * `predicate` returns truthy for. The predicate is invoked with three
  9862. * arguments: (value, index|key, collection).
  9863. *
  9864. * @static
  9865. * @memberOf _
  9866. * @since 0.1.0
  9867. * @category Collection
  9868. * @param {Array|Object} collection The collection to inspect.
  9869. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9870. * @param {number} [fromIndex=0] The index to search from.
  9871. * @returns {*} Returns the matched element, else `undefined`.
  9872. * @example
  9873. *
  9874. * var users = [
  9875. * { 'user': 'barney', 'age': 36, 'active': true },
  9876. * { 'user': 'fred', 'age': 40, 'active': false },
  9877. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9878. * ];
  9879. *
  9880. * _.find(users, function(o) { return o.age < 40; });
  9881. * // => object for 'barney'
  9882. *
  9883. * // The `_.matches` iteratee shorthand.
  9884. * _.find(users, { 'age': 1, 'active': true });
  9885. * // => object for 'pebbles'
  9886. *
  9887. * // The `_.matchesProperty` iteratee shorthand.
  9888. * _.find(users, ['active', false]);
  9889. * // => object for 'fred'
  9890. *
  9891. * // The `_.property` iteratee shorthand.
  9892. * _.find(users, 'active');
  9893. * // => object for 'barney'
  9894. */
  9895. var find = createFind(findIndex);
  9896. /**
  9897. * This method is like `_.find` except that it iterates over elements of
  9898. * `collection` from right to left.
  9899. *
  9900. * @static
  9901. * @memberOf _
  9902. * @since 2.0.0
  9903. * @category Collection
  9904. * @param {Array|Object} collection The collection to inspect.
  9905. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9906. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9907. * @returns {*} Returns the matched element, else `undefined`.
  9908. * @example
  9909. *
  9910. * _.findLast([1, 2, 3, 4], function(n) {
  9911. * return n % 2 == 1;
  9912. * });
  9913. * // => 3
  9914. */
  9915. var findLast = createFind(findLastIndex);
  9916. /**
  9917. * Creates a flattened array of values by running each element in `collection`
  9918. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9919. * with three arguments: (value, index|key, collection).
  9920. *
  9921. * @static
  9922. * @memberOf _
  9923. * @since 4.0.0
  9924. * @category Collection
  9925. * @param {Array|Object} collection The collection to iterate over.
  9926. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9927. * @returns {Array} Returns the new flattened array.
  9928. * @example
  9929. *
  9930. * function duplicate(n) {
  9931. * return [n, n];
  9932. * }
  9933. *
  9934. * _.flatMap([1, 2], duplicate);
  9935. * // => [1, 1, 2, 2]
  9936. */
  9937. function flatMap(collection, iteratee) {
  9938. return baseFlatten(map(collection, iteratee), 1);
  9939. }
  9940. /**
  9941. * This method is like `_.flatMap` except that it recursively flattens the
  9942. * mapped results.
  9943. *
  9944. * @static
  9945. * @memberOf _
  9946. * @since 4.7.0
  9947. * @category Collection
  9948. * @param {Array|Object} collection The collection to iterate over.
  9949. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9950. * @returns {Array} Returns the new flattened array.
  9951. * @example
  9952. *
  9953. * function duplicate(n) {
  9954. * return [[[n, n]]];
  9955. * }
  9956. *
  9957. * _.flatMapDeep([1, 2], duplicate);
  9958. * // => [1, 1, 2, 2]
  9959. */
  9960. function flatMapDeep(collection, iteratee) {
  9961. return baseFlatten(map(collection, iteratee), INFINITY);
  9962. }
  9963. /**
  9964. * This method is like `_.flatMap` except that it recursively flattens the
  9965. * mapped results up to `depth` times.
  9966. *
  9967. * @static
  9968. * @memberOf _
  9969. * @since 4.7.0
  9970. * @category Collection
  9971. * @param {Array|Object} collection The collection to iterate over.
  9972. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9973. * @param {number} [depth=1] The maximum recursion depth.
  9974. * @returns {Array} Returns the new flattened array.
  9975. * @example
  9976. *
  9977. * function duplicate(n) {
  9978. * return [[[n, n]]];
  9979. * }
  9980. *
  9981. * _.flatMapDepth([1, 2], duplicate, 2);
  9982. * // => [[1, 1], [2, 2]]
  9983. */
  9984. function flatMapDepth(collection, iteratee, depth) {
  9985. depth = depth === undefined ? 1 : toInteger(depth);
  9986. return baseFlatten(map(collection, iteratee), depth);
  9987. }
  9988. /**
  9989. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9990. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9991. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9992. *
  9993. * **Note:** As with other "Collections" methods, objects with a "length"
  9994. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9995. * or `_.forOwn` for object iteration.
  9996. *
  9997. * @static
  9998. * @memberOf _
  9999. * @since 0.1.0
  10000. * @alias each
  10001. * @category Collection
  10002. * @param {Array|Object} collection The collection to iterate over.
  10003. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10004. * @returns {Array|Object} Returns `collection`.
  10005. * @see _.forEachRight
  10006. * @example
  10007. *
  10008. * _.forEach([1, 2], function(value) {
  10009. * console.log(value);
  10010. * });
  10011. * // => Logs `1` then `2`.
  10012. *
  10013. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10014. * console.log(key);
  10015. * });
  10016. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10017. */
  10018. function forEach(collection, iteratee) {
  10019. var func = isArray(collection) ? arrayEach : baseEach;
  10020. return func(collection, getIteratee(iteratee, 3));
  10021. }
  10022. /**
  10023. * This method is like `_.forEach` except that it iterates over elements of
  10024. * `collection` from right to left.
  10025. *
  10026. * @static
  10027. * @memberOf _
  10028. * @since 2.0.0
  10029. * @alias eachRight
  10030. * @category Collection
  10031. * @param {Array|Object} collection The collection to iterate over.
  10032. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10033. * @returns {Array|Object} Returns `collection`.
  10034. * @see _.forEach
  10035. * @example
  10036. *
  10037. * _.forEachRight([1, 2], function(value) {
  10038. * console.log(value);
  10039. * });
  10040. * // => Logs `2` then `1`.
  10041. */
  10042. function forEachRight(collection, iteratee) {
  10043. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10044. return func(collection, getIteratee(iteratee, 3));
  10045. }
  10046. /**
  10047. * Creates an object composed of keys generated from the results of running
  10048. * each element of `collection` thru `iteratee`. The order of grouped values
  10049. * is determined by the order they occur in `collection`. The corresponding
  10050. * value of each key is an array of elements responsible for generating the
  10051. * key. The iteratee is invoked with one argument: (value).
  10052. *
  10053. * @static
  10054. * @memberOf _
  10055. * @since 0.1.0
  10056. * @category Collection
  10057. * @param {Array|Object} collection The collection to iterate over.
  10058. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10059. * @returns {Object} Returns the composed aggregate object.
  10060. * @example
  10061. *
  10062. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10063. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10064. *
  10065. * // The `_.property` iteratee shorthand.
  10066. * _.groupBy(['one', 'two', 'three'], 'length');
  10067. * // => { '3': ['one', 'two'], '5': ['three'] }
  10068. */
  10069. var groupBy = createAggregator(function(result, value, key) {
  10070. if (hasOwnProperty.call(result, key)) {
  10071. result[key].push(value);
  10072. } else {
  10073. baseAssignValue(result, key, [value]);
  10074. }
  10075. });
  10076. /**
  10077. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10078. * checked for a substring of `value`, otherwise
  10079. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10080. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10081. * the offset from the end of `collection`.
  10082. *
  10083. * @static
  10084. * @memberOf _
  10085. * @since 0.1.0
  10086. * @category Collection
  10087. * @param {Array|Object|string} collection The collection to inspect.
  10088. * @param {*} value The value to search for.
  10089. * @param {number} [fromIndex=0] The index to search from.
  10090. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10091. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10092. * @example
  10093. *
  10094. * _.includes([1, 2, 3], 1);
  10095. * // => true
  10096. *
  10097. * _.includes([1, 2, 3], 1, 2);
  10098. * // => false
  10099. *
  10100. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10101. * // => true
  10102. *
  10103. * _.includes('abcd', 'bc');
  10104. * // => true
  10105. */
  10106. function includes(collection, value, fromIndex, guard) {
  10107. collection = isArrayLike(collection) ? collection : values(collection);
  10108. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10109. var length = collection.length;
  10110. if (fromIndex < 0) {
  10111. fromIndex = nativeMax(length + fromIndex, 0);
  10112. }
  10113. return isString(collection)
  10114. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10115. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10116. }
  10117. /**
  10118. * Invokes the method at `path` of each element in `collection`, returning
  10119. * an array of the results of each invoked method. Any additional arguments
  10120. * are provided to each invoked method. If `path` is a function, it's invoked
  10121. * for, and `this` bound to, each element in `collection`.
  10122. *
  10123. * @static
  10124. * @memberOf _
  10125. * @since 4.0.0
  10126. * @category Collection
  10127. * @param {Array|Object} collection The collection to iterate over.
  10128. * @param {Array|Function|string} path The path of the method to invoke or
  10129. * the function invoked per iteration.
  10130. * @param {...*} [args] The arguments to invoke each method with.
  10131. * @returns {Array} Returns the array of results.
  10132. * @example
  10133. *
  10134. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10135. * // => [[1, 5, 7], [1, 2, 3]]
  10136. *
  10137. * _.invokeMap([123, 456], String.prototype.split, '');
  10138. * // => [['1', '2', '3'], ['4', '5', '6']]
  10139. */
  10140. var invokeMap = baseRest(function(collection, path, args) {
  10141. var index = -1,
  10142. isFunc = typeof path == 'function',
  10143. result = isArrayLike(collection) ? Array(collection.length) : [];
  10144. baseEach(collection, function(value) {
  10145. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10146. });
  10147. return result;
  10148. });
  10149. /**
  10150. * Creates an object composed of keys generated from the results of running
  10151. * each element of `collection` thru `iteratee`. The corresponding value of
  10152. * each key is the last element responsible for generating the key. The
  10153. * iteratee is invoked with one argument: (value).
  10154. *
  10155. * @static
  10156. * @memberOf _
  10157. * @since 4.0.0
  10158. * @category Collection
  10159. * @param {Array|Object} collection The collection to iterate over.
  10160. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10161. * @returns {Object} Returns the composed aggregate object.
  10162. * @example
  10163. *
  10164. * var array = [
  10165. * { 'dir': 'left', 'code': 97 },
  10166. * { 'dir': 'right', 'code': 100 }
  10167. * ];
  10168. *
  10169. * _.keyBy(array, function(o) {
  10170. * return String.fromCharCode(o.code);
  10171. * });
  10172. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10173. *
  10174. * _.keyBy(array, 'dir');
  10175. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10176. */
  10177. var keyBy = createAggregator(function(result, value, key) {
  10178. baseAssignValue(result, key, value);
  10179. });
  10180. /**
  10181. * Creates an array of values by running each element in `collection` thru
  10182. * `iteratee`. The iteratee is invoked with three arguments:
  10183. * (value, index|key, collection).
  10184. *
  10185. * Many lodash methods are guarded to work as iteratees for methods like
  10186. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10187. *
  10188. * The guarded methods are:
  10189. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10190. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10191. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10192. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10193. *
  10194. * @static
  10195. * @memberOf _
  10196. * @since 0.1.0
  10197. * @category Collection
  10198. * @param {Array|Object} collection The collection to iterate over.
  10199. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10200. * @returns {Array} Returns the new mapped array.
  10201. * @example
  10202. *
  10203. * function square(n) {
  10204. * return n * n;
  10205. * }
  10206. *
  10207. * _.map([4, 8], square);
  10208. * // => [16, 64]
  10209. *
  10210. * _.map({ 'a': 4, 'b': 8 }, square);
  10211. * // => [16, 64] (iteration order is not guaranteed)
  10212. *
  10213. * var users = [
  10214. * { 'user': 'barney' },
  10215. * { 'user': 'fred' }
  10216. * ];
  10217. *
  10218. * // The `_.property` iteratee shorthand.
  10219. * _.map(users, 'user');
  10220. * // => ['barney', 'fred']
  10221. */
  10222. function map(collection, iteratee) {
  10223. var func = isArray(collection) ? arrayMap : baseMap;
  10224. return func(collection, getIteratee(iteratee, 3));
  10225. }
  10226. /**
  10227. * This method is like `_.sortBy` except that it allows specifying the sort
  10228. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10229. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10230. * descending or "asc" for ascending sort order of corresponding values.
  10231. *
  10232. * @static
  10233. * @memberOf _
  10234. * @since 4.0.0
  10235. * @category Collection
  10236. * @param {Array|Object} collection The collection to iterate over.
  10237. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10238. * The iteratees to sort by.
  10239. * @param {string[]} [orders] The sort orders of `iteratees`.
  10240. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10241. * @returns {Array} Returns the new sorted array.
  10242. * @example
  10243. *
  10244. * var users = [
  10245. * { 'user': 'fred', 'age': 48 },
  10246. * { 'user': 'barney', 'age': 34 },
  10247. * { 'user': 'fred', 'age': 40 },
  10248. * { 'user': 'barney', 'age': 36 }
  10249. * ];
  10250. *
  10251. * // Sort by `user` in ascending order and by `age` in descending order.
  10252. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10253. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10254. */
  10255. function orderBy(collection, iteratees, orders, guard) {
  10256. if (collection == null) {
  10257. return [];
  10258. }
  10259. if (!isArray(iteratees)) {
  10260. iteratees = iteratees == null ? [] : [iteratees];
  10261. }
  10262. orders = guard ? undefined : orders;
  10263. if (!isArray(orders)) {
  10264. orders = orders == null ? [] : [orders];
  10265. }
  10266. return baseOrderBy(collection, iteratees, orders);
  10267. }
  10268. /**
  10269. * Creates an array of elements split into two groups, the first of which
  10270. * contains elements `predicate` returns truthy for, the second of which
  10271. * contains elements `predicate` returns falsey for. The predicate is
  10272. * invoked with one argument: (value).
  10273. *
  10274. * @static
  10275. * @memberOf _
  10276. * @since 3.0.0
  10277. * @category Collection
  10278. * @param {Array|Object} collection The collection to iterate over.
  10279. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10280. * @returns {Array} Returns the array of grouped elements.
  10281. * @example
  10282. *
  10283. * var users = [
  10284. * { 'user': 'barney', 'age': 36, 'active': false },
  10285. * { 'user': 'fred', 'age': 40, 'active': true },
  10286. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10287. * ];
  10288. *
  10289. * _.partition(users, function(o) { return o.active; });
  10290. * // => objects for [['fred'], ['barney', 'pebbles']]
  10291. *
  10292. * // The `_.matches` iteratee shorthand.
  10293. * _.partition(users, { 'age': 1, 'active': false });
  10294. * // => objects for [['pebbles'], ['barney', 'fred']]
  10295. *
  10296. * // The `_.matchesProperty` iteratee shorthand.
  10297. * _.partition(users, ['active', false]);
  10298. * // => objects for [['barney', 'pebbles'], ['fred']]
  10299. *
  10300. * // The `_.property` iteratee shorthand.
  10301. * _.partition(users, 'active');
  10302. * // => objects for [['fred'], ['barney', 'pebbles']]
  10303. */
  10304. var partition = createAggregator(function(result, value, key) {
  10305. result[key ? 0 : 1].push(value);
  10306. }, function() { return [[], []]; });
  10307. /**
  10308. * Reduces `collection` to a value which is the accumulated result of running
  10309. * each element in `collection` thru `iteratee`, where each successive
  10310. * invocation is supplied the return value of the previous. If `accumulator`
  10311. * is not given, the first element of `collection` is used as the initial
  10312. * value. The iteratee is invoked with four arguments:
  10313. * (accumulator, value, index|key, collection).
  10314. *
  10315. * Many lodash methods are guarded to work as iteratees for methods like
  10316. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10317. *
  10318. * The guarded methods are:
  10319. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10320. * and `sortBy`
  10321. *
  10322. * @static
  10323. * @memberOf _
  10324. * @since 0.1.0
  10325. * @category Collection
  10326. * @param {Array|Object} collection The collection to iterate over.
  10327. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10328. * @param {*} [accumulator] The initial value.
  10329. * @returns {*} Returns the accumulated value.
  10330. * @see _.reduceRight
  10331. * @example
  10332. *
  10333. * _.reduce([1, 2], function(sum, n) {
  10334. * return sum + n;
  10335. * }, 0);
  10336. * // => 3
  10337. *
  10338. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10339. * (result[value] || (result[value] = [])).push(key);
  10340. * return result;
  10341. * }, {});
  10342. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10343. */
  10344. function reduce(collection, iteratee, accumulator) {
  10345. var func = isArray(collection) ? arrayReduce : baseReduce,
  10346. initAccum = arguments.length < 3;
  10347. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10348. }
  10349. /**
  10350. * This method is like `_.reduce` except that it iterates over elements of
  10351. * `collection` from right to left.
  10352. *
  10353. * @static
  10354. * @memberOf _
  10355. * @since 0.1.0
  10356. * @category Collection
  10357. * @param {Array|Object} collection The collection to iterate over.
  10358. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10359. * @param {*} [accumulator] The initial value.
  10360. * @returns {*} Returns the accumulated value.
  10361. * @see _.reduce
  10362. * @example
  10363. *
  10364. * var array = [[0, 1], [2, 3], [4, 5]];
  10365. *
  10366. * _.reduceRight(array, function(flattened, other) {
  10367. * return flattened.concat(other);
  10368. * }, []);
  10369. * // => [4, 5, 2, 3, 0, 1]
  10370. */
  10371. function reduceRight(collection, iteratee, accumulator) {
  10372. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10373. initAccum = arguments.length < 3;
  10374. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10375. }
  10376. /**
  10377. * The opposite of `_.filter`; this method returns the elements of `collection`
  10378. * that `predicate` does **not** return truthy for.
  10379. *
  10380. * @static
  10381. * @memberOf _
  10382. * @since 0.1.0
  10383. * @category Collection
  10384. * @param {Array|Object} collection The collection to iterate over.
  10385. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10386. * @returns {Array} Returns the new filtered array.
  10387. * @see _.filter
  10388. * @example
  10389. *
  10390. * var users = [
  10391. * { 'user': 'barney', 'age': 36, 'active': false },
  10392. * { 'user': 'fred', 'age': 40, 'active': true }
  10393. * ];
  10394. *
  10395. * _.reject(users, function(o) { return !o.active; });
  10396. * // => objects for ['fred']
  10397. *
  10398. * // The `_.matches` iteratee shorthand.
  10399. * _.reject(users, { 'age': 40, 'active': true });
  10400. * // => objects for ['barney']
  10401. *
  10402. * // The `_.matchesProperty` iteratee shorthand.
  10403. * _.reject(users, ['active', false]);
  10404. * // => objects for ['fred']
  10405. *
  10406. * // The `_.property` iteratee shorthand.
  10407. * _.reject(users, 'active');
  10408. * // => objects for ['barney']
  10409. */
  10410. function reject(collection, predicate) {
  10411. var func = isArray(collection) ? arrayFilter : baseFilter;
  10412. return func(collection, negate(getIteratee(predicate, 3)));
  10413. }
  10414. /**
  10415. * Gets a random element from `collection`.
  10416. *
  10417. * @static
  10418. * @memberOf _
  10419. * @since 2.0.0
  10420. * @category Collection
  10421. * @param {Array|Object} collection The collection to sample.
  10422. * @returns {*} Returns the random element.
  10423. * @example
  10424. *
  10425. * _.sample([1, 2, 3, 4]);
  10426. * // => 2
  10427. */
  10428. function sample(collection) {
  10429. var func = isArray(collection) ? arraySample : baseSample;
  10430. return func(collection);
  10431. }
  10432. /**
  10433. * Gets `n` random elements at unique keys from `collection` up to the
  10434. * size of `collection`.
  10435. *
  10436. * @static
  10437. * @memberOf _
  10438. * @since 4.0.0
  10439. * @category Collection
  10440. * @param {Array|Object} collection The collection to sample.
  10441. * @param {number} [n=1] The number of elements to sample.
  10442. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10443. * @returns {Array} Returns the random elements.
  10444. * @example
  10445. *
  10446. * _.sampleSize([1, 2, 3], 2);
  10447. * // => [3, 1]
  10448. *
  10449. * _.sampleSize([1, 2, 3], 4);
  10450. * // => [2, 3, 1]
  10451. */
  10452. function sampleSize(collection, n, guard) {
  10453. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10454. n = 1;
  10455. } else {
  10456. n = toInteger(n);
  10457. }
  10458. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10459. return func(collection, n);
  10460. }
  10461. /**
  10462. * Creates an array of shuffled values, using a version of the
  10463. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10464. *
  10465. * @static
  10466. * @memberOf _
  10467. * @since 0.1.0
  10468. * @category Collection
  10469. * @param {Array|Object} collection The collection to shuffle.
  10470. * @returns {Array} Returns the new shuffled array.
  10471. * @example
  10472. *
  10473. * _.shuffle([1, 2, 3, 4]);
  10474. * // => [4, 1, 3, 2]
  10475. */
  10476. function shuffle(collection) {
  10477. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10478. return func(collection);
  10479. }
  10480. /**
  10481. * Gets the size of `collection` by returning its length for array-like
  10482. * values or the number of own enumerable string keyed properties for objects.
  10483. *
  10484. * @static
  10485. * @memberOf _
  10486. * @since 0.1.0
  10487. * @category Collection
  10488. * @param {Array|Object|string} collection The collection to inspect.
  10489. * @returns {number} Returns the collection size.
  10490. * @example
  10491. *
  10492. * _.size([1, 2, 3]);
  10493. * // => 3
  10494. *
  10495. * _.size({ 'a': 1, 'b': 2 });
  10496. * // => 2
  10497. *
  10498. * _.size('pebbles');
  10499. * // => 7
  10500. */
  10501. function size(collection) {
  10502. if (collection == null) {
  10503. return 0;
  10504. }
  10505. if (isArrayLike(collection)) {
  10506. return isString(collection) ? stringSize(collection) : collection.length;
  10507. }
  10508. var tag = getTag(collection);
  10509. if (tag == mapTag || tag == setTag) {
  10510. return collection.size;
  10511. }
  10512. return baseKeys(collection).length;
  10513. }
  10514. /**
  10515. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10516. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10517. * invoked with three arguments: (value, index|key, collection).
  10518. *
  10519. * @static
  10520. * @memberOf _
  10521. * @since 0.1.0
  10522. * @category Collection
  10523. * @param {Array|Object} collection The collection to iterate over.
  10524. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10525. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10526. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10527. * else `false`.
  10528. * @example
  10529. *
  10530. * _.some([null, 0, 'yes', false], Boolean);
  10531. * // => true
  10532. *
  10533. * var users = [
  10534. * { 'user': 'barney', 'active': true },
  10535. * { 'user': 'fred', 'active': false }
  10536. * ];
  10537. *
  10538. * // The `_.matches` iteratee shorthand.
  10539. * _.some(users, { 'user': 'barney', 'active': false });
  10540. * // => false
  10541. *
  10542. * // The `_.matchesProperty` iteratee shorthand.
  10543. * _.some(users, ['active', false]);
  10544. * // => true
  10545. *
  10546. * // The `_.property` iteratee shorthand.
  10547. * _.some(users, 'active');
  10548. * // => true
  10549. */
  10550. function some(collection, predicate, guard) {
  10551. var func = isArray(collection) ? arraySome : baseSome;
  10552. if (guard && isIterateeCall(collection, predicate, guard)) {
  10553. predicate = undefined;
  10554. }
  10555. return func(collection, getIteratee(predicate, 3));
  10556. }
  10557. /**
  10558. * Creates an array of elements, sorted in ascending order by the results of
  10559. * running each element in a collection thru each iteratee. This method
  10560. * performs a stable sort, that is, it preserves the original sort order of
  10561. * equal elements. The iteratees are invoked with one argument: (value).
  10562. *
  10563. * @static
  10564. * @memberOf _
  10565. * @since 0.1.0
  10566. * @category Collection
  10567. * @param {Array|Object} collection The collection to iterate over.
  10568. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10569. * The iteratees to sort by.
  10570. * @returns {Array} Returns the new sorted array.
  10571. * @example
  10572. *
  10573. * var users = [
  10574. * { 'user': 'fred', 'age': 48 },
  10575. * { 'user': 'barney', 'age': 36 },
  10576. * { 'user': 'fred', 'age': 30 },
  10577. * { 'user': 'barney', 'age': 34 }
  10578. * ];
  10579. *
  10580. * _.sortBy(users, [function(o) { return o.user; }]);
  10581. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10582. *
  10583. * _.sortBy(users, ['user', 'age']);
  10584. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10585. */
  10586. var sortBy = baseRest(function(collection, iteratees) {
  10587. if (collection == null) {
  10588. return [];
  10589. }
  10590. var length = iteratees.length;
  10591. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10592. iteratees = [];
  10593. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10594. iteratees = [iteratees[0]];
  10595. }
  10596. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10597. });
  10598. /*------------------------------------------------------------------------*/
  10599. /**
  10600. * Gets the timestamp of the number of milliseconds that have elapsed since
  10601. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10602. *
  10603. * @static
  10604. * @memberOf _
  10605. * @since 2.4.0
  10606. * @category Date
  10607. * @returns {number} Returns the timestamp.
  10608. * @example
  10609. *
  10610. * _.defer(function(stamp) {
  10611. * console.log(_.now() - stamp);
  10612. * }, _.now());
  10613. * // => Logs the number of milliseconds it took for the deferred invocation.
  10614. */
  10615. var now = ctxNow || function() {
  10616. return root.Date.now();
  10617. };
  10618. /*------------------------------------------------------------------------*/
  10619. /**
  10620. * The opposite of `_.before`; this method creates a function that invokes
  10621. * `func` once it's called `n` or more times.
  10622. *
  10623. * @static
  10624. * @memberOf _
  10625. * @since 0.1.0
  10626. * @category Function
  10627. * @param {number} n The number of calls before `func` is invoked.
  10628. * @param {Function} func The function to restrict.
  10629. * @returns {Function} Returns the new restricted function.
  10630. * @example
  10631. *
  10632. * var saves = ['profile', 'settings'];
  10633. *
  10634. * var done = _.after(saves.length, function() {
  10635. * console.log('done saving!');
  10636. * });
  10637. *
  10638. * _.forEach(saves, function(type) {
  10639. * asyncSave({ 'type': type, 'complete': done });
  10640. * });
  10641. * // => Logs 'done saving!' after the two async saves have completed.
  10642. */
  10643. function after(n, func) {
  10644. if (typeof func != 'function') {
  10645. throw new TypeError(FUNC_ERROR_TEXT);
  10646. }
  10647. n = toInteger(n);
  10648. return function() {
  10649. if (--n < 1) {
  10650. return func.apply(this, arguments);
  10651. }
  10652. };
  10653. }
  10654. /**
  10655. * Creates a function that invokes `func`, with up to `n` arguments,
  10656. * ignoring any additional arguments.
  10657. *
  10658. * @static
  10659. * @memberOf _
  10660. * @since 3.0.0
  10661. * @category Function
  10662. * @param {Function} func The function to cap arguments for.
  10663. * @param {number} [n=func.length] The arity cap.
  10664. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10665. * @returns {Function} Returns the new capped function.
  10666. * @example
  10667. *
  10668. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10669. * // => [6, 8, 10]
  10670. */
  10671. function ary(func, n, guard) {
  10672. n = guard ? undefined : n;
  10673. n = (func && n == null) ? func.length : n;
  10674. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10675. }
  10676. /**
  10677. * Creates a function that invokes `func`, with the `this` binding and arguments
  10678. * of the created function, while it's called less than `n` times. Subsequent
  10679. * calls to the created function return the result of the last `func` invocation.
  10680. *
  10681. * @static
  10682. * @memberOf _
  10683. * @since 3.0.0
  10684. * @category Function
  10685. * @param {number} n The number of calls at which `func` is no longer invoked.
  10686. * @param {Function} func The function to restrict.
  10687. * @returns {Function} Returns the new restricted function.
  10688. * @example
  10689. *
  10690. * jQuery(element).on('click', _.before(5, addContactToList));
  10691. * // => Allows adding up to 4 contacts to the list.
  10692. */
  10693. function before(n, func) {
  10694. var result;
  10695. if (typeof func != 'function') {
  10696. throw new TypeError(FUNC_ERROR_TEXT);
  10697. }
  10698. n = toInteger(n);
  10699. return function() {
  10700. if (--n > 0) {
  10701. result = func.apply(this, arguments);
  10702. }
  10703. if (n <= 1) {
  10704. func = undefined;
  10705. }
  10706. return result;
  10707. };
  10708. }
  10709. /**
  10710. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10711. * and `partials` prepended to the arguments it receives.
  10712. *
  10713. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10714. * may be used as a placeholder for partially applied arguments.
  10715. *
  10716. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10717. * property of bound functions.
  10718. *
  10719. * @static
  10720. * @memberOf _
  10721. * @since 0.1.0
  10722. * @category Function
  10723. * @param {Function} func The function to bind.
  10724. * @param {*} thisArg The `this` binding of `func`.
  10725. * @param {...*} [partials] The arguments to be partially applied.
  10726. * @returns {Function} Returns the new bound function.
  10727. * @example
  10728. *
  10729. * function greet(greeting, punctuation) {
  10730. * return greeting + ' ' + this.user + punctuation;
  10731. * }
  10732. *
  10733. * var object = { 'user': 'fred' };
  10734. *
  10735. * var bound = _.bind(greet, object, 'hi');
  10736. * bound('!');
  10737. * // => 'hi fred!'
  10738. *
  10739. * // Bound with placeholders.
  10740. * var bound = _.bind(greet, object, _, '!');
  10741. * bound('hi');
  10742. * // => 'hi fred!'
  10743. */
  10744. var bind = baseRest(function(func, thisArg, partials) {
  10745. var bitmask = WRAP_BIND_FLAG;
  10746. if (partials.length) {
  10747. var holders = replaceHolders(partials, getHolder(bind));
  10748. bitmask |= WRAP_PARTIAL_FLAG;
  10749. }
  10750. return createWrap(func, bitmask, thisArg, partials, holders);
  10751. });
  10752. /**
  10753. * Creates a function that invokes the method at `object[key]` with `partials`
  10754. * prepended to the arguments it receives.
  10755. *
  10756. * This method differs from `_.bind` by allowing bound functions to reference
  10757. * methods that may be redefined or don't yet exist. See
  10758. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10759. * for more details.
  10760. *
  10761. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10762. * builds, may be used as a placeholder for partially applied arguments.
  10763. *
  10764. * @static
  10765. * @memberOf _
  10766. * @since 0.10.0
  10767. * @category Function
  10768. * @param {Object} object The object to invoke the method on.
  10769. * @param {string} key The key of the method.
  10770. * @param {...*} [partials] The arguments to be partially applied.
  10771. * @returns {Function} Returns the new bound function.
  10772. * @example
  10773. *
  10774. * var object = {
  10775. * 'user': 'fred',
  10776. * 'greet': function(greeting, punctuation) {
  10777. * return greeting + ' ' + this.user + punctuation;
  10778. * }
  10779. * };
  10780. *
  10781. * var bound = _.bindKey(object, 'greet', 'hi');
  10782. * bound('!');
  10783. * // => 'hi fred!'
  10784. *
  10785. * object.greet = function(greeting, punctuation) {
  10786. * return greeting + 'ya ' + this.user + punctuation;
  10787. * };
  10788. *
  10789. * bound('!');
  10790. * // => 'hiya fred!'
  10791. *
  10792. * // Bound with placeholders.
  10793. * var bound = _.bindKey(object, 'greet', _, '!');
  10794. * bound('hi');
  10795. * // => 'hiya fred!'
  10796. */
  10797. var bindKey = baseRest(function(object, key, partials) {
  10798. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10799. if (partials.length) {
  10800. var holders = replaceHolders(partials, getHolder(bindKey));
  10801. bitmask |= WRAP_PARTIAL_FLAG;
  10802. }
  10803. return createWrap(key, bitmask, object, partials, holders);
  10804. });
  10805. /**
  10806. * Creates a function that accepts arguments of `func` and either invokes
  10807. * `func` returning its result, if at least `arity` number of arguments have
  10808. * been provided, or returns a function that accepts the remaining `func`
  10809. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10810. * is not sufficient.
  10811. *
  10812. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10813. * may be used as a placeholder for provided arguments.
  10814. *
  10815. * **Note:** This method doesn't set the "length" property of curried functions.
  10816. *
  10817. * @static
  10818. * @memberOf _
  10819. * @since 2.0.0
  10820. * @category Function
  10821. * @param {Function} func The function to curry.
  10822. * @param {number} [arity=func.length] The arity of `func`.
  10823. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10824. * @returns {Function} Returns the new curried function.
  10825. * @example
  10826. *
  10827. * var abc = function(a, b, c) {
  10828. * return [a, b, c];
  10829. * };
  10830. *
  10831. * var curried = _.curry(abc);
  10832. *
  10833. * curried(1)(2)(3);
  10834. * // => [1, 2, 3]
  10835. *
  10836. * curried(1, 2)(3);
  10837. * // => [1, 2, 3]
  10838. *
  10839. * curried(1, 2, 3);
  10840. * // => [1, 2, 3]
  10841. *
  10842. * // Curried with placeholders.
  10843. * curried(1)(_, 3)(2);
  10844. * // => [1, 2, 3]
  10845. */
  10846. function curry(func, arity, guard) {
  10847. arity = guard ? undefined : arity;
  10848. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10849. result.placeholder = curry.placeholder;
  10850. return result;
  10851. }
  10852. /**
  10853. * This method is like `_.curry` except that arguments are applied to `func`
  10854. * in the manner of `_.partialRight` instead of `_.partial`.
  10855. *
  10856. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10857. * builds, may be used as a placeholder for provided arguments.
  10858. *
  10859. * **Note:** This method doesn't set the "length" property of curried functions.
  10860. *
  10861. * @static
  10862. * @memberOf _
  10863. * @since 3.0.0
  10864. * @category Function
  10865. * @param {Function} func The function to curry.
  10866. * @param {number} [arity=func.length] The arity of `func`.
  10867. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10868. * @returns {Function} Returns the new curried function.
  10869. * @example
  10870. *
  10871. * var abc = function(a, b, c) {
  10872. * return [a, b, c];
  10873. * };
  10874. *
  10875. * var curried = _.curryRight(abc);
  10876. *
  10877. * curried(3)(2)(1);
  10878. * // => [1, 2, 3]
  10879. *
  10880. * curried(2, 3)(1);
  10881. * // => [1, 2, 3]
  10882. *
  10883. * curried(1, 2, 3);
  10884. * // => [1, 2, 3]
  10885. *
  10886. * // Curried with placeholders.
  10887. * curried(3)(1, _)(2);
  10888. * // => [1, 2, 3]
  10889. */
  10890. function curryRight(func, arity, guard) {
  10891. arity = guard ? undefined : arity;
  10892. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10893. result.placeholder = curryRight.placeholder;
  10894. return result;
  10895. }
  10896. /**
  10897. * Creates a debounced function that delays invoking `func` until after `wait`
  10898. * milliseconds have elapsed since the last time the debounced function was
  10899. * invoked. The debounced function comes with a `cancel` method to cancel
  10900. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10901. * Provide `options` to indicate whether `func` should be invoked on the
  10902. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10903. * with the last arguments provided to the debounced function. Subsequent
  10904. * calls to the debounced function return the result of the last `func`
  10905. * invocation.
  10906. *
  10907. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10908. * invoked on the trailing edge of the timeout only if the debounced function
  10909. * is invoked more than once during the `wait` timeout.
  10910. *
  10911. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10912. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10913. *
  10914. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10915. * for details over the differences between `_.debounce` and `_.throttle`.
  10916. *
  10917. * @static
  10918. * @memberOf _
  10919. * @since 0.1.0
  10920. * @category Function
  10921. * @param {Function} func The function to debounce.
  10922. * @param {number} [wait=0] The number of milliseconds to delay.
  10923. * @param {Object} [options={}] The options object.
  10924. * @param {boolean} [options.leading=false]
  10925. * Specify invoking on the leading edge of the timeout.
  10926. * @param {number} [options.maxWait]
  10927. * The maximum time `func` is allowed to be delayed before it's invoked.
  10928. * @param {boolean} [options.trailing=true]
  10929. * Specify invoking on the trailing edge of the timeout.
  10930. * @returns {Function} Returns the new debounced function.
  10931. * @example
  10932. *
  10933. * // Avoid costly calculations while the window size is in flux.
  10934. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10935. *
  10936. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10937. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10938. * 'leading': true,
  10939. * 'trailing': false
  10940. * }));
  10941. *
  10942. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10943. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10944. * var source = new EventSource('/stream');
  10945. * jQuery(source).on('message', debounced);
  10946. *
  10947. * // Cancel the trailing debounced invocation.
  10948. * jQuery(window).on('popstate', debounced.cancel);
  10949. */
  10950. function debounce(func, wait, options) {
  10951. var lastArgs,
  10952. lastThis,
  10953. maxWait,
  10954. result,
  10955. timerId,
  10956. lastCallTime,
  10957. lastInvokeTime = 0,
  10958. leading = false,
  10959. maxing = false,
  10960. trailing = true;
  10961. if (typeof func != 'function') {
  10962. throw new TypeError(FUNC_ERROR_TEXT);
  10963. }
  10964. wait = toNumber(wait) || 0;
  10965. if (isObject(options)) {
  10966. leading = !!options.leading;
  10967. maxing = 'maxWait' in options;
  10968. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10969. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10970. }
  10971. function invokeFunc(time) {
  10972. var args = lastArgs,
  10973. thisArg = lastThis;
  10974. lastArgs = lastThis = undefined;
  10975. lastInvokeTime = time;
  10976. result = func.apply(thisArg, args);
  10977. return result;
  10978. }
  10979. function leadingEdge(time) {
  10980. // Reset any `maxWait` timer.
  10981. lastInvokeTime = time;
  10982. // Start the timer for the trailing edge.
  10983. timerId = setTimeout(timerExpired, wait);
  10984. // Invoke the leading edge.
  10985. return leading ? invokeFunc(time) : result;
  10986. }
  10987. function remainingWait(time) {
  10988. var timeSinceLastCall = time - lastCallTime,
  10989. timeSinceLastInvoke = time - lastInvokeTime,
  10990. timeWaiting = wait - timeSinceLastCall;
  10991. return maxing
  10992. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10993. : timeWaiting;
  10994. }
  10995. function shouldInvoke(time) {
  10996. var timeSinceLastCall = time - lastCallTime,
  10997. timeSinceLastInvoke = time - lastInvokeTime;
  10998. // Either this is the first call, activity has stopped and we're at the
  10999. // trailing edge, the system time has gone backwards and we're treating
  11000. // it as the trailing edge, or we've hit the `maxWait` limit.
  11001. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11002. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11003. }
  11004. function timerExpired() {
  11005. var time = now();
  11006. if (shouldInvoke(time)) {
  11007. return trailingEdge(time);
  11008. }
  11009. // Restart the timer.
  11010. timerId = setTimeout(timerExpired, remainingWait(time));
  11011. }
  11012. function trailingEdge(time) {
  11013. timerId = undefined;
  11014. // Only invoke if we have `lastArgs` which means `func` has been
  11015. // debounced at least once.
  11016. if (trailing && lastArgs) {
  11017. return invokeFunc(time);
  11018. }
  11019. lastArgs = lastThis = undefined;
  11020. return result;
  11021. }
  11022. function cancel() {
  11023. if (timerId !== undefined) {
  11024. clearTimeout(timerId);
  11025. }
  11026. lastInvokeTime = 0;
  11027. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11028. }
  11029. function flush() {
  11030. return timerId === undefined ? result : trailingEdge(now());
  11031. }
  11032. function debounced() {
  11033. var time = now(),
  11034. isInvoking = shouldInvoke(time);
  11035. lastArgs = arguments;
  11036. lastThis = this;
  11037. lastCallTime = time;
  11038. if (isInvoking) {
  11039. if (timerId === undefined) {
  11040. return leadingEdge(lastCallTime);
  11041. }
  11042. if (maxing) {
  11043. // Handle invocations in a tight loop.
  11044. clearTimeout(timerId);
  11045. timerId = setTimeout(timerExpired, wait);
  11046. return invokeFunc(lastCallTime);
  11047. }
  11048. }
  11049. if (timerId === undefined) {
  11050. timerId = setTimeout(timerExpired, wait);
  11051. }
  11052. return result;
  11053. }
  11054. debounced.cancel = cancel;
  11055. debounced.flush = flush;
  11056. return debounced;
  11057. }
  11058. /**
  11059. * Defers invoking the `func` until the current call stack has cleared. Any
  11060. * additional arguments are provided to `func` when it's invoked.
  11061. *
  11062. * @static
  11063. * @memberOf _
  11064. * @since 0.1.0
  11065. * @category Function
  11066. * @param {Function} func The function to defer.
  11067. * @param {...*} [args] The arguments to invoke `func` with.
  11068. * @returns {number} Returns the timer id.
  11069. * @example
  11070. *
  11071. * _.defer(function(text) {
  11072. * console.log(text);
  11073. * }, 'deferred');
  11074. * // => Logs 'deferred' after one millisecond.
  11075. */
  11076. var defer = baseRest(function(func, args) {
  11077. return baseDelay(func, 1, args);
  11078. });
  11079. /**
  11080. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11081. * provided to `func` when it's invoked.
  11082. *
  11083. * @static
  11084. * @memberOf _
  11085. * @since 0.1.0
  11086. * @category Function
  11087. * @param {Function} func The function to delay.
  11088. * @param {number} wait The number of milliseconds to delay invocation.
  11089. * @param {...*} [args] The arguments to invoke `func` with.
  11090. * @returns {number} Returns the timer id.
  11091. * @example
  11092. *
  11093. * _.delay(function(text) {
  11094. * console.log(text);
  11095. * }, 1000, 'later');
  11096. * // => Logs 'later' after one second.
  11097. */
  11098. var delay = baseRest(function(func, wait, args) {
  11099. return baseDelay(func, toNumber(wait) || 0, args);
  11100. });
  11101. /**
  11102. * Creates a function that invokes `func` with arguments reversed.
  11103. *
  11104. * @static
  11105. * @memberOf _
  11106. * @since 4.0.0
  11107. * @category Function
  11108. * @param {Function} func The function to flip arguments for.
  11109. * @returns {Function} Returns the new flipped function.
  11110. * @example
  11111. *
  11112. * var flipped = _.flip(function() {
  11113. * return _.toArray(arguments);
  11114. * });
  11115. *
  11116. * flipped('a', 'b', 'c', 'd');
  11117. * // => ['d', 'c', 'b', 'a']
  11118. */
  11119. function flip(func) {
  11120. return createWrap(func, WRAP_FLIP_FLAG);
  11121. }
  11122. /**
  11123. * Creates a function that memoizes the result of `func`. If `resolver` is
  11124. * provided, it determines the cache key for storing the result based on the
  11125. * arguments provided to the memoized function. By default, the first argument
  11126. * provided to the memoized function is used as the map cache key. The `func`
  11127. * is invoked with the `this` binding of the memoized function.
  11128. *
  11129. * **Note:** The cache is exposed as the `cache` property on the memoized
  11130. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11131. * constructor with one whose instances implement the
  11132. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11133. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11134. *
  11135. * @static
  11136. * @memberOf _
  11137. * @since 0.1.0
  11138. * @category Function
  11139. * @param {Function} func The function to have its output memoized.
  11140. * @param {Function} [resolver] The function to resolve the cache key.
  11141. * @returns {Function} Returns the new memoized function.
  11142. * @example
  11143. *
  11144. * var object = { 'a': 1, 'b': 2 };
  11145. * var other = { 'c': 3, 'd': 4 };
  11146. *
  11147. * var values = _.memoize(_.values);
  11148. * values(object);
  11149. * // => [1, 2]
  11150. *
  11151. * values(other);
  11152. * // => [3, 4]
  11153. *
  11154. * object.a = 2;
  11155. * values(object);
  11156. * // => [1, 2]
  11157. *
  11158. * // Modify the result cache.
  11159. * values.cache.set(object, ['a', 'b']);
  11160. * values(object);
  11161. * // => ['a', 'b']
  11162. *
  11163. * // Replace `_.memoize.Cache`.
  11164. * _.memoize.Cache = WeakMap;
  11165. */
  11166. function memoize(func, resolver) {
  11167. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11168. throw new TypeError(FUNC_ERROR_TEXT);
  11169. }
  11170. var memoized = function() {
  11171. var args = arguments,
  11172. key = resolver ? resolver.apply(this, args) : args[0],
  11173. cache = memoized.cache;
  11174. if (cache.has(key)) {
  11175. return cache.get(key);
  11176. }
  11177. var result = func.apply(this, args);
  11178. memoized.cache = cache.set(key, result) || cache;
  11179. return result;
  11180. };
  11181. memoized.cache = new (memoize.Cache || MapCache);
  11182. return memoized;
  11183. }
  11184. // Expose `MapCache`.
  11185. memoize.Cache = MapCache;
  11186. /**
  11187. * Creates a function that negates the result of the predicate `func`. The
  11188. * `func` predicate is invoked with the `this` binding and arguments of the
  11189. * created function.
  11190. *
  11191. * @static
  11192. * @memberOf _
  11193. * @since 3.0.0
  11194. * @category Function
  11195. * @param {Function} predicate The predicate to negate.
  11196. * @returns {Function} Returns the new negated function.
  11197. * @example
  11198. *
  11199. * function isEven(n) {
  11200. * return n % 2 == 0;
  11201. * }
  11202. *
  11203. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11204. * // => [1, 3, 5]
  11205. */
  11206. function negate(predicate) {
  11207. if (typeof predicate != 'function') {
  11208. throw new TypeError(FUNC_ERROR_TEXT);
  11209. }
  11210. return function() {
  11211. var args = arguments;
  11212. switch (args.length) {
  11213. case 0: return !predicate.call(this);
  11214. case 1: return !predicate.call(this, args[0]);
  11215. case 2: return !predicate.call(this, args[0], args[1]);
  11216. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11217. }
  11218. return !predicate.apply(this, args);
  11219. };
  11220. }
  11221. /**
  11222. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11223. * to the function return the value of the first invocation. The `func` is
  11224. * invoked with the `this` binding and arguments of the created function.
  11225. *
  11226. * @static
  11227. * @memberOf _
  11228. * @since 0.1.0
  11229. * @category Function
  11230. * @param {Function} func The function to restrict.
  11231. * @returns {Function} Returns the new restricted function.
  11232. * @example
  11233. *
  11234. * var initialize = _.once(createApplication);
  11235. * initialize();
  11236. * initialize();
  11237. * // => `createApplication` is invoked once
  11238. */
  11239. function once(func) {
  11240. return before(2, func);
  11241. }
  11242. /**
  11243. * Creates a function that invokes `func` with its arguments transformed.
  11244. *
  11245. * @static
  11246. * @since 4.0.0
  11247. * @memberOf _
  11248. * @category Function
  11249. * @param {Function} func The function to wrap.
  11250. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11251. * The argument transforms.
  11252. * @returns {Function} Returns the new function.
  11253. * @example
  11254. *
  11255. * function doubled(n) {
  11256. * return n * 2;
  11257. * }
  11258. *
  11259. * function square(n) {
  11260. * return n * n;
  11261. * }
  11262. *
  11263. * var func = _.overArgs(function(x, y) {
  11264. * return [x, y];
  11265. * }, [square, doubled]);
  11266. *
  11267. * func(9, 3);
  11268. * // => [81, 6]
  11269. *
  11270. * func(10, 5);
  11271. * // => [100, 10]
  11272. */
  11273. var overArgs = castRest(function(func, transforms) {
  11274. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11275. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11276. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11277. var funcsLength = transforms.length;
  11278. return baseRest(function(args) {
  11279. var index = -1,
  11280. length = nativeMin(args.length, funcsLength);
  11281. while (++index < length) {
  11282. args[index] = transforms[index].call(this, args[index]);
  11283. }
  11284. return apply(func, this, args);
  11285. });
  11286. });
  11287. /**
  11288. * Creates a function that invokes `func` with `partials` prepended to the
  11289. * arguments it receives. This method is like `_.bind` except it does **not**
  11290. * alter the `this` binding.
  11291. *
  11292. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11293. * builds, may be used as a placeholder for partially applied arguments.
  11294. *
  11295. * **Note:** This method doesn't set the "length" property of partially
  11296. * applied functions.
  11297. *
  11298. * @static
  11299. * @memberOf _
  11300. * @since 0.2.0
  11301. * @category Function
  11302. * @param {Function} func The function to partially apply arguments to.
  11303. * @param {...*} [partials] The arguments to be partially applied.
  11304. * @returns {Function} Returns the new partially applied function.
  11305. * @example
  11306. *
  11307. * function greet(greeting, name) {
  11308. * return greeting + ' ' + name;
  11309. * }
  11310. *
  11311. * var sayHelloTo = _.partial(greet, 'hello');
  11312. * sayHelloTo('fred');
  11313. * // => 'hello fred'
  11314. *
  11315. * // Partially applied with placeholders.
  11316. * var greetFred = _.partial(greet, _, 'fred');
  11317. * greetFred('hi');
  11318. * // => 'hi fred'
  11319. */
  11320. var partial = baseRest(function(func, partials) {
  11321. var holders = replaceHolders(partials, getHolder(partial));
  11322. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11323. });
  11324. /**
  11325. * This method is like `_.partial` except that partially applied arguments
  11326. * are appended to the arguments it receives.
  11327. *
  11328. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11329. * builds, may be used as a placeholder for partially applied arguments.
  11330. *
  11331. * **Note:** This method doesn't set the "length" property of partially
  11332. * applied functions.
  11333. *
  11334. * @static
  11335. * @memberOf _
  11336. * @since 1.0.0
  11337. * @category Function
  11338. * @param {Function} func The function to partially apply arguments to.
  11339. * @param {...*} [partials] The arguments to be partially applied.
  11340. * @returns {Function} Returns the new partially applied function.
  11341. * @example
  11342. *
  11343. * function greet(greeting, name) {
  11344. * return greeting + ' ' + name;
  11345. * }
  11346. *
  11347. * var greetFred = _.partialRight(greet, 'fred');
  11348. * greetFred('hi');
  11349. * // => 'hi fred'
  11350. *
  11351. * // Partially applied with placeholders.
  11352. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11353. * sayHelloTo('fred');
  11354. * // => 'hello fred'
  11355. */
  11356. var partialRight = baseRest(function(func, partials) {
  11357. var holders = replaceHolders(partials, getHolder(partialRight));
  11358. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11359. });
  11360. /**
  11361. * Creates a function that invokes `func` with arguments arranged according
  11362. * to the specified `indexes` where the argument value at the first index is
  11363. * provided as the first argument, the argument value at the second index is
  11364. * provided as the second argument, and so on.
  11365. *
  11366. * @static
  11367. * @memberOf _
  11368. * @since 3.0.0
  11369. * @category Function
  11370. * @param {Function} func The function to rearrange arguments for.
  11371. * @param {...(number|number[])} indexes The arranged argument indexes.
  11372. * @returns {Function} Returns the new function.
  11373. * @example
  11374. *
  11375. * var rearged = _.rearg(function(a, b, c) {
  11376. * return [a, b, c];
  11377. * }, [2, 0, 1]);
  11378. *
  11379. * rearged('b', 'c', 'a')
  11380. * // => ['a', 'b', 'c']
  11381. */
  11382. var rearg = flatRest(function(func, indexes) {
  11383. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11384. });
  11385. /**
  11386. * Creates a function that invokes `func` with the `this` binding of the
  11387. * created function and arguments from `start` and beyond provided as
  11388. * an array.
  11389. *
  11390. * **Note:** This method is based on the
  11391. * [rest parameter](https://mdn.io/rest_parameters).
  11392. *
  11393. * @static
  11394. * @memberOf _
  11395. * @since 4.0.0
  11396. * @category Function
  11397. * @param {Function} func The function to apply a rest parameter to.
  11398. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11399. * @returns {Function} Returns the new function.
  11400. * @example
  11401. *
  11402. * var say = _.rest(function(what, names) {
  11403. * return what + ' ' + _.initial(names).join(', ') +
  11404. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11405. * });
  11406. *
  11407. * say('hello', 'fred', 'barney', 'pebbles');
  11408. * // => 'hello fred, barney, & pebbles'
  11409. */
  11410. function rest(func, start) {
  11411. if (typeof func != 'function') {
  11412. throw new TypeError(FUNC_ERROR_TEXT);
  11413. }
  11414. start = start === undefined ? start : toInteger(start);
  11415. return baseRest(func, start);
  11416. }
  11417. /**
  11418. * Creates a function that invokes `func` with the `this` binding of the
  11419. * create function and an array of arguments much like
  11420. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11421. *
  11422. * **Note:** This method is based on the
  11423. * [spread operator](https://mdn.io/spread_operator).
  11424. *
  11425. * @static
  11426. * @memberOf _
  11427. * @since 3.2.0
  11428. * @category Function
  11429. * @param {Function} func The function to spread arguments over.
  11430. * @param {number} [start=0] The start position of the spread.
  11431. * @returns {Function} Returns the new function.
  11432. * @example
  11433. *
  11434. * var say = _.spread(function(who, what) {
  11435. * return who + ' says ' + what;
  11436. * });
  11437. *
  11438. * say(['fred', 'hello']);
  11439. * // => 'fred says hello'
  11440. *
  11441. * var numbers = Promise.all([
  11442. * Promise.resolve(40),
  11443. * Promise.resolve(36)
  11444. * ]);
  11445. *
  11446. * numbers.then(_.spread(function(x, y) {
  11447. * return x + y;
  11448. * }));
  11449. * // => a Promise of 76
  11450. */
  11451. function spread(func, start) {
  11452. if (typeof func != 'function') {
  11453. throw new TypeError(FUNC_ERROR_TEXT);
  11454. }
  11455. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11456. return baseRest(function(args) {
  11457. var array = args[start],
  11458. otherArgs = castSlice(args, 0, start);
  11459. if (array) {
  11460. arrayPush(otherArgs, array);
  11461. }
  11462. return apply(func, this, otherArgs);
  11463. });
  11464. }
  11465. /**
  11466. * Creates a throttled function that only invokes `func` at most once per
  11467. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11468. * method to cancel delayed `func` invocations and a `flush` method to
  11469. * immediately invoke them. Provide `options` to indicate whether `func`
  11470. * should be invoked on the leading and/or trailing edge of the `wait`
  11471. * timeout. The `func` is invoked with the last arguments provided to the
  11472. * throttled function. Subsequent calls to the throttled function return the
  11473. * result of the last `func` invocation.
  11474. *
  11475. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11476. * invoked on the trailing edge of the timeout only if the throttled function
  11477. * is invoked more than once during the `wait` timeout.
  11478. *
  11479. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11480. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11481. *
  11482. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11483. * for details over the differences between `_.throttle` and `_.debounce`.
  11484. *
  11485. * @static
  11486. * @memberOf _
  11487. * @since 0.1.0
  11488. * @category Function
  11489. * @param {Function} func The function to throttle.
  11490. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11491. * @param {Object} [options={}] The options object.
  11492. * @param {boolean} [options.leading=true]
  11493. * Specify invoking on the leading edge of the timeout.
  11494. * @param {boolean} [options.trailing=true]
  11495. * Specify invoking on the trailing edge of the timeout.
  11496. * @returns {Function} Returns the new throttled function.
  11497. * @example
  11498. *
  11499. * // Avoid excessively updating the position while scrolling.
  11500. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11501. *
  11502. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11503. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11504. * jQuery(element).on('click', throttled);
  11505. *
  11506. * // Cancel the trailing throttled invocation.
  11507. * jQuery(window).on('popstate', throttled.cancel);
  11508. */
  11509. function throttle(func, wait, options) {
  11510. var leading = true,
  11511. trailing = true;
  11512. if (typeof func != 'function') {
  11513. throw new TypeError(FUNC_ERROR_TEXT);
  11514. }
  11515. if (isObject(options)) {
  11516. leading = 'leading' in options ? !!options.leading : leading;
  11517. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11518. }
  11519. return debounce(func, wait, {
  11520. 'leading': leading,
  11521. 'maxWait': wait,
  11522. 'trailing': trailing
  11523. });
  11524. }
  11525. /**
  11526. * Creates a function that accepts up to one argument, ignoring any
  11527. * additional arguments.
  11528. *
  11529. * @static
  11530. * @memberOf _
  11531. * @since 4.0.0
  11532. * @category Function
  11533. * @param {Function} func The function to cap arguments for.
  11534. * @returns {Function} Returns the new capped function.
  11535. * @example
  11536. *
  11537. * _.map(['6', '8', '10'], _.unary(parseInt));
  11538. * // => [6, 8, 10]
  11539. */
  11540. function unary(func) {
  11541. return ary(func, 1);
  11542. }
  11543. /**
  11544. * Creates a function that provides `value` to `wrapper` as its first
  11545. * argument. Any additional arguments provided to the function are appended
  11546. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11547. * binding of the created function.
  11548. *
  11549. * @static
  11550. * @memberOf _
  11551. * @since 0.1.0
  11552. * @category Function
  11553. * @param {*} value The value to wrap.
  11554. * @param {Function} [wrapper=identity] The wrapper function.
  11555. * @returns {Function} Returns the new function.
  11556. * @example
  11557. *
  11558. * var p = _.wrap(_.escape, function(func, text) {
  11559. * return '<p>' + func(text) + '</p>';
  11560. * });
  11561. *
  11562. * p('fred, barney, & pebbles');
  11563. * // => '<p>fred, barney, &amp; pebbles</p>'
  11564. */
  11565. function wrap(value, wrapper) {
  11566. return partial(castFunction(wrapper), value);
  11567. }
  11568. /*------------------------------------------------------------------------*/
  11569. /**
  11570. * Casts `value` as an array if it's not one.
  11571. *
  11572. * @static
  11573. * @memberOf _
  11574. * @since 4.4.0
  11575. * @category Lang
  11576. * @param {*} value The value to inspect.
  11577. * @returns {Array} Returns the cast array.
  11578. * @example
  11579. *
  11580. * _.castArray(1);
  11581. * // => [1]
  11582. *
  11583. * _.castArray({ 'a': 1 });
  11584. * // => [{ 'a': 1 }]
  11585. *
  11586. * _.castArray('abc');
  11587. * // => ['abc']
  11588. *
  11589. * _.castArray(null);
  11590. * // => [null]
  11591. *
  11592. * _.castArray(undefined);
  11593. * // => [undefined]
  11594. *
  11595. * _.castArray();
  11596. * // => []
  11597. *
  11598. * var array = [1, 2, 3];
  11599. * console.log(_.castArray(array) === array);
  11600. * // => true
  11601. */
  11602. function castArray() {
  11603. if (!arguments.length) {
  11604. return [];
  11605. }
  11606. var value = arguments[0];
  11607. return isArray(value) ? value : [value];
  11608. }
  11609. /**
  11610. * Creates a shallow clone of `value`.
  11611. *
  11612. * **Note:** This method is loosely based on the
  11613. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11614. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11615. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11616. * arrays. The own enumerable properties of `arguments` objects are cloned
  11617. * as plain objects. An empty object is returned for uncloneable values such
  11618. * as error objects, functions, DOM nodes, and WeakMaps.
  11619. *
  11620. * @static
  11621. * @memberOf _
  11622. * @since 0.1.0
  11623. * @category Lang
  11624. * @param {*} value The value to clone.
  11625. * @returns {*} Returns the cloned value.
  11626. * @see _.cloneDeep
  11627. * @example
  11628. *
  11629. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11630. *
  11631. * var shallow = _.clone(objects);
  11632. * console.log(shallow[0] === objects[0]);
  11633. * // => true
  11634. */
  11635. function clone(value) {
  11636. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11637. }
  11638. /**
  11639. * This method is like `_.clone` except that it accepts `customizer` which
  11640. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11641. * cloning is handled by the method instead. The `customizer` is invoked with
  11642. * up to four arguments; (value [, index|key, object, stack]).
  11643. *
  11644. * @static
  11645. * @memberOf _
  11646. * @since 4.0.0
  11647. * @category Lang
  11648. * @param {*} value The value to clone.
  11649. * @param {Function} [customizer] The function to customize cloning.
  11650. * @returns {*} Returns the cloned value.
  11651. * @see _.cloneDeepWith
  11652. * @example
  11653. *
  11654. * function customizer(value) {
  11655. * if (_.isElement(value)) {
  11656. * return value.cloneNode(false);
  11657. * }
  11658. * }
  11659. *
  11660. * var el = _.cloneWith(document.body, customizer);
  11661. *
  11662. * console.log(el === document.body);
  11663. * // => false
  11664. * console.log(el.nodeName);
  11665. * // => 'BODY'
  11666. * console.log(el.childNodes.length);
  11667. * // => 0
  11668. */
  11669. function cloneWith(value, customizer) {
  11670. customizer = typeof customizer == 'function' ? customizer : undefined;
  11671. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11672. }
  11673. /**
  11674. * This method is like `_.clone` except that it recursively clones `value`.
  11675. *
  11676. * @static
  11677. * @memberOf _
  11678. * @since 1.0.0
  11679. * @category Lang
  11680. * @param {*} value The value to recursively clone.
  11681. * @returns {*} Returns the deep cloned value.
  11682. * @see _.clone
  11683. * @example
  11684. *
  11685. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11686. *
  11687. * var deep = _.cloneDeep(objects);
  11688. * console.log(deep[0] === objects[0]);
  11689. * // => false
  11690. */
  11691. function cloneDeep(value) {
  11692. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11693. }
  11694. /**
  11695. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11696. *
  11697. * @static
  11698. * @memberOf _
  11699. * @since 4.0.0
  11700. * @category Lang
  11701. * @param {*} value The value to recursively clone.
  11702. * @param {Function} [customizer] The function to customize cloning.
  11703. * @returns {*} Returns the deep cloned value.
  11704. * @see _.cloneWith
  11705. * @example
  11706. *
  11707. * function customizer(value) {
  11708. * if (_.isElement(value)) {
  11709. * return value.cloneNode(true);
  11710. * }
  11711. * }
  11712. *
  11713. * var el = _.cloneDeepWith(document.body, customizer);
  11714. *
  11715. * console.log(el === document.body);
  11716. * // => false
  11717. * console.log(el.nodeName);
  11718. * // => 'BODY'
  11719. * console.log(el.childNodes.length);
  11720. * // => 20
  11721. */
  11722. function cloneDeepWith(value, customizer) {
  11723. customizer = typeof customizer == 'function' ? customizer : undefined;
  11724. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11725. }
  11726. /**
  11727. * Checks if `object` conforms to `source` by invoking the predicate
  11728. * properties of `source` with the corresponding property values of `object`.
  11729. *
  11730. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11731. * partially applied.
  11732. *
  11733. * @static
  11734. * @memberOf _
  11735. * @since 4.14.0
  11736. * @category Lang
  11737. * @param {Object} object The object to inspect.
  11738. * @param {Object} source The object of property predicates to conform to.
  11739. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11740. * @example
  11741. *
  11742. * var object = { 'a': 1, 'b': 2 };
  11743. *
  11744. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11745. * // => true
  11746. *
  11747. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11748. * // => false
  11749. */
  11750. function conformsTo(object, source) {
  11751. return source == null || baseConformsTo(object, source, keys(source));
  11752. }
  11753. /**
  11754. * Performs a
  11755. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11756. * comparison between two values to determine if they are equivalent.
  11757. *
  11758. * @static
  11759. * @memberOf _
  11760. * @since 4.0.0
  11761. * @category Lang
  11762. * @param {*} value The value to compare.
  11763. * @param {*} other The other value to compare.
  11764. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11765. * @example
  11766. *
  11767. * var object = { 'a': 1 };
  11768. * var other = { 'a': 1 };
  11769. *
  11770. * _.eq(object, object);
  11771. * // => true
  11772. *
  11773. * _.eq(object, other);
  11774. * // => false
  11775. *
  11776. * _.eq('a', 'a');
  11777. * // => true
  11778. *
  11779. * _.eq('a', Object('a'));
  11780. * // => false
  11781. *
  11782. * _.eq(NaN, NaN);
  11783. * // => true
  11784. */
  11785. function eq(value, other) {
  11786. return value === other || (value !== value && other !== other);
  11787. }
  11788. /**
  11789. * Checks if `value` is greater than `other`.
  11790. *
  11791. * @static
  11792. * @memberOf _
  11793. * @since 3.9.0
  11794. * @category Lang
  11795. * @param {*} value The value to compare.
  11796. * @param {*} other The other value to compare.
  11797. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11798. * else `false`.
  11799. * @see _.lt
  11800. * @example
  11801. *
  11802. * _.gt(3, 1);
  11803. * // => true
  11804. *
  11805. * _.gt(3, 3);
  11806. * // => false
  11807. *
  11808. * _.gt(1, 3);
  11809. * // => false
  11810. */
  11811. var gt = createRelationalOperation(baseGt);
  11812. /**
  11813. * Checks if `value` is greater than or equal to `other`.
  11814. *
  11815. * @static
  11816. * @memberOf _
  11817. * @since 3.9.0
  11818. * @category Lang
  11819. * @param {*} value The value to compare.
  11820. * @param {*} other The other value to compare.
  11821. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11822. * `other`, else `false`.
  11823. * @see _.lte
  11824. * @example
  11825. *
  11826. * _.gte(3, 1);
  11827. * // => true
  11828. *
  11829. * _.gte(3, 3);
  11830. * // => true
  11831. *
  11832. * _.gte(1, 3);
  11833. * // => false
  11834. */
  11835. var gte = createRelationalOperation(function(value, other) {
  11836. return value >= other;
  11837. });
  11838. /**
  11839. * Checks if `value` is likely an `arguments` object.
  11840. *
  11841. * @static
  11842. * @memberOf _
  11843. * @since 0.1.0
  11844. * @category Lang
  11845. * @param {*} value The value to check.
  11846. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11847. * else `false`.
  11848. * @example
  11849. *
  11850. * _.isArguments(function() { return arguments; }());
  11851. * // => true
  11852. *
  11853. * _.isArguments([1, 2, 3]);
  11854. * // => false
  11855. */
  11856. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11857. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11858. !propertyIsEnumerable.call(value, 'callee');
  11859. };
  11860. /**
  11861. * Checks if `value` is classified as an `Array` object.
  11862. *
  11863. * @static
  11864. * @memberOf _
  11865. * @since 0.1.0
  11866. * @category Lang
  11867. * @param {*} value The value to check.
  11868. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11869. * @example
  11870. *
  11871. * _.isArray([1, 2, 3]);
  11872. * // => true
  11873. *
  11874. * _.isArray(document.body.children);
  11875. * // => false
  11876. *
  11877. * _.isArray('abc');
  11878. * // => false
  11879. *
  11880. * _.isArray(_.noop);
  11881. * // => false
  11882. */
  11883. var isArray = Array.isArray;
  11884. /**
  11885. * Checks if `value` is classified as an `ArrayBuffer` object.
  11886. *
  11887. * @static
  11888. * @memberOf _
  11889. * @since 4.3.0
  11890. * @category Lang
  11891. * @param {*} value The value to check.
  11892. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11893. * @example
  11894. *
  11895. * _.isArrayBuffer(new ArrayBuffer(2));
  11896. * // => true
  11897. *
  11898. * _.isArrayBuffer(new Array(2));
  11899. * // => false
  11900. */
  11901. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11902. /**
  11903. * Checks if `value` is array-like. A value is considered array-like if it's
  11904. * not a function and has a `value.length` that's an integer greater than or
  11905. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11906. *
  11907. * @static
  11908. * @memberOf _
  11909. * @since 4.0.0
  11910. * @category Lang
  11911. * @param {*} value The value to check.
  11912. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11913. * @example
  11914. *
  11915. * _.isArrayLike([1, 2, 3]);
  11916. * // => true
  11917. *
  11918. * _.isArrayLike(document.body.children);
  11919. * // => true
  11920. *
  11921. * _.isArrayLike('abc');
  11922. * // => true
  11923. *
  11924. * _.isArrayLike(_.noop);
  11925. * // => false
  11926. */
  11927. function isArrayLike(value) {
  11928. return value != null && isLength(value.length) && !isFunction(value);
  11929. }
  11930. /**
  11931. * This method is like `_.isArrayLike` except that it also checks if `value`
  11932. * is an object.
  11933. *
  11934. * @static
  11935. * @memberOf _
  11936. * @since 4.0.0
  11937. * @category Lang
  11938. * @param {*} value The value to check.
  11939. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11940. * else `false`.
  11941. * @example
  11942. *
  11943. * _.isArrayLikeObject([1, 2, 3]);
  11944. * // => true
  11945. *
  11946. * _.isArrayLikeObject(document.body.children);
  11947. * // => true
  11948. *
  11949. * _.isArrayLikeObject('abc');
  11950. * // => false
  11951. *
  11952. * _.isArrayLikeObject(_.noop);
  11953. * // => false
  11954. */
  11955. function isArrayLikeObject(value) {
  11956. return isObjectLike(value) && isArrayLike(value);
  11957. }
  11958. /**
  11959. * Checks if `value` is classified as a boolean primitive or object.
  11960. *
  11961. * @static
  11962. * @memberOf _
  11963. * @since 0.1.0
  11964. * @category Lang
  11965. * @param {*} value The value to check.
  11966. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11967. * @example
  11968. *
  11969. * _.isBoolean(false);
  11970. * // => true
  11971. *
  11972. * _.isBoolean(null);
  11973. * // => false
  11974. */
  11975. function isBoolean(value) {
  11976. return value === true || value === false ||
  11977. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11978. }
  11979. /**
  11980. * Checks if `value` is a buffer.
  11981. *
  11982. * @static
  11983. * @memberOf _
  11984. * @since 4.3.0
  11985. * @category Lang
  11986. * @param {*} value The value to check.
  11987. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11988. * @example
  11989. *
  11990. * _.isBuffer(new Buffer(2));
  11991. * // => true
  11992. *
  11993. * _.isBuffer(new Uint8Array(2));
  11994. * // => false
  11995. */
  11996. var isBuffer = nativeIsBuffer || stubFalse;
  11997. /**
  11998. * Checks if `value` is classified as a `Date` object.
  11999. *
  12000. * @static
  12001. * @memberOf _
  12002. * @since 0.1.0
  12003. * @category Lang
  12004. * @param {*} value The value to check.
  12005. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12006. * @example
  12007. *
  12008. * _.isDate(new Date);
  12009. * // => true
  12010. *
  12011. * _.isDate('Mon April 23 2012');
  12012. * // => false
  12013. */
  12014. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12015. /**
  12016. * Checks if `value` is likely a DOM element.
  12017. *
  12018. * @static
  12019. * @memberOf _
  12020. * @since 0.1.0
  12021. * @category Lang
  12022. * @param {*} value The value to check.
  12023. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12024. * @example
  12025. *
  12026. * _.isElement(document.body);
  12027. * // => true
  12028. *
  12029. * _.isElement('<body>');
  12030. * // => false
  12031. */
  12032. function isElement(value) {
  12033. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12034. }
  12035. /**
  12036. * Checks if `value` is an empty object, collection, map, or set.
  12037. *
  12038. * Objects are considered empty if they have no own enumerable string keyed
  12039. * properties.
  12040. *
  12041. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12042. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12043. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12044. *
  12045. * @static
  12046. * @memberOf _
  12047. * @since 0.1.0
  12048. * @category Lang
  12049. * @param {*} value The value to check.
  12050. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12051. * @example
  12052. *
  12053. * _.isEmpty(null);
  12054. * // => true
  12055. *
  12056. * _.isEmpty(true);
  12057. * // => true
  12058. *
  12059. * _.isEmpty(1);
  12060. * // => true
  12061. *
  12062. * _.isEmpty([1, 2, 3]);
  12063. * // => false
  12064. *
  12065. * _.isEmpty({ 'a': 1 });
  12066. * // => false
  12067. */
  12068. function isEmpty(value) {
  12069. if (value == null) {
  12070. return true;
  12071. }
  12072. if (isArrayLike(value) &&
  12073. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12074. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12075. return !value.length;
  12076. }
  12077. var tag = getTag(value);
  12078. if (tag == mapTag || tag == setTag) {
  12079. return !value.size;
  12080. }
  12081. if (isPrototype(value)) {
  12082. return !baseKeys(value).length;
  12083. }
  12084. for (var key in value) {
  12085. if (hasOwnProperty.call(value, key)) {
  12086. return false;
  12087. }
  12088. }
  12089. return true;
  12090. }
  12091. /**
  12092. * Performs a deep comparison between two values to determine if they are
  12093. * equivalent.
  12094. *
  12095. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12096. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12097. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12098. * by their own, not inherited, enumerable properties. Functions and DOM
  12099. * nodes are compared by strict equality, i.e. `===`.
  12100. *
  12101. * @static
  12102. * @memberOf _
  12103. * @since 0.1.0
  12104. * @category Lang
  12105. * @param {*} value The value to compare.
  12106. * @param {*} other The other value to compare.
  12107. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12108. * @example
  12109. *
  12110. * var object = { 'a': 1 };
  12111. * var other = { 'a': 1 };
  12112. *
  12113. * _.isEqual(object, other);
  12114. * // => true
  12115. *
  12116. * object === other;
  12117. * // => false
  12118. */
  12119. function isEqual(value, other) {
  12120. return baseIsEqual(value, other);
  12121. }
  12122. /**
  12123. * This method is like `_.isEqual` except that it accepts `customizer` which
  12124. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12125. * are handled by the method instead. The `customizer` is invoked with up to
  12126. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12127. *
  12128. * @static
  12129. * @memberOf _
  12130. * @since 4.0.0
  12131. * @category Lang
  12132. * @param {*} value The value to compare.
  12133. * @param {*} other The other value to compare.
  12134. * @param {Function} [customizer] The function to customize comparisons.
  12135. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12136. * @example
  12137. *
  12138. * function isGreeting(value) {
  12139. * return /^h(?:i|ello)$/.test(value);
  12140. * }
  12141. *
  12142. * function customizer(objValue, othValue) {
  12143. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12144. * return true;
  12145. * }
  12146. * }
  12147. *
  12148. * var array = ['hello', 'goodbye'];
  12149. * var other = ['hi', 'goodbye'];
  12150. *
  12151. * _.isEqualWith(array, other, customizer);
  12152. * // => true
  12153. */
  12154. function isEqualWith(value, other, customizer) {
  12155. customizer = typeof customizer == 'function' ? customizer : undefined;
  12156. var result = customizer ? customizer(value, other) : undefined;
  12157. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12158. }
  12159. /**
  12160. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12161. * `SyntaxError`, `TypeError`, or `URIError` object.
  12162. *
  12163. * @static
  12164. * @memberOf _
  12165. * @since 3.0.0
  12166. * @category Lang
  12167. * @param {*} value The value to check.
  12168. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12169. * @example
  12170. *
  12171. * _.isError(new Error);
  12172. * // => true
  12173. *
  12174. * _.isError(Error);
  12175. * // => false
  12176. */
  12177. function isError(value) {
  12178. if (!isObjectLike(value)) {
  12179. return false;
  12180. }
  12181. var tag = baseGetTag(value);
  12182. return tag == errorTag || tag == domExcTag ||
  12183. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12184. }
  12185. /**
  12186. * Checks if `value` is a finite primitive number.
  12187. *
  12188. * **Note:** This method is based on
  12189. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12190. *
  12191. * @static
  12192. * @memberOf _
  12193. * @since 0.1.0
  12194. * @category Lang
  12195. * @param {*} value The value to check.
  12196. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12197. * @example
  12198. *
  12199. * _.isFinite(3);
  12200. * // => true
  12201. *
  12202. * _.isFinite(Number.MIN_VALUE);
  12203. * // => true
  12204. *
  12205. * _.isFinite(Infinity);
  12206. * // => false
  12207. *
  12208. * _.isFinite('3');
  12209. * // => false
  12210. */
  12211. function isFinite(value) {
  12212. return typeof value == 'number' && nativeIsFinite(value);
  12213. }
  12214. /**
  12215. * Checks if `value` is classified as a `Function` object.
  12216. *
  12217. * @static
  12218. * @memberOf _
  12219. * @since 0.1.0
  12220. * @category Lang
  12221. * @param {*} value The value to check.
  12222. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12223. * @example
  12224. *
  12225. * _.isFunction(_);
  12226. * // => true
  12227. *
  12228. * _.isFunction(/abc/);
  12229. * // => false
  12230. */
  12231. function isFunction(value) {
  12232. if (!isObject(value)) {
  12233. return false;
  12234. }
  12235. // The use of `Object#toString` avoids issues with the `typeof` operator
  12236. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12237. var tag = baseGetTag(value);
  12238. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12239. }
  12240. /**
  12241. * Checks if `value` is an integer.
  12242. *
  12243. * **Note:** This method is based on
  12244. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12245. *
  12246. * @static
  12247. * @memberOf _
  12248. * @since 4.0.0
  12249. * @category Lang
  12250. * @param {*} value The value to check.
  12251. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12252. * @example
  12253. *
  12254. * _.isInteger(3);
  12255. * // => true
  12256. *
  12257. * _.isInteger(Number.MIN_VALUE);
  12258. * // => false
  12259. *
  12260. * _.isInteger(Infinity);
  12261. * // => false
  12262. *
  12263. * _.isInteger('3');
  12264. * // => false
  12265. */
  12266. function isInteger(value) {
  12267. return typeof value == 'number' && value == toInteger(value);
  12268. }
  12269. /**
  12270. * Checks if `value` is a valid array-like length.
  12271. *
  12272. * **Note:** This method is loosely based on
  12273. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12274. *
  12275. * @static
  12276. * @memberOf _
  12277. * @since 4.0.0
  12278. * @category Lang
  12279. * @param {*} value The value to check.
  12280. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12281. * @example
  12282. *
  12283. * _.isLength(3);
  12284. * // => true
  12285. *
  12286. * _.isLength(Number.MIN_VALUE);
  12287. * // => false
  12288. *
  12289. * _.isLength(Infinity);
  12290. * // => false
  12291. *
  12292. * _.isLength('3');
  12293. * // => false
  12294. */
  12295. function isLength(value) {
  12296. return typeof value == 'number' &&
  12297. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12298. }
  12299. /**
  12300. * Checks if `value` is the
  12301. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12302. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12303. *
  12304. * @static
  12305. * @memberOf _
  12306. * @since 0.1.0
  12307. * @category Lang
  12308. * @param {*} value The value to check.
  12309. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12310. * @example
  12311. *
  12312. * _.isObject({});
  12313. * // => true
  12314. *
  12315. * _.isObject([1, 2, 3]);
  12316. * // => true
  12317. *
  12318. * _.isObject(_.noop);
  12319. * // => true
  12320. *
  12321. * _.isObject(null);
  12322. * // => false
  12323. */
  12324. function isObject(value) {
  12325. var type = typeof value;
  12326. return value != null && (type == 'object' || type == 'function');
  12327. }
  12328. /**
  12329. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12330. * and has a `typeof` result of "object".
  12331. *
  12332. * @static
  12333. * @memberOf _
  12334. * @since 4.0.0
  12335. * @category Lang
  12336. * @param {*} value The value to check.
  12337. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12338. * @example
  12339. *
  12340. * _.isObjectLike({});
  12341. * // => true
  12342. *
  12343. * _.isObjectLike([1, 2, 3]);
  12344. * // => true
  12345. *
  12346. * _.isObjectLike(_.noop);
  12347. * // => false
  12348. *
  12349. * _.isObjectLike(null);
  12350. * // => false
  12351. */
  12352. function isObjectLike(value) {
  12353. return value != null && typeof value == 'object';
  12354. }
  12355. /**
  12356. * Checks if `value` is classified as a `Map` object.
  12357. *
  12358. * @static
  12359. * @memberOf _
  12360. * @since 4.3.0
  12361. * @category Lang
  12362. * @param {*} value The value to check.
  12363. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12364. * @example
  12365. *
  12366. * _.isMap(new Map);
  12367. * // => true
  12368. *
  12369. * _.isMap(new WeakMap);
  12370. * // => false
  12371. */
  12372. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12373. /**
  12374. * Performs a partial deep comparison between `object` and `source` to
  12375. * determine if `object` contains equivalent property values.
  12376. *
  12377. * **Note:** This method is equivalent to `_.matches` when `source` is
  12378. * partially applied.
  12379. *
  12380. * Partial comparisons will match empty array and empty object `source`
  12381. * values against any array or object value, respectively. See `_.isEqual`
  12382. * for a list of supported value comparisons.
  12383. *
  12384. * @static
  12385. * @memberOf _
  12386. * @since 3.0.0
  12387. * @category Lang
  12388. * @param {Object} object The object to inspect.
  12389. * @param {Object} source The object of property values to match.
  12390. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12391. * @example
  12392. *
  12393. * var object = { 'a': 1, 'b': 2 };
  12394. *
  12395. * _.isMatch(object, { 'b': 2 });
  12396. * // => true
  12397. *
  12398. * _.isMatch(object, { 'b': 1 });
  12399. * // => false
  12400. */
  12401. function isMatch(object, source) {
  12402. return object === source || baseIsMatch(object, source, getMatchData(source));
  12403. }
  12404. /**
  12405. * This method is like `_.isMatch` except that it accepts `customizer` which
  12406. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12407. * are handled by the method instead. The `customizer` is invoked with five
  12408. * arguments: (objValue, srcValue, index|key, object, source).
  12409. *
  12410. * @static
  12411. * @memberOf _
  12412. * @since 4.0.0
  12413. * @category Lang
  12414. * @param {Object} object The object to inspect.
  12415. * @param {Object} source The object of property values to match.
  12416. * @param {Function} [customizer] The function to customize comparisons.
  12417. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12418. * @example
  12419. *
  12420. * function isGreeting(value) {
  12421. * return /^h(?:i|ello)$/.test(value);
  12422. * }
  12423. *
  12424. * function customizer(objValue, srcValue) {
  12425. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12426. * return true;
  12427. * }
  12428. * }
  12429. *
  12430. * var object = { 'greeting': 'hello' };
  12431. * var source = { 'greeting': 'hi' };
  12432. *
  12433. * _.isMatchWith(object, source, customizer);
  12434. * // => true
  12435. */
  12436. function isMatchWith(object, source, customizer) {
  12437. customizer = typeof customizer == 'function' ? customizer : undefined;
  12438. return baseIsMatch(object, source, getMatchData(source), customizer);
  12439. }
  12440. /**
  12441. * Checks if `value` is `NaN`.
  12442. *
  12443. * **Note:** This method is based on
  12444. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12445. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12446. * `undefined` and other non-number values.
  12447. *
  12448. * @static
  12449. * @memberOf _
  12450. * @since 0.1.0
  12451. * @category Lang
  12452. * @param {*} value The value to check.
  12453. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12454. * @example
  12455. *
  12456. * _.isNaN(NaN);
  12457. * // => true
  12458. *
  12459. * _.isNaN(new Number(NaN));
  12460. * // => true
  12461. *
  12462. * isNaN(undefined);
  12463. * // => true
  12464. *
  12465. * _.isNaN(undefined);
  12466. * // => false
  12467. */
  12468. function isNaN(value) {
  12469. // An `NaN` primitive is the only value that is not equal to itself.
  12470. // Perform the `toStringTag` check first to avoid errors with some
  12471. // ActiveX objects in IE.
  12472. return isNumber(value) && value != +value;
  12473. }
  12474. /**
  12475. * Checks if `value` is a pristine native function.
  12476. *
  12477. * **Note:** This method can't reliably detect native functions in the presence
  12478. * of the core-js package because core-js circumvents this kind of detection.
  12479. * Despite multiple requests, the core-js maintainer has made it clear: any
  12480. * attempt to fix the detection will be obstructed. As a result, we're left
  12481. * with little choice but to throw an error. Unfortunately, this also affects
  12482. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12483. * which rely on core-js.
  12484. *
  12485. * @static
  12486. * @memberOf _
  12487. * @since 3.0.0
  12488. * @category Lang
  12489. * @param {*} value The value to check.
  12490. * @returns {boolean} Returns `true` if `value` is a native function,
  12491. * else `false`.
  12492. * @example
  12493. *
  12494. * _.isNative(Array.prototype.push);
  12495. * // => true
  12496. *
  12497. * _.isNative(_);
  12498. * // => false
  12499. */
  12500. function isNative(value) {
  12501. if (isMaskable(value)) {
  12502. throw new Error(CORE_ERROR_TEXT);
  12503. }
  12504. return baseIsNative(value);
  12505. }
  12506. /**
  12507. * Checks if `value` is `null`.
  12508. *
  12509. * @static
  12510. * @memberOf _
  12511. * @since 0.1.0
  12512. * @category Lang
  12513. * @param {*} value The value to check.
  12514. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12515. * @example
  12516. *
  12517. * _.isNull(null);
  12518. * // => true
  12519. *
  12520. * _.isNull(void 0);
  12521. * // => false
  12522. */
  12523. function isNull(value) {
  12524. return value === null;
  12525. }
  12526. /**
  12527. * Checks if `value` is `null` or `undefined`.
  12528. *
  12529. * @static
  12530. * @memberOf _
  12531. * @since 4.0.0
  12532. * @category Lang
  12533. * @param {*} value The value to check.
  12534. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12535. * @example
  12536. *
  12537. * _.isNil(null);
  12538. * // => true
  12539. *
  12540. * _.isNil(void 0);
  12541. * // => true
  12542. *
  12543. * _.isNil(NaN);
  12544. * // => false
  12545. */
  12546. function isNil(value) {
  12547. return value == null;
  12548. }
  12549. /**
  12550. * Checks if `value` is classified as a `Number` primitive or object.
  12551. *
  12552. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12553. * classified as numbers, use the `_.isFinite` method.
  12554. *
  12555. * @static
  12556. * @memberOf _
  12557. * @since 0.1.0
  12558. * @category Lang
  12559. * @param {*} value The value to check.
  12560. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12561. * @example
  12562. *
  12563. * _.isNumber(3);
  12564. * // => true
  12565. *
  12566. * _.isNumber(Number.MIN_VALUE);
  12567. * // => true
  12568. *
  12569. * _.isNumber(Infinity);
  12570. * // => true
  12571. *
  12572. * _.isNumber('3');
  12573. * // => false
  12574. */
  12575. function isNumber(value) {
  12576. return typeof value == 'number' ||
  12577. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12578. }
  12579. /**
  12580. * Checks if `value` is a plain object, that is, an object created by the
  12581. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12582. *
  12583. * @static
  12584. * @memberOf _
  12585. * @since 0.8.0
  12586. * @category Lang
  12587. * @param {*} value The value to check.
  12588. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12589. * @example
  12590. *
  12591. * function Foo() {
  12592. * this.a = 1;
  12593. * }
  12594. *
  12595. * _.isPlainObject(new Foo);
  12596. * // => false
  12597. *
  12598. * _.isPlainObject([1, 2, 3]);
  12599. * // => false
  12600. *
  12601. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12602. * // => true
  12603. *
  12604. * _.isPlainObject(Object.create(null));
  12605. * // => true
  12606. */
  12607. function isPlainObject(value) {
  12608. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12609. return false;
  12610. }
  12611. var proto = getPrototype(value);
  12612. if (proto === null) {
  12613. return true;
  12614. }
  12615. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12616. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12617. funcToString.call(Ctor) == objectCtorString;
  12618. }
  12619. /**
  12620. * Checks if `value` is classified as a `RegExp` object.
  12621. *
  12622. * @static
  12623. * @memberOf _
  12624. * @since 0.1.0
  12625. * @category Lang
  12626. * @param {*} value The value to check.
  12627. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12628. * @example
  12629. *
  12630. * _.isRegExp(/abc/);
  12631. * // => true
  12632. *
  12633. * _.isRegExp('/abc/');
  12634. * // => false
  12635. */
  12636. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12637. /**
  12638. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12639. * double precision number which isn't the result of a rounded unsafe integer.
  12640. *
  12641. * **Note:** This method is based on
  12642. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12643. *
  12644. * @static
  12645. * @memberOf _
  12646. * @since 4.0.0
  12647. * @category Lang
  12648. * @param {*} value The value to check.
  12649. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12650. * @example
  12651. *
  12652. * _.isSafeInteger(3);
  12653. * // => true
  12654. *
  12655. * _.isSafeInteger(Number.MIN_VALUE);
  12656. * // => false
  12657. *
  12658. * _.isSafeInteger(Infinity);
  12659. * // => false
  12660. *
  12661. * _.isSafeInteger('3');
  12662. * // => false
  12663. */
  12664. function isSafeInteger(value) {
  12665. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12666. }
  12667. /**
  12668. * Checks if `value` is classified as a `Set` object.
  12669. *
  12670. * @static
  12671. * @memberOf _
  12672. * @since 4.3.0
  12673. * @category Lang
  12674. * @param {*} value The value to check.
  12675. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12676. * @example
  12677. *
  12678. * _.isSet(new Set);
  12679. * // => true
  12680. *
  12681. * _.isSet(new WeakSet);
  12682. * // => false
  12683. */
  12684. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12685. /**
  12686. * Checks if `value` is classified as a `String` primitive or object.
  12687. *
  12688. * @static
  12689. * @since 0.1.0
  12690. * @memberOf _
  12691. * @category Lang
  12692. * @param {*} value The value to check.
  12693. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12694. * @example
  12695. *
  12696. * _.isString('abc');
  12697. * // => true
  12698. *
  12699. * _.isString(1);
  12700. * // => false
  12701. */
  12702. function isString(value) {
  12703. return typeof value == 'string' ||
  12704. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12705. }
  12706. /**
  12707. * Checks if `value` is classified as a `Symbol` primitive or object.
  12708. *
  12709. * @static
  12710. * @memberOf _
  12711. * @since 4.0.0
  12712. * @category Lang
  12713. * @param {*} value The value to check.
  12714. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12715. * @example
  12716. *
  12717. * _.isSymbol(Symbol.iterator);
  12718. * // => true
  12719. *
  12720. * _.isSymbol('abc');
  12721. * // => false
  12722. */
  12723. function isSymbol(value) {
  12724. return typeof value == 'symbol' ||
  12725. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12726. }
  12727. /**
  12728. * Checks if `value` is classified as a typed array.
  12729. *
  12730. * @static
  12731. * @memberOf _
  12732. * @since 3.0.0
  12733. * @category Lang
  12734. * @param {*} value The value to check.
  12735. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12736. * @example
  12737. *
  12738. * _.isTypedArray(new Uint8Array);
  12739. * // => true
  12740. *
  12741. * _.isTypedArray([]);
  12742. * // => false
  12743. */
  12744. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12745. /**
  12746. * Checks if `value` is `undefined`.
  12747. *
  12748. * @static
  12749. * @since 0.1.0
  12750. * @memberOf _
  12751. * @category Lang
  12752. * @param {*} value The value to check.
  12753. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12754. * @example
  12755. *
  12756. * _.isUndefined(void 0);
  12757. * // => true
  12758. *
  12759. * _.isUndefined(null);
  12760. * // => false
  12761. */
  12762. function isUndefined(value) {
  12763. return value === undefined;
  12764. }
  12765. /**
  12766. * Checks if `value` is classified as a `WeakMap` object.
  12767. *
  12768. * @static
  12769. * @memberOf _
  12770. * @since 4.3.0
  12771. * @category Lang
  12772. * @param {*} value The value to check.
  12773. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12774. * @example
  12775. *
  12776. * _.isWeakMap(new WeakMap);
  12777. * // => true
  12778. *
  12779. * _.isWeakMap(new Map);
  12780. * // => false
  12781. */
  12782. function isWeakMap(value) {
  12783. return isObjectLike(value) && getTag(value) == weakMapTag;
  12784. }
  12785. /**
  12786. * Checks if `value` is classified as a `WeakSet` object.
  12787. *
  12788. * @static
  12789. * @memberOf _
  12790. * @since 4.3.0
  12791. * @category Lang
  12792. * @param {*} value The value to check.
  12793. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12794. * @example
  12795. *
  12796. * _.isWeakSet(new WeakSet);
  12797. * // => true
  12798. *
  12799. * _.isWeakSet(new Set);
  12800. * // => false
  12801. */
  12802. function isWeakSet(value) {
  12803. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12804. }
  12805. /**
  12806. * Checks if `value` is less than `other`.
  12807. *
  12808. * @static
  12809. * @memberOf _
  12810. * @since 3.9.0
  12811. * @category Lang
  12812. * @param {*} value The value to compare.
  12813. * @param {*} other The other value to compare.
  12814. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12815. * else `false`.
  12816. * @see _.gt
  12817. * @example
  12818. *
  12819. * _.lt(1, 3);
  12820. * // => true
  12821. *
  12822. * _.lt(3, 3);
  12823. * // => false
  12824. *
  12825. * _.lt(3, 1);
  12826. * // => false
  12827. */
  12828. var lt = createRelationalOperation(baseLt);
  12829. /**
  12830. * Checks if `value` is less than or equal to `other`.
  12831. *
  12832. * @static
  12833. * @memberOf _
  12834. * @since 3.9.0
  12835. * @category Lang
  12836. * @param {*} value The value to compare.
  12837. * @param {*} other The other value to compare.
  12838. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12839. * `other`, else `false`.
  12840. * @see _.gte
  12841. * @example
  12842. *
  12843. * _.lte(1, 3);
  12844. * // => true
  12845. *
  12846. * _.lte(3, 3);
  12847. * // => true
  12848. *
  12849. * _.lte(3, 1);
  12850. * // => false
  12851. */
  12852. var lte = createRelationalOperation(function(value, other) {
  12853. return value <= other;
  12854. });
  12855. /**
  12856. * Converts `value` to an array.
  12857. *
  12858. * @static
  12859. * @since 0.1.0
  12860. * @memberOf _
  12861. * @category Lang
  12862. * @param {*} value The value to convert.
  12863. * @returns {Array} Returns the converted array.
  12864. * @example
  12865. *
  12866. * _.toArray({ 'a': 1, 'b': 2 });
  12867. * // => [1, 2]
  12868. *
  12869. * _.toArray('abc');
  12870. * // => ['a', 'b', 'c']
  12871. *
  12872. * _.toArray(1);
  12873. * // => []
  12874. *
  12875. * _.toArray(null);
  12876. * // => []
  12877. */
  12878. function toArray(value) {
  12879. if (!value) {
  12880. return [];
  12881. }
  12882. if (isArrayLike(value)) {
  12883. return isString(value) ? stringToArray(value) : copyArray(value);
  12884. }
  12885. if (symIterator && value[symIterator]) {
  12886. return iteratorToArray(value[symIterator]());
  12887. }
  12888. var tag = getTag(value),
  12889. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12890. return func(value);
  12891. }
  12892. /**
  12893. * Converts `value` to a finite number.
  12894. *
  12895. * @static
  12896. * @memberOf _
  12897. * @since 4.12.0
  12898. * @category Lang
  12899. * @param {*} value The value to convert.
  12900. * @returns {number} Returns the converted number.
  12901. * @example
  12902. *
  12903. * _.toFinite(3.2);
  12904. * // => 3.2
  12905. *
  12906. * _.toFinite(Number.MIN_VALUE);
  12907. * // => 5e-324
  12908. *
  12909. * _.toFinite(Infinity);
  12910. * // => 1.7976931348623157e+308
  12911. *
  12912. * _.toFinite('3.2');
  12913. * // => 3.2
  12914. */
  12915. function toFinite(value) {
  12916. if (!value) {
  12917. return value === 0 ? value : 0;
  12918. }
  12919. value = toNumber(value);
  12920. if (value === INFINITY || value === -INFINITY) {
  12921. var sign = (value < 0 ? -1 : 1);
  12922. return sign * MAX_INTEGER;
  12923. }
  12924. return value === value ? value : 0;
  12925. }
  12926. /**
  12927. * Converts `value` to an integer.
  12928. *
  12929. * **Note:** This method is loosely based on
  12930. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12931. *
  12932. * @static
  12933. * @memberOf _
  12934. * @since 4.0.0
  12935. * @category Lang
  12936. * @param {*} value The value to convert.
  12937. * @returns {number} Returns the converted integer.
  12938. * @example
  12939. *
  12940. * _.toInteger(3.2);
  12941. * // => 3
  12942. *
  12943. * _.toInteger(Number.MIN_VALUE);
  12944. * // => 0
  12945. *
  12946. * _.toInteger(Infinity);
  12947. * // => 1.7976931348623157e+308
  12948. *
  12949. * _.toInteger('3.2');
  12950. * // => 3
  12951. */
  12952. function toInteger(value) {
  12953. var result = toFinite(value),
  12954. remainder = result % 1;
  12955. return result === result ? (remainder ? result - remainder : result) : 0;
  12956. }
  12957. /**
  12958. * Converts `value` to an integer suitable for use as the length of an
  12959. * array-like object.
  12960. *
  12961. * **Note:** This method is based on
  12962. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12963. *
  12964. * @static
  12965. * @memberOf _
  12966. * @since 4.0.0
  12967. * @category Lang
  12968. * @param {*} value The value to convert.
  12969. * @returns {number} Returns the converted integer.
  12970. * @example
  12971. *
  12972. * _.toLength(3.2);
  12973. * // => 3
  12974. *
  12975. * _.toLength(Number.MIN_VALUE);
  12976. * // => 0
  12977. *
  12978. * _.toLength(Infinity);
  12979. * // => 4294967295
  12980. *
  12981. * _.toLength('3.2');
  12982. * // => 3
  12983. */
  12984. function toLength(value) {
  12985. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12986. }
  12987. /**
  12988. * Converts `value` to a number.
  12989. *
  12990. * @static
  12991. * @memberOf _
  12992. * @since 4.0.0
  12993. * @category Lang
  12994. * @param {*} value The value to process.
  12995. * @returns {number} Returns the number.
  12996. * @example
  12997. *
  12998. * _.toNumber(3.2);
  12999. * // => 3.2
  13000. *
  13001. * _.toNumber(Number.MIN_VALUE);
  13002. * // => 5e-324
  13003. *
  13004. * _.toNumber(Infinity);
  13005. * // => Infinity
  13006. *
  13007. * _.toNumber('3.2');
  13008. * // => 3.2
  13009. */
  13010. function toNumber(value) {
  13011. if (typeof value == 'number') {
  13012. return value;
  13013. }
  13014. if (isSymbol(value)) {
  13015. return NAN;
  13016. }
  13017. if (isObject(value)) {
  13018. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13019. value = isObject(other) ? (other + '') : other;
  13020. }
  13021. if (typeof value != 'string') {
  13022. return value === 0 ? value : +value;
  13023. }
  13024. value = baseTrim(value);
  13025. var isBinary = reIsBinary.test(value);
  13026. return (isBinary || reIsOctal.test(value))
  13027. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13028. : (reIsBadHex.test(value) ? NAN : +value);
  13029. }
  13030. /**
  13031. * Converts `value` to a plain object flattening inherited enumerable string
  13032. * keyed properties of `value` to own properties of the plain object.
  13033. *
  13034. * @static
  13035. * @memberOf _
  13036. * @since 3.0.0
  13037. * @category Lang
  13038. * @param {*} value The value to convert.
  13039. * @returns {Object} Returns the converted plain object.
  13040. * @example
  13041. *
  13042. * function Foo() {
  13043. * this.b = 2;
  13044. * }
  13045. *
  13046. * Foo.prototype.c = 3;
  13047. *
  13048. * _.assign({ 'a': 1 }, new Foo);
  13049. * // => { 'a': 1, 'b': 2 }
  13050. *
  13051. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13052. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13053. */
  13054. function toPlainObject(value) {
  13055. return copyObject(value, keysIn(value));
  13056. }
  13057. /**
  13058. * Converts `value` to a safe integer. A safe integer can be compared and
  13059. * represented correctly.
  13060. *
  13061. * @static
  13062. * @memberOf _
  13063. * @since 4.0.0
  13064. * @category Lang
  13065. * @param {*} value The value to convert.
  13066. * @returns {number} Returns the converted integer.
  13067. * @example
  13068. *
  13069. * _.toSafeInteger(3.2);
  13070. * // => 3
  13071. *
  13072. * _.toSafeInteger(Number.MIN_VALUE);
  13073. * // => 0
  13074. *
  13075. * _.toSafeInteger(Infinity);
  13076. * // => 9007199254740991
  13077. *
  13078. * _.toSafeInteger('3.2');
  13079. * // => 3
  13080. */
  13081. function toSafeInteger(value) {
  13082. return value
  13083. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13084. : (value === 0 ? value : 0);
  13085. }
  13086. /**
  13087. * Converts `value` to a string. An empty string is returned for `null`
  13088. * and `undefined` values. The sign of `-0` is preserved.
  13089. *
  13090. * @static
  13091. * @memberOf _
  13092. * @since 4.0.0
  13093. * @category Lang
  13094. * @param {*} value The value to convert.
  13095. * @returns {string} Returns the converted string.
  13096. * @example
  13097. *
  13098. * _.toString(null);
  13099. * // => ''
  13100. *
  13101. * _.toString(-0);
  13102. * // => '-0'
  13103. *
  13104. * _.toString([1, 2, 3]);
  13105. * // => '1,2,3'
  13106. */
  13107. function toString(value) {
  13108. return value == null ? '' : baseToString(value);
  13109. }
  13110. /*------------------------------------------------------------------------*/
  13111. /**
  13112. * Assigns own enumerable string keyed properties of source objects to the
  13113. * destination object. Source objects are applied from left to right.
  13114. * Subsequent sources overwrite property assignments of previous sources.
  13115. *
  13116. * **Note:** This method mutates `object` and is loosely based on
  13117. * [`Object.assign`](https://mdn.io/Object/assign).
  13118. *
  13119. * @static
  13120. * @memberOf _
  13121. * @since 0.10.0
  13122. * @category Object
  13123. * @param {Object} object The destination object.
  13124. * @param {...Object} [sources] The source objects.
  13125. * @returns {Object} Returns `object`.
  13126. * @see _.assignIn
  13127. * @example
  13128. *
  13129. * function Foo() {
  13130. * this.a = 1;
  13131. * }
  13132. *
  13133. * function Bar() {
  13134. * this.c = 3;
  13135. * }
  13136. *
  13137. * Foo.prototype.b = 2;
  13138. * Bar.prototype.d = 4;
  13139. *
  13140. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13141. * // => { 'a': 1, 'c': 3 }
  13142. */
  13143. var assign = createAssigner(function(object, source) {
  13144. if (isPrototype(source) || isArrayLike(source)) {
  13145. copyObject(source, keys(source), object);
  13146. return;
  13147. }
  13148. for (var key in source) {
  13149. if (hasOwnProperty.call(source, key)) {
  13150. assignValue(object, key, source[key]);
  13151. }
  13152. }
  13153. });
  13154. /**
  13155. * This method is like `_.assign` except that it iterates over own and
  13156. * inherited source properties.
  13157. *
  13158. * **Note:** This method mutates `object`.
  13159. *
  13160. * @static
  13161. * @memberOf _
  13162. * @since 4.0.0
  13163. * @alias extend
  13164. * @category Object
  13165. * @param {Object} object The destination object.
  13166. * @param {...Object} [sources] The source objects.
  13167. * @returns {Object} Returns `object`.
  13168. * @see _.assign
  13169. * @example
  13170. *
  13171. * function Foo() {
  13172. * this.a = 1;
  13173. * }
  13174. *
  13175. * function Bar() {
  13176. * this.c = 3;
  13177. * }
  13178. *
  13179. * Foo.prototype.b = 2;
  13180. * Bar.prototype.d = 4;
  13181. *
  13182. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13183. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13184. */
  13185. var assignIn = createAssigner(function(object, source) {
  13186. copyObject(source, keysIn(source), object);
  13187. });
  13188. /**
  13189. * This method is like `_.assignIn` except that it accepts `customizer`
  13190. * which is invoked to produce the assigned values. If `customizer` returns
  13191. * `undefined`, assignment is handled by the method instead. The `customizer`
  13192. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13193. *
  13194. * **Note:** This method mutates `object`.
  13195. *
  13196. * @static
  13197. * @memberOf _
  13198. * @since 4.0.0
  13199. * @alias extendWith
  13200. * @category Object
  13201. * @param {Object} object The destination object.
  13202. * @param {...Object} sources The source objects.
  13203. * @param {Function} [customizer] The function to customize assigned values.
  13204. * @returns {Object} Returns `object`.
  13205. * @see _.assignWith
  13206. * @example
  13207. *
  13208. * function customizer(objValue, srcValue) {
  13209. * return _.isUndefined(objValue) ? srcValue : objValue;
  13210. * }
  13211. *
  13212. * var defaults = _.partialRight(_.assignInWith, customizer);
  13213. *
  13214. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13215. * // => { 'a': 1, 'b': 2 }
  13216. */
  13217. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13218. copyObject(source, keysIn(source), object, customizer);
  13219. });
  13220. /**
  13221. * This method is like `_.assign` except that it accepts `customizer`
  13222. * which is invoked to produce the assigned values. If `customizer` returns
  13223. * `undefined`, assignment is handled by the method instead. The `customizer`
  13224. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13225. *
  13226. * **Note:** This method mutates `object`.
  13227. *
  13228. * @static
  13229. * @memberOf _
  13230. * @since 4.0.0
  13231. * @category Object
  13232. * @param {Object} object The destination object.
  13233. * @param {...Object} sources The source objects.
  13234. * @param {Function} [customizer] The function to customize assigned values.
  13235. * @returns {Object} Returns `object`.
  13236. * @see _.assignInWith
  13237. * @example
  13238. *
  13239. * function customizer(objValue, srcValue) {
  13240. * return _.isUndefined(objValue) ? srcValue : objValue;
  13241. * }
  13242. *
  13243. * var defaults = _.partialRight(_.assignWith, customizer);
  13244. *
  13245. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13246. * // => { 'a': 1, 'b': 2 }
  13247. */
  13248. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13249. copyObject(source, keys(source), object, customizer);
  13250. });
  13251. /**
  13252. * Creates an array of values corresponding to `paths` of `object`.
  13253. *
  13254. * @static
  13255. * @memberOf _
  13256. * @since 1.0.0
  13257. * @category Object
  13258. * @param {Object} object The object to iterate over.
  13259. * @param {...(string|string[])} [paths] The property paths to pick.
  13260. * @returns {Array} Returns the picked values.
  13261. * @example
  13262. *
  13263. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13264. *
  13265. * _.at(object, ['a[0].b.c', 'a[1]']);
  13266. * // => [3, 4]
  13267. */
  13268. var at = flatRest(baseAt);
  13269. /**
  13270. * Creates an object that inherits from the `prototype` object. If a
  13271. * `properties` object is given, its own enumerable string keyed properties
  13272. * are assigned to the created object.
  13273. *
  13274. * @static
  13275. * @memberOf _
  13276. * @since 2.3.0
  13277. * @category Object
  13278. * @param {Object} prototype The object to inherit from.
  13279. * @param {Object} [properties] The properties to assign to the object.
  13280. * @returns {Object} Returns the new object.
  13281. * @example
  13282. *
  13283. * function Shape() {
  13284. * this.x = 0;
  13285. * this.y = 0;
  13286. * }
  13287. *
  13288. * function Circle() {
  13289. * Shape.call(this);
  13290. * }
  13291. *
  13292. * Circle.prototype = _.create(Shape.prototype, {
  13293. * 'constructor': Circle
  13294. * });
  13295. *
  13296. * var circle = new Circle;
  13297. * circle instanceof Circle;
  13298. * // => true
  13299. *
  13300. * circle instanceof Shape;
  13301. * // => true
  13302. */
  13303. function create(prototype, properties) {
  13304. var result = baseCreate(prototype);
  13305. return properties == null ? result : baseAssign(result, properties);
  13306. }
  13307. /**
  13308. * Assigns own and inherited enumerable string keyed properties of source
  13309. * objects to the destination object for all destination properties that
  13310. * resolve to `undefined`. Source objects are applied from left to right.
  13311. * Once a property is set, additional values of the same property are ignored.
  13312. *
  13313. * **Note:** This method mutates `object`.
  13314. *
  13315. * @static
  13316. * @since 0.1.0
  13317. * @memberOf _
  13318. * @category Object
  13319. * @param {Object} object The destination object.
  13320. * @param {...Object} [sources] The source objects.
  13321. * @returns {Object} Returns `object`.
  13322. * @see _.defaultsDeep
  13323. * @example
  13324. *
  13325. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13326. * // => { 'a': 1, 'b': 2 }
  13327. */
  13328. var defaults = baseRest(function(object, sources) {
  13329. object = Object(object);
  13330. var index = -1;
  13331. var length = sources.length;
  13332. var guard = length > 2 ? sources[2] : undefined;
  13333. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13334. length = 1;
  13335. }
  13336. while (++index < length) {
  13337. var source = sources[index];
  13338. var props = keysIn(source);
  13339. var propsIndex = -1;
  13340. var propsLength = props.length;
  13341. while (++propsIndex < propsLength) {
  13342. var key = props[propsIndex];
  13343. var value = object[key];
  13344. if (value === undefined ||
  13345. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13346. object[key] = source[key];
  13347. }
  13348. }
  13349. }
  13350. return object;
  13351. });
  13352. /**
  13353. * This method is like `_.defaults` except that it recursively assigns
  13354. * default properties.
  13355. *
  13356. * **Note:** This method mutates `object`.
  13357. *
  13358. * @static
  13359. * @memberOf _
  13360. * @since 3.10.0
  13361. * @category Object
  13362. * @param {Object} object The destination object.
  13363. * @param {...Object} [sources] The source objects.
  13364. * @returns {Object} Returns `object`.
  13365. * @see _.defaults
  13366. * @example
  13367. *
  13368. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13369. * // => { 'a': { 'b': 2, 'c': 3 } }
  13370. */
  13371. var defaultsDeep = baseRest(function(args) {
  13372. args.push(undefined, customDefaultsMerge);
  13373. return apply(mergeWith, undefined, args);
  13374. });
  13375. /**
  13376. * This method is like `_.find` except that it returns the key of the first
  13377. * element `predicate` returns truthy for instead of the element itself.
  13378. *
  13379. * @static
  13380. * @memberOf _
  13381. * @since 1.1.0
  13382. * @category Object
  13383. * @param {Object} object The object to inspect.
  13384. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13385. * @returns {string|undefined} Returns the key of the matched element,
  13386. * else `undefined`.
  13387. * @example
  13388. *
  13389. * var users = {
  13390. * 'barney': { 'age': 36, 'active': true },
  13391. * 'fred': { 'age': 40, 'active': false },
  13392. * 'pebbles': { 'age': 1, 'active': true }
  13393. * };
  13394. *
  13395. * _.findKey(users, function(o) { return o.age < 40; });
  13396. * // => 'barney' (iteration order is not guaranteed)
  13397. *
  13398. * // The `_.matches` iteratee shorthand.
  13399. * _.findKey(users, { 'age': 1, 'active': true });
  13400. * // => 'pebbles'
  13401. *
  13402. * // The `_.matchesProperty` iteratee shorthand.
  13403. * _.findKey(users, ['active', false]);
  13404. * // => 'fred'
  13405. *
  13406. * // The `_.property` iteratee shorthand.
  13407. * _.findKey(users, 'active');
  13408. * // => 'barney'
  13409. */
  13410. function findKey(object, predicate) {
  13411. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13412. }
  13413. /**
  13414. * This method is like `_.findKey` except that it iterates over elements of
  13415. * a collection in the opposite order.
  13416. *
  13417. * @static
  13418. * @memberOf _
  13419. * @since 2.0.0
  13420. * @category Object
  13421. * @param {Object} object The object to inspect.
  13422. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13423. * @returns {string|undefined} Returns the key of the matched element,
  13424. * else `undefined`.
  13425. * @example
  13426. *
  13427. * var users = {
  13428. * 'barney': { 'age': 36, 'active': true },
  13429. * 'fred': { 'age': 40, 'active': false },
  13430. * 'pebbles': { 'age': 1, 'active': true }
  13431. * };
  13432. *
  13433. * _.findLastKey(users, function(o) { return o.age < 40; });
  13434. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13435. *
  13436. * // The `_.matches` iteratee shorthand.
  13437. * _.findLastKey(users, { 'age': 36, 'active': true });
  13438. * // => 'barney'
  13439. *
  13440. * // The `_.matchesProperty` iteratee shorthand.
  13441. * _.findLastKey(users, ['active', false]);
  13442. * // => 'fred'
  13443. *
  13444. * // The `_.property` iteratee shorthand.
  13445. * _.findLastKey(users, 'active');
  13446. * // => 'pebbles'
  13447. */
  13448. function findLastKey(object, predicate) {
  13449. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13450. }
  13451. /**
  13452. * Iterates over own and inherited enumerable string keyed properties of an
  13453. * object and invokes `iteratee` for each property. The iteratee is invoked
  13454. * with three arguments: (value, key, object). Iteratee functions may exit
  13455. * iteration early by explicitly returning `false`.
  13456. *
  13457. * @static
  13458. * @memberOf _
  13459. * @since 0.3.0
  13460. * @category Object
  13461. * @param {Object} object The object to iterate over.
  13462. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13463. * @returns {Object} Returns `object`.
  13464. * @see _.forInRight
  13465. * @example
  13466. *
  13467. * function Foo() {
  13468. * this.a = 1;
  13469. * this.b = 2;
  13470. * }
  13471. *
  13472. * Foo.prototype.c = 3;
  13473. *
  13474. * _.forIn(new Foo, function(value, key) {
  13475. * console.log(key);
  13476. * });
  13477. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13478. */
  13479. function forIn(object, iteratee) {
  13480. return object == null
  13481. ? object
  13482. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13483. }
  13484. /**
  13485. * This method is like `_.forIn` except that it iterates over properties of
  13486. * `object` in the opposite order.
  13487. *
  13488. * @static
  13489. * @memberOf _
  13490. * @since 2.0.0
  13491. * @category Object
  13492. * @param {Object} object The object to iterate over.
  13493. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13494. * @returns {Object} Returns `object`.
  13495. * @see _.forIn
  13496. * @example
  13497. *
  13498. * function Foo() {
  13499. * this.a = 1;
  13500. * this.b = 2;
  13501. * }
  13502. *
  13503. * Foo.prototype.c = 3;
  13504. *
  13505. * _.forInRight(new Foo, function(value, key) {
  13506. * console.log(key);
  13507. * });
  13508. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13509. */
  13510. function forInRight(object, iteratee) {
  13511. return object == null
  13512. ? object
  13513. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13514. }
  13515. /**
  13516. * Iterates over own enumerable string keyed properties of an object and
  13517. * invokes `iteratee` for each property. The iteratee is invoked with three
  13518. * arguments: (value, key, object). Iteratee functions may exit iteration
  13519. * early by explicitly returning `false`.
  13520. *
  13521. * @static
  13522. * @memberOf _
  13523. * @since 0.3.0
  13524. * @category Object
  13525. * @param {Object} object The object to iterate over.
  13526. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13527. * @returns {Object} Returns `object`.
  13528. * @see _.forOwnRight
  13529. * @example
  13530. *
  13531. * function Foo() {
  13532. * this.a = 1;
  13533. * this.b = 2;
  13534. * }
  13535. *
  13536. * Foo.prototype.c = 3;
  13537. *
  13538. * _.forOwn(new Foo, function(value, key) {
  13539. * console.log(key);
  13540. * });
  13541. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13542. */
  13543. function forOwn(object, iteratee) {
  13544. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13545. }
  13546. /**
  13547. * This method is like `_.forOwn` except that it iterates over properties of
  13548. * `object` in the opposite order.
  13549. *
  13550. * @static
  13551. * @memberOf _
  13552. * @since 2.0.0
  13553. * @category Object
  13554. * @param {Object} object The object to iterate over.
  13555. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13556. * @returns {Object} Returns `object`.
  13557. * @see _.forOwn
  13558. * @example
  13559. *
  13560. * function Foo() {
  13561. * this.a = 1;
  13562. * this.b = 2;
  13563. * }
  13564. *
  13565. * Foo.prototype.c = 3;
  13566. *
  13567. * _.forOwnRight(new Foo, function(value, key) {
  13568. * console.log(key);
  13569. * });
  13570. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13571. */
  13572. function forOwnRight(object, iteratee) {
  13573. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13574. }
  13575. /**
  13576. * Creates an array of function property names from own enumerable properties
  13577. * of `object`.
  13578. *
  13579. * @static
  13580. * @since 0.1.0
  13581. * @memberOf _
  13582. * @category Object
  13583. * @param {Object} object The object to inspect.
  13584. * @returns {Array} Returns the function names.
  13585. * @see _.functionsIn
  13586. * @example
  13587. *
  13588. * function Foo() {
  13589. * this.a = _.constant('a');
  13590. * this.b = _.constant('b');
  13591. * }
  13592. *
  13593. * Foo.prototype.c = _.constant('c');
  13594. *
  13595. * _.functions(new Foo);
  13596. * // => ['a', 'b']
  13597. */
  13598. function functions(object) {
  13599. return object == null ? [] : baseFunctions(object, keys(object));
  13600. }
  13601. /**
  13602. * Creates an array of function property names from own and inherited
  13603. * enumerable properties of `object`.
  13604. *
  13605. * @static
  13606. * @memberOf _
  13607. * @since 4.0.0
  13608. * @category Object
  13609. * @param {Object} object The object to inspect.
  13610. * @returns {Array} Returns the function names.
  13611. * @see _.functions
  13612. * @example
  13613. *
  13614. * function Foo() {
  13615. * this.a = _.constant('a');
  13616. * this.b = _.constant('b');
  13617. * }
  13618. *
  13619. * Foo.prototype.c = _.constant('c');
  13620. *
  13621. * _.functionsIn(new Foo);
  13622. * // => ['a', 'b', 'c']
  13623. */
  13624. function functionsIn(object) {
  13625. return object == null ? [] : baseFunctions(object, keysIn(object));
  13626. }
  13627. /**
  13628. * Gets the value at `path` of `object`. If the resolved value is
  13629. * `undefined`, the `defaultValue` is returned in its place.
  13630. *
  13631. * @static
  13632. * @memberOf _
  13633. * @since 3.7.0
  13634. * @category Object
  13635. * @param {Object} object The object to query.
  13636. * @param {Array|string} path The path of the property to get.
  13637. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13638. * @returns {*} Returns the resolved value.
  13639. * @example
  13640. *
  13641. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13642. *
  13643. * _.get(object, 'a[0].b.c');
  13644. * // => 3
  13645. *
  13646. * _.get(object, ['a', '0', 'b', 'c']);
  13647. * // => 3
  13648. *
  13649. * _.get(object, 'a.b.c', 'default');
  13650. * // => 'default'
  13651. */
  13652. function get(object, path, defaultValue) {
  13653. var result = object == null ? undefined : baseGet(object, path);
  13654. return result === undefined ? defaultValue : result;
  13655. }
  13656. /**
  13657. * Checks if `path` is a direct property of `object`.
  13658. *
  13659. * @static
  13660. * @since 0.1.0
  13661. * @memberOf _
  13662. * @category Object
  13663. * @param {Object} object The object to query.
  13664. * @param {Array|string} path The path to check.
  13665. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13666. * @example
  13667. *
  13668. * var object = { 'a': { 'b': 2 } };
  13669. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13670. *
  13671. * _.has(object, 'a');
  13672. * // => true
  13673. *
  13674. * _.has(object, 'a.b');
  13675. * // => true
  13676. *
  13677. * _.has(object, ['a', 'b']);
  13678. * // => true
  13679. *
  13680. * _.has(other, 'a');
  13681. * // => false
  13682. */
  13683. function has(object, path) {
  13684. return object != null && hasPath(object, path, baseHas);
  13685. }
  13686. /**
  13687. * Checks if `path` is a direct or inherited property of `object`.
  13688. *
  13689. * @static
  13690. * @memberOf _
  13691. * @since 4.0.0
  13692. * @category Object
  13693. * @param {Object} object The object to query.
  13694. * @param {Array|string} path The path to check.
  13695. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13696. * @example
  13697. *
  13698. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13699. *
  13700. * _.hasIn(object, 'a');
  13701. * // => true
  13702. *
  13703. * _.hasIn(object, 'a.b');
  13704. * // => true
  13705. *
  13706. * _.hasIn(object, ['a', 'b']);
  13707. * // => true
  13708. *
  13709. * _.hasIn(object, 'b');
  13710. * // => false
  13711. */
  13712. function hasIn(object, path) {
  13713. return object != null && hasPath(object, path, baseHasIn);
  13714. }
  13715. /**
  13716. * Creates an object composed of the inverted keys and values of `object`.
  13717. * If `object` contains duplicate values, subsequent values overwrite
  13718. * property assignments of previous values.
  13719. *
  13720. * @static
  13721. * @memberOf _
  13722. * @since 0.7.0
  13723. * @category Object
  13724. * @param {Object} object The object to invert.
  13725. * @returns {Object} Returns the new inverted object.
  13726. * @example
  13727. *
  13728. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13729. *
  13730. * _.invert(object);
  13731. * // => { '1': 'c', '2': 'b' }
  13732. */
  13733. var invert = createInverter(function(result, value, key) {
  13734. if (value != null &&
  13735. typeof value.toString != 'function') {
  13736. value = nativeObjectToString.call(value);
  13737. }
  13738. result[value] = key;
  13739. }, constant(identity));
  13740. /**
  13741. * This method is like `_.invert` except that the inverted object is generated
  13742. * from the results of running each element of `object` thru `iteratee`. The
  13743. * corresponding inverted value of each inverted key is an array of keys
  13744. * responsible for generating the inverted value. The iteratee is invoked
  13745. * with one argument: (value).
  13746. *
  13747. * @static
  13748. * @memberOf _
  13749. * @since 4.1.0
  13750. * @category Object
  13751. * @param {Object} object The object to invert.
  13752. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13753. * @returns {Object} Returns the new inverted object.
  13754. * @example
  13755. *
  13756. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13757. *
  13758. * _.invertBy(object);
  13759. * // => { '1': ['a', 'c'], '2': ['b'] }
  13760. *
  13761. * _.invertBy(object, function(value) {
  13762. * return 'group' + value;
  13763. * });
  13764. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13765. */
  13766. var invertBy = createInverter(function(result, value, key) {
  13767. if (value != null &&
  13768. typeof value.toString != 'function') {
  13769. value = nativeObjectToString.call(value);
  13770. }
  13771. if (hasOwnProperty.call(result, value)) {
  13772. result[value].push(key);
  13773. } else {
  13774. result[value] = [key];
  13775. }
  13776. }, getIteratee);
  13777. /**
  13778. * Invokes the method at `path` of `object`.
  13779. *
  13780. * @static
  13781. * @memberOf _
  13782. * @since 4.0.0
  13783. * @category Object
  13784. * @param {Object} object The object to query.
  13785. * @param {Array|string} path The path of the method to invoke.
  13786. * @param {...*} [args] The arguments to invoke the method with.
  13787. * @returns {*} Returns the result of the invoked method.
  13788. * @example
  13789. *
  13790. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13791. *
  13792. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13793. * // => [2, 3]
  13794. */
  13795. var invoke = baseRest(baseInvoke);
  13796. /**
  13797. * Creates an array of the own enumerable property names of `object`.
  13798. *
  13799. * **Note:** Non-object values are coerced to objects. See the
  13800. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13801. * for more details.
  13802. *
  13803. * @static
  13804. * @since 0.1.0
  13805. * @memberOf _
  13806. * @category Object
  13807. * @param {Object} object The object to query.
  13808. * @returns {Array} Returns the array of property names.
  13809. * @example
  13810. *
  13811. * function Foo() {
  13812. * this.a = 1;
  13813. * this.b = 2;
  13814. * }
  13815. *
  13816. * Foo.prototype.c = 3;
  13817. *
  13818. * _.keys(new Foo);
  13819. * // => ['a', 'b'] (iteration order is not guaranteed)
  13820. *
  13821. * _.keys('hi');
  13822. * // => ['0', '1']
  13823. */
  13824. function keys(object) {
  13825. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13826. }
  13827. /**
  13828. * Creates an array of the own and inherited enumerable property names of `object`.
  13829. *
  13830. * **Note:** Non-object values are coerced to objects.
  13831. *
  13832. * @static
  13833. * @memberOf _
  13834. * @since 3.0.0
  13835. * @category Object
  13836. * @param {Object} object The object to query.
  13837. * @returns {Array} Returns the array of property names.
  13838. * @example
  13839. *
  13840. * function Foo() {
  13841. * this.a = 1;
  13842. * this.b = 2;
  13843. * }
  13844. *
  13845. * Foo.prototype.c = 3;
  13846. *
  13847. * _.keysIn(new Foo);
  13848. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13849. */
  13850. function keysIn(object) {
  13851. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13852. }
  13853. /**
  13854. * The opposite of `_.mapValues`; this method creates an object with the
  13855. * same values as `object` and keys generated by running each own enumerable
  13856. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13857. * with three arguments: (value, key, object).
  13858. *
  13859. * @static
  13860. * @memberOf _
  13861. * @since 3.8.0
  13862. * @category Object
  13863. * @param {Object} object The object to iterate over.
  13864. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13865. * @returns {Object} Returns the new mapped object.
  13866. * @see _.mapValues
  13867. * @example
  13868. *
  13869. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13870. * return key + value;
  13871. * });
  13872. * // => { 'a1': 1, 'b2': 2 }
  13873. */
  13874. function mapKeys(object, iteratee) {
  13875. var result = {};
  13876. iteratee = getIteratee(iteratee, 3);
  13877. baseForOwn(object, function(value, key, object) {
  13878. baseAssignValue(result, iteratee(value, key, object), value);
  13879. });
  13880. return result;
  13881. }
  13882. /**
  13883. * Creates an object with the same keys as `object` and values generated
  13884. * by running each own enumerable string keyed property of `object` thru
  13885. * `iteratee`. The iteratee is invoked with three arguments:
  13886. * (value, key, object).
  13887. *
  13888. * @static
  13889. * @memberOf _
  13890. * @since 2.4.0
  13891. * @category Object
  13892. * @param {Object} object The object to iterate over.
  13893. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13894. * @returns {Object} Returns the new mapped object.
  13895. * @see _.mapKeys
  13896. * @example
  13897. *
  13898. * var users = {
  13899. * 'fred': { 'user': 'fred', 'age': 40 },
  13900. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13901. * };
  13902. *
  13903. * _.mapValues(users, function(o) { return o.age; });
  13904. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13905. *
  13906. * // The `_.property` iteratee shorthand.
  13907. * _.mapValues(users, 'age');
  13908. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13909. */
  13910. function mapValues(object, iteratee) {
  13911. var result = {};
  13912. iteratee = getIteratee(iteratee, 3);
  13913. baseForOwn(object, function(value, key, object) {
  13914. baseAssignValue(result, key, iteratee(value, key, object));
  13915. });
  13916. return result;
  13917. }
  13918. /**
  13919. * This method is like `_.assign` except that it recursively merges own and
  13920. * inherited enumerable string keyed properties of source objects into the
  13921. * destination object. Source properties that resolve to `undefined` are
  13922. * skipped if a destination value exists. Array and plain object properties
  13923. * are merged recursively. Other objects and value types are overridden by
  13924. * assignment. Source objects are applied from left to right. Subsequent
  13925. * sources overwrite property assignments of previous sources.
  13926. *
  13927. * **Note:** This method mutates `object`.
  13928. *
  13929. * @static
  13930. * @memberOf _
  13931. * @since 0.5.0
  13932. * @category Object
  13933. * @param {Object} object The destination object.
  13934. * @param {...Object} [sources] The source objects.
  13935. * @returns {Object} Returns `object`.
  13936. * @example
  13937. *
  13938. * var object = {
  13939. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13940. * };
  13941. *
  13942. * var other = {
  13943. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13944. * };
  13945. *
  13946. * _.merge(object, other);
  13947. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13948. */
  13949. var merge = createAssigner(function(object, source, srcIndex) {
  13950. baseMerge(object, source, srcIndex);
  13951. });
  13952. /**
  13953. * This method is like `_.merge` except that it accepts `customizer` which
  13954. * is invoked to produce the merged values of the destination and source
  13955. * properties. If `customizer` returns `undefined`, merging is handled by the
  13956. * method instead. The `customizer` is invoked with six arguments:
  13957. * (objValue, srcValue, key, object, source, stack).
  13958. *
  13959. * **Note:** This method mutates `object`.
  13960. *
  13961. * @static
  13962. * @memberOf _
  13963. * @since 4.0.0
  13964. * @category Object
  13965. * @param {Object} object The destination object.
  13966. * @param {...Object} sources The source objects.
  13967. * @param {Function} customizer The function to customize assigned values.
  13968. * @returns {Object} Returns `object`.
  13969. * @example
  13970. *
  13971. * function customizer(objValue, srcValue) {
  13972. * if (_.isArray(objValue)) {
  13973. * return objValue.concat(srcValue);
  13974. * }
  13975. * }
  13976. *
  13977. * var object = { 'a': [1], 'b': [2] };
  13978. * var other = { 'a': [3], 'b': [4] };
  13979. *
  13980. * _.mergeWith(object, other, customizer);
  13981. * // => { 'a': [1, 3], 'b': [2, 4] }
  13982. */
  13983. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13984. baseMerge(object, source, srcIndex, customizer);
  13985. });
  13986. /**
  13987. * The opposite of `_.pick`; this method creates an object composed of the
  13988. * own and inherited enumerable property paths of `object` that are not omitted.
  13989. *
  13990. * **Note:** This method is considerably slower than `_.pick`.
  13991. *
  13992. * @static
  13993. * @since 0.1.0
  13994. * @memberOf _
  13995. * @category Object
  13996. * @param {Object} object The source object.
  13997. * @param {...(string|string[])} [paths] The property paths to omit.
  13998. * @returns {Object} Returns the new object.
  13999. * @example
  14000. *
  14001. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14002. *
  14003. * _.omit(object, ['a', 'c']);
  14004. * // => { 'b': '2' }
  14005. */
  14006. var omit = flatRest(function(object, paths) {
  14007. var result = {};
  14008. if (object == null) {
  14009. return result;
  14010. }
  14011. var isDeep = false;
  14012. paths = arrayMap(paths, function(path) {
  14013. path = castPath(path, object);
  14014. isDeep || (isDeep = path.length > 1);
  14015. return path;
  14016. });
  14017. copyObject(object, getAllKeysIn(object), result);
  14018. if (isDeep) {
  14019. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14020. }
  14021. var length = paths.length;
  14022. while (length--) {
  14023. baseUnset(result, paths[length]);
  14024. }
  14025. return result;
  14026. });
  14027. /**
  14028. * The opposite of `_.pickBy`; this method creates an object composed of
  14029. * the own and inherited enumerable string keyed properties of `object` that
  14030. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14031. * arguments: (value, key).
  14032. *
  14033. * @static
  14034. * @memberOf _
  14035. * @since 4.0.0
  14036. * @category Object
  14037. * @param {Object} object The source object.
  14038. * @param {Function} [predicate=_.identity] The function invoked per property.
  14039. * @returns {Object} Returns the new object.
  14040. * @example
  14041. *
  14042. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14043. *
  14044. * _.omitBy(object, _.isNumber);
  14045. * // => { 'b': '2' }
  14046. */
  14047. function omitBy(object, predicate) {
  14048. return pickBy(object, negate(getIteratee(predicate)));
  14049. }
  14050. /**
  14051. * Creates an object composed of the picked `object` properties.
  14052. *
  14053. * @static
  14054. * @since 0.1.0
  14055. * @memberOf _
  14056. * @category Object
  14057. * @param {Object} object The source object.
  14058. * @param {...(string|string[])} [paths] The property paths to pick.
  14059. * @returns {Object} Returns the new object.
  14060. * @example
  14061. *
  14062. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14063. *
  14064. * _.pick(object, ['a', 'c']);
  14065. * // => { 'a': 1, 'c': 3 }
  14066. */
  14067. var pick = flatRest(function(object, paths) {
  14068. return object == null ? {} : basePick(object, paths);
  14069. });
  14070. /**
  14071. * Creates an object composed of the `object` properties `predicate` returns
  14072. * truthy for. The predicate is invoked with two arguments: (value, key).
  14073. *
  14074. * @static
  14075. * @memberOf _
  14076. * @since 4.0.0
  14077. * @category Object
  14078. * @param {Object} object The source object.
  14079. * @param {Function} [predicate=_.identity] The function invoked per property.
  14080. * @returns {Object} Returns the new object.
  14081. * @example
  14082. *
  14083. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14084. *
  14085. * _.pickBy(object, _.isNumber);
  14086. * // => { 'a': 1, 'c': 3 }
  14087. */
  14088. function pickBy(object, predicate) {
  14089. if (object == null) {
  14090. return {};
  14091. }
  14092. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14093. return [prop];
  14094. });
  14095. predicate = getIteratee(predicate);
  14096. return basePickBy(object, props, function(value, path) {
  14097. return predicate(value, path[0]);
  14098. });
  14099. }
  14100. /**
  14101. * This method is like `_.get` except that if the resolved value is a
  14102. * function it's invoked with the `this` binding of its parent object and
  14103. * its result is returned.
  14104. *
  14105. * @static
  14106. * @since 0.1.0
  14107. * @memberOf _
  14108. * @category Object
  14109. * @param {Object} object The object to query.
  14110. * @param {Array|string} path The path of the property to resolve.
  14111. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14112. * @returns {*} Returns the resolved value.
  14113. * @example
  14114. *
  14115. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14116. *
  14117. * _.result(object, 'a[0].b.c1');
  14118. * // => 3
  14119. *
  14120. * _.result(object, 'a[0].b.c2');
  14121. * // => 4
  14122. *
  14123. * _.result(object, 'a[0].b.c3', 'default');
  14124. * // => 'default'
  14125. *
  14126. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14127. * // => 'default'
  14128. */
  14129. function result(object, path, defaultValue) {
  14130. path = castPath(path, object);
  14131. var index = -1,
  14132. length = path.length;
  14133. // Ensure the loop is entered when path is empty.
  14134. if (!length) {
  14135. length = 1;
  14136. object = undefined;
  14137. }
  14138. while (++index < length) {
  14139. var value = object == null ? undefined : object[toKey(path[index])];
  14140. if (value === undefined) {
  14141. index = length;
  14142. value = defaultValue;
  14143. }
  14144. object = isFunction(value) ? value.call(object) : value;
  14145. }
  14146. return object;
  14147. }
  14148. /**
  14149. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14150. * it's created. Arrays are created for missing index properties while objects
  14151. * are created for all other missing properties. Use `_.setWith` to customize
  14152. * `path` creation.
  14153. *
  14154. * **Note:** This method mutates `object`.
  14155. *
  14156. * @static
  14157. * @memberOf _
  14158. * @since 3.7.0
  14159. * @category Object
  14160. * @param {Object} object The object to modify.
  14161. * @param {Array|string} path The path of the property to set.
  14162. * @param {*} value The value to set.
  14163. * @returns {Object} Returns `object`.
  14164. * @example
  14165. *
  14166. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14167. *
  14168. * _.set(object, 'a[0].b.c', 4);
  14169. * console.log(object.a[0].b.c);
  14170. * // => 4
  14171. *
  14172. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14173. * console.log(object.x[0].y.z);
  14174. * // => 5
  14175. */
  14176. function set(object, path, value) {
  14177. return object == null ? object : baseSet(object, path, value);
  14178. }
  14179. /**
  14180. * This method is like `_.set` except that it accepts `customizer` which is
  14181. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14182. * path creation is handled by the method instead. The `customizer` is invoked
  14183. * with three arguments: (nsValue, key, nsObject).
  14184. *
  14185. * **Note:** This method mutates `object`.
  14186. *
  14187. * @static
  14188. * @memberOf _
  14189. * @since 4.0.0
  14190. * @category Object
  14191. * @param {Object} object The object to modify.
  14192. * @param {Array|string} path The path of the property to set.
  14193. * @param {*} value The value to set.
  14194. * @param {Function} [customizer] The function to customize assigned values.
  14195. * @returns {Object} Returns `object`.
  14196. * @example
  14197. *
  14198. * var object = {};
  14199. *
  14200. * _.setWith(object, '[0][1]', 'a', Object);
  14201. * // => { '0': { '1': 'a' } }
  14202. */
  14203. function setWith(object, path, value, customizer) {
  14204. customizer = typeof customizer == 'function' ? customizer : undefined;
  14205. return object == null ? object : baseSet(object, path, value, customizer);
  14206. }
  14207. /**
  14208. * Creates an array of own enumerable string keyed-value pairs for `object`
  14209. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14210. * entries are returned.
  14211. *
  14212. * @static
  14213. * @memberOf _
  14214. * @since 4.0.0
  14215. * @alias entries
  14216. * @category Object
  14217. * @param {Object} object The object to query.
  14218. * @returns {Array} Returns the key-value pairs.
  14219. * @example
  14220. *
  14221. * function Foo() {
  14222. * this.a = 1;
  14223. * this.b = 2;
  14224. * }
  14225. *
  14226. * Foo.prototype.c = 3;
  14227. *
  14228. * _.toPairs(new Foo);
  14229. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14230. */
  14231. var toPairs = createToPairs(keys);
  14232. /**
  14233. * Creates an array of own and inherited enumerable string keyed-value pairs
  14234. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14235. * or set, its entries are returned.
  14236. *
  14237. * @static
  14238. * @memberOf _
  14239. * @since 4.0.0
  14240. * @alias entriesIn
  14241. * @category Object
  14242. * @param {Object} object The object to query.
  14243. * @returns {Array} Returns the key-value pairs.
  14244. * @example
  14245. *
  14246. * function Foo() {
  14247. * this.a = 1;
  14248. * this.b = 2;
  14249. * }
  14250. *
  14251. * Foo.prototype.c = 3;
  14252. *
  14253. * _.toPairsIn(new Foo);
  14254. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14255. */
  14256. var toPairsIn = createToPairs(keysIn);
  14257. /**
  14258. * An alternative to `_.reduce`; this method transforms `object` to a new
  14259. * `accumulator` object which is the result of running each of its own
  14260. * enumerable string keyed properties thru `iteratee`, with each invocation
  14261. * potentially mutating the `accumulator` object. If `accumulator` is not
  14262. * provided, a new object with the same `[[Prototype]]` will be used. The
  14263. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14264. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14265. *
  14266. * @static
  14267. * @memberOf _
  14268. * @since 1.3.0
  14269. * @category Object
  14270. * @param {Object} object The object to iterate over.
  14271. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14272. * @param {*} [accumulator] The custom accumulator value.
  14273. * @returns {*} Returns the accumulated value.
  14274. * @example
  14275. *
  14276. * _.transform([2, 3, 4], function(result, n) {
  14277. * result.push(n *= n);
  14278. * return n % 2 == 0;
  14279. * }, []);
  14280. * // => [4, 9]
  14281. *
  14282. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14283. * (result[value] || (result[value] = [])).push(key);
  14284. * }, {});
  14285. * // => { '1': ['a', 'c'], '2': ['b'] }
  14286. */
  14287. function transform(object, iteratee, accumulator) {
  14288. var isArr = isArray(object),
  14289. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14290. iteratee = getIteratee(iteratee, 4);
  14291. if (accumulator == null) {
  14292. var Ctor = object && object.constructor;
  14293. if (isArrLike) {
  14294. accumulator = isArr ? new Ctor : [];
  14295. }
  14296. else if (isObject(object)) {
  14297. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14298. }
  14299. else {
  14300. accumulator = {};
  14301. }
  14302. }
  14303. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14304. return iteratee(accumulator, value, index, object);
  14305. });
  14306. return accumulator;
  14307. }
  14308. /**
  14309. * Removes the property at `path` of `object`.
  14310. *
  14311. * **Note:** This method mutates `object`.
  14312. *
  14313. * @static
  14314. * @memberOf _
  14315. * @since 4.0.0
  14316. * @category Object
  14317. * @param {Object} object The object to modify.
  14318. * @param {Array|string} path The path of the property to unset.
  14319. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14320. * @example
  14321. *
  14322. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14323. * _.unset(object, 'a[0].b.c');
  14324. * // => true
  14325. *
  14326. * console.log(object);
  14327. * // => { 'a': [{ 'b': {} }] };
  14328. *
  14329. * _.unset(object, ['a', '0', 'b', 'c']);
  14330. * // => true
  14331. *
  14332. * console.log(object);
  14333. * // => { 'a': [{ 'b': {} }] };
  14334. */
  14335. function unset(object, path) {
  14336. return object == null ? true : baseUnset(object, path);
  14337. }
  14338. /**
  14339. * This method is like `_.set` except that accepts `updater` to produce the
  14340. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14341. * is invoked with one argument: (value).
  14342. *
  14343. * **Note:** This method mutates `object`.
  14344. *
  14345. * @static
  14346. * @memberOf _
  14347. * @since 4.6.0
  14348. * @category Object
  14349. * @param {Object} object The object to modify.
  14350. * @param {Array|string} path The path of the property to set.
  14351. * @param {Function} updater The function to produce the updated value.
  14352. * @returns {Object} Returns `object`.
  14353. * @example
  14354. *
  14355. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14356. *
  14357. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14358. * console.log(object.a[0].b.c);
  14359. * // => 9
  14360. *
  14361. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14362. * console.log(object.x[0].y.z);
  14363. * // => 0
  14364. */
  14365. function update(object, path, updater) {
  14366. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14367. }
  14368. /**
  14369. * This method is like `_.update` except that it accepts `customizer` which is
  14370. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14371. * path creation is handled by the method instead. The `customizer` is invoked
  14372. * with three arguments: (nsValue, key, nsObject).
  14373. *
  14374. * **Note:** This method mutates `object`.
  14375. *
  14376. * @static
  14377. * @memberOf _
  14378. * @since 4.6.0
  14379. * @category Object
  14380. * @param {Object} object The object to modify.
  14381. * @param {Array|string} path The path of the property to set.
  14382. * @param {Function} updater The function to produce the updated value.
  14383. * @param {Function} [customizer] The function to customize assigned values.
  14384. * @returns {Object} Returns `object`.
  14385. * @example
  14386. *
  14387. * var object = {};
  14388. *
  14389. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14390. * // => { '0': { '1': 'a' } }
  14391. */
  14392. function updateWith(object, path, updater, customizer) {
  14393. customizer = typeof customizer == 'function' ? customizer : undefined;
  14394. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14395. }
  14396. /**
  14397. * Creates an array of the own enumerable string keyed property values of `object`.
  14398. *
  14399. * **Note:** Non-object values are coerced to objects.
  14400. *
  14401. * @static
  14402. * @since 0.1.0
  14403. * @memberOf _
  14404. * @category Object
  14405. * @param {Object} object The object to query.
  14406. * @returns {Array} Returns the array of property values.
  14407. * @example
  14408. *
  14409. * function Foo() {
  14410. * this.a = 1;
  14411. * this.b = 2;
  14412. * }
  14413. *
  14414. * Foo.prototype.c = 3;
  14415. *
  14416. * _.values(new Foo);
  14417. * // => [1, 2] (iteration order is not guaranteed)
  14418. *
  14419. * _.values('hi');
  14420. * // => ['h', 'i']
  14421. */
  14422. function values(object) {
  14423. return object == null ? [] : baseValues(object, keys(object));
  14424. }
  14425. /**
  14426. * Creates an array of the own and inherited enumerable string keyed property
  14427. * values of `object`.
  14428. *
  14429. * **Note:** Non-object values are coerced to objects.
  14430. *
  14431. * @static
  14432. * @memberOf _
  14433. * @since 3.0.0
  14434. * @category Object
  14435. * @param {Object} object The object to query.
  14436. * @returns {Array} Returns the array of property values.
  14437. * @example
  14438. *
  14439. * function Foo() {
  14440. * this.a = 1;
  14441. * this.b = 2;
  14442. * }
  14443. *
  14444. * Foo.prototype.c = 3;
  14445. *
  14446. * _.valuesIn(new Foo);
  14447. * // => [1, 2, 3] (iteration order is not guaranteed)
  14448. */
  14449. function valuesIn(object) {
  14450. return object == null ? [] : baseValues(object, keysIn(object));
  14451. }
  14452. /*------------------------------------------------------------------------*/
  14453. /**
  14454. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14455. *
  14456. * @static
  14457. * @memberOf _
  14458. * @since 4.0.0
  14459. * @category Number
  14460. * @param {number} number The number to clamp.
  14461. * @param {number} [lower] The lower bound.
  14462. * @param {number} upper The upper bound.
  14463. * @returns {number} Returns the clamped number.
  14464. * @example
  14465. *
  14466. * _.clamp(-10, -5, 5);
  14467. * // => -5
  14468. *
  14469. * _.clamp(10, -5, 5);
  14470. * // => 5
  14471. */
  14472. function clamp(number, lower, upper) {
  14473. if (upper === undefined) {
  14474. upper = lower;
  14475. lower = undefined;
  14476. }
  14477. if (upper !== undefined) {
  14478. upper = toNumber(upper);
  14479. upper = upper === upper ? upper : 0;
  14480. }
  14481. if (lower !== undefined) {
  14482. lower = toNumber(lower);
  14483. lower = lower === lower ? lower : 0;
  14484. }
  14485. return baseClamp(toNumber(number), lower, upper);
  14486. }
  14487. /**
  14488. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14489. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14490. * If `start` is greater than `end` the params are swapped to support
  14491. * negative ranges.
  14492. *
  14493. * @static
  14494. * @memberOf _
  14495. * @since 3.3.0
  14496. * @category Number
  14497. * @param {number} number The number to check.
  14498. * @param {number} [start=0] The start of the range.
  14499. * @param {number} end The end of the range.
  14500. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14501. * @see _.range, _.rangeRight
  14502. * @example
  14503. *
  14504. * _.inRange(3, 2, 4);
  14505. * // => true
  14506. *
  14507. * _.inRange(4, 8);
  14508. * // => true
  14509. *
  14510. * _.inRange(4, 2);
  14511. * // => false
  14512. *
  14513. * _.inRange(2, 2);
  14514. * // => false
  14515. *
  14516. * _.inRange(1.2, 2);
  14517. * // => true
  14518. *
  14519. * _.inRange(5.2, 4);
  14520. * // => false
  14521. *
  14522. * _.inRange(-3, -2, -6);
  14523. * // => true
  14524. */
  14525. function inRange(number, start, end) {
  14526. start = toFinite(start);
  14527. if (end === undefined) {
  14528. end = start;
  14529. start = 0;
  14530. } else {
  14531. end = toFinite(end);
  14532. }
  14533. number = toNumber(number);
  14534. return baseInRange(number, start, end);
  14535. }
  14536. /**
  14537. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14538. * If only one argument is provided a number between `0` and the given number
  14539. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14540. * floats, a floating-point number is returned instead of an integer.
  14541. *
  14542. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14543. * floating-point values which can produce unexpected results.
  14544. *
  14545. * @static
  14546. * @memberOf _
  14547. * @since 0.7.0
  14548. * @category Number
  14549. * @param {number} [lower=0] The lower bound.
  14550. * @param {number} [upper=1] The upper bound.
  14551. * @param {boolean} [floating] Specify returning a floating-point number.
  14552. * @returns {number} Returns the random number.
  14553. * @example
  14554. *
  14555. * _.random(0, 5);
  14556. * // => an integer between 0 and 5
  14557. *
  14558. * _.random(5);
  14559. * // => also an integer between 0 and 5
  14560. *
  14561. * _.random(5, true);
  14562. * // => a floating-point number between 0 and 5
  14563. *
  14564. * _.random(1.2, 5.2);
  14565. * // => a floating-point number between 1.2 and 5.2
  14566. */
  14567. function random(lower, upper, floating) {
  14568. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14569. upper = floating = undefined;
  14570. }
  14571. if (floating === undefined) {
  14572. if (typeof upper == 'boolean') {
  14573. floating = upper;
  14574. upper = undefined;
  14575. }
  14576. else if (typeof lower == 'boolean') {
  14577. floating = lower;
  14578. lower = undefined;
  14579. }
  14580. }
  14581. if (lower === undefined && upper === undefined) {
  14582. lower = 0;
  14583. upper = 1;
  14584. }
  14585. else {
  14586. lower = toFinite(lower);
  14587. if (upper === undefined) {
  14588. upper = lower;
  14589. lower = 0;
  14590. } else {
  14591. upper = toFinite(upper);
  14592. }
  14593. }
  14594. if (lower > upper) {
  14595. var temp = lower;
  14596. lower = upper;
  14597. upper = temp;
  14598. }
  14599. if (floating || lower % 1 || upper % 1) {
  14600. var rand = nativeRandom();
  14601. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14602. }
  14603. return baseRandom(lower, upper);
  14604. }
  14605. /*------------------------------------------------------------------------*/
  14606. /**
  14607. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14608. *
  14609. * @static
  14610. * @memberOf _
  14611. * @since 3.0.0
  14612. * @category String
  14613. * @param {string} [string=''] The string to convert.
  14614. * @returns {string} Returns the camel cased string.
  14615. * @example
  14616. *
  14617. * _.camelCase('Foo Bar');
  14618. * // => 'fooBar'
  14619. *
  14620. * _.camelCase('--foo-bar--');
  14621. * // => 'fooBar'
  14622. *
  14623. * _.camelCase('__FOO_BAR__');
  14624. * // => 'fooBar'
  14625. */
  14626. var camelCase = createCompounder(function(result, word, index) {
  14627. word = word.toLowerCase();
  14628. return result + (index ? capitalize(word) : word);
  14629. });
  14630. /**
  14631. * Converts the first character of `string` to upper case and the remaining
  14632. * to lower case.
  14633. *
  14634. * @static
  14635. * @memberOf _
  14636. * @since 3.0.0
  14637. * @category String
  14638. * @param {string} [string=''] The string to capitalize.
  14639. * @returns {string} Returns the capitalized string.
  14640. * @example
  14641. *
  14642. * _.capitalize('FRED');
  14643. * // => 'Fred'
  14644. */
  14645. function capitalize(string) {
  14646. return upperFirst(toString(string).toLowerCase());
  14647. }
  14648. /**
  14649. * Deburrs `string` by converting
  14650. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14651. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14652. * letters to basic Latin letters and removing
  14653. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14654. *
  14655. * @static
  14656. * @memberOf _
  14657. * @since 3.0.0
  14658. * @category String
  14659. * @param {string} [string=''] The string to deburr.
  14660. * @returns {string} Returns the deburred string.
  14661. * @example
  14662. *
  14663. * _.deburr('déjà vu');
  14664. * // => 'deja vu'
  14665. */
  14666. function deburr(string) {
  14667. string = toString(string);
  14668. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14669. }
  14670. /**
  14671. * Checks if `string` ends with the given target string.
  14672. *
  14673. * @static
  14674. * @memberOf _
  14675. * @since 3.0.0
  14676. * @category String
  14677. * @param {string} [string=''] The string to inspect.
  14678. * @param {string} [target] The string to search for.
  14679. * @param {number} [position=string.length] The position to search up to.
  14680. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14681. * else `false`.
  14682. * @example
  14683. *
  14684. * _.endsWith('abc', 'c');
  14685. * // => true
  14686. *
  14687. * _.endsWith('abc', 'b');
  14688. * // => false
  14689. *
  14690. * _.endsWith('abc', 'b', 2);
  14691. * // => true
  14692. */
  14693. function endsWith(string, target, position) {
  14694. string = toString(string);
  14695. target = baseToString(target);
  14696. var length = string.length;
  14697. position = position === undefined
  14698. ? length
  14699. : baseClamp(toInteger(position), 0, length);
  14700. var end = position;
  14701. position -= target.length;
  14702. return position >= 0 && string.slice(position, end) == target;
  14703. }
  14704. /**
  14705. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14706. * corresponding HTML entities.
  14707. *
  14708. * **Note:** No other characters are escaped. To escape additional
  14709. * characters use a third-party library like [_he_](https://mths.be/he).
  14710. *
  14711. * Though the ">" character is escaped for symmetry, characters like
  14712. * ">" and "/" don't need escaping in HTML and have no special meaning
  14713. * unless they're part of a tag or unquoted attribute value. See
  14714. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14715. * (under "semi-related fun fact") for more details.
  14716. *
  14717. * When working with HTML you should always
  14718. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14719. * XSS vectors.
  14720. *
  14721. * @static
  14722. * @since 0.1.0
  14723. * @memberOf _
  14724. * @category String
  14725. * @param {string} [string=''] The string to escape.
  14726. * @returns {string} Returns the escaped string.
  14727. * @example
  14728. *
  14729. * _.escape('fred, barney, & pebbles');
  14730. * // => 'fred, barney, &amp; pebbles'
  14731. */
  14732. function escape(string) {
  14733. string = toString(string);
  14734. return (string && reHasUnescapedHtml.test(string))
  14735. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14736. : string;
  14737. }
  14738. /**
  14739. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14740. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14741. *
  14742. * @static
  14743. * @memberOf _
  14744. * @since 3.0.0
  14745. * @category String
  14746. * @param {string} [string=''] The string to escape.
  14747. * @returns {string} Returns the escaped string.
  14748. * @example
  14749. *
  14750. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14751. * // => '\[lodash\]\(https://lodash\.com/\)'
  14752. */
  14753. function escapeRegExp(string) {
  14754. string = toString(string);
  14755. return (string && reHasRegExpChar.test(string))
  14756. ? string.replace(reRegExpChar, '\\$&')
  14757. : string;
  14758. }
  14759. /**
  14760. * Converts `string` to
  14761. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14762. *
  14763. * @static
  14764. * @memberOf _
  14765. * @since 3.0.0
  14766. * @category String
  14767. * @param {string} [string=''] The string to convert.
  14768. * @returns {string} Returns the kebab cased string.
  14769. * @example
  14770. *
  14771. * _.kebabCase('Foo Bar');
  14772. * // => 'foo-bar'
  14773. *
  14774. * _.kebabCase('fooBar');
  14775. * // => 'foo-bar'
  14776. *
  14777. * _.kebabCase('__FOO_BAR__');
  14778. * // => 'foo-bar'
  14779. */
  14780. var kebabCase = createCompounder(function(result, word, index) {
  14781. return result + (index ? '-' : '') + word.toLowerCase();
  14782. });
  14783. /**
  14784. * Converts `string`, as space separated words, to lower case.
  14785. *
  14786. * @static
  14787. * @memberOf _
  14788. * @since 4.0.0
  14789. * @category String
  14790. * @param {string} [string=''] The string to convert.
  14791. * @returns {string} Returns the lower cased string.
  14792. * @example
  14793. *
  14794. * _.lowerCase('--Foo-Bar--');
  14795. * // => 'foo bar'
  14796. *
  14797. * _.lowerCase('fooBar');
  14798. * // => 'foo bar'
  14799. *
  14800. * _.lowerCase('__FOO_BAR__');
  14801. * // => 'foo bar'
  14802. */
  14803. var lowerCase = createCompounder(function(result, word, index) {
  14804. return result + (index ? ' ' : '') + word.toLowerCase();
  14805. });
  14806. /**
  14807. * Converts the first character of `string` to lower case.
  14808. *
  14809. * @static
  14810. * @memberOf _
  14811. * @since 4.0.0
  14812. * @category String
  14813. * @param {string} [string=''] The string to convert.
  14814. * @returns {string} Returns the converted string.
  14815. * @example
  14816. *
  14817. * _.lowerFirst('Fred');
  14818. * // => 'fred'
  14819. *
  14820. * _.lowerFirst('FRED');
  14821. * // => 'fRED'
  14822. */
  14823. var lowerFirst = createCaseFirst('toLowerCase');
  14824. /**
  14825. * Pads `string` on the left and right sides if it's shorter than `length`.
  14826. * Padding characters are truncated if they can't be evenly divided by `length`.
  14827. *
  14828. * @static
  14829. * @memberOf _
  14830. * @since 3.0.0
  14831. * @category String
  14832. * @param {string} [string=''] The string to pad.
  14833. * @param {number} [length=0] The padding length.
  14834. * @param {string} [chars=' '] The string used as padding.
  14835. * @returns {string} Returns the padded string.
  14836. * @example
  14837. *
  14838. * _.pad('abc', 8);
  14839. * // => ' abc '
  14840. *
  14841. * _.pad('abc', 8, '_-');
  14842. * // => '_-abc_-_'
  14843. *
  14844. * _.pad('abc', 3);
  14845. * // => 'abc'
  14846. */
  14847. function pad(string, length, chars) {
  14848. string = toString(string);
  14849. length = toInteger(length);
  14850. var strLength = length ? stringSize(string) : 0;
  14851. if (!length || strLength >= length) {
  14852. return string;
  14853. }
  14854. var mid = (length - strLength) / 2;
  14855. return (
  14856. createPadding(nativeFloor(mid), chars) +
  14857. string +
  14858. createPadding(nativeCeil(mid), chars)
  14859. );
  14860. }
  14861. /**
  14862. * Pads `string` on the right side if it's shorter than `length`. Padding
  14863. * characters are truncated if they exceed `length`.
  14864. *
  14865. * @static
  14866. * @memberOf _
  14867. * @since 4.0.0
  14868. * @category String
  14869. * @param {string} [string=''] The string to pad.
  14870. * @param {number} [length=0] The padding length.
  14871. * @param {string} [chars=' '] The string used as padding.
  14872. * @returns {string} Returns the padded string.
  14873. * @example
  14874. *
  14875. * _.padEnd('abc', 6);
  14876. * // => 'abc '
  14877. *
  14878. * _.padEnd('abc', 6, '_-');
  14879. * // => 'abc_-_'
  14880. *
  14881. * _.padEnd('abc', 3);
  14882. * // => 'abc'
  14883. */
  14884. function padEnd(string, length, chars) {
  14885. string = toString(string);
  14886. length = toInteger(length);
  14887. var strLength = length ? stringSize(string) : 0;
  14888. return (length && strLength < length)
  14889. ? (string + createPadding(length - strLength, chars))
  14890. : string;
  14891. }
  14892. /**
  14893. * Pads `string` on the left side if it's shorter than `length`. Padding
  14894. * characters are truncated if they exceed `length`.
  14895. *
  14896. * @static
  14897. * @memberOf _
  14898. * @since 4.0.0
  14899. * @category String
  14900. * @param {string} [string=''] The string to pad.
  14901. * @param {number} [length=0] The padding length.
  14902. * @param {string} [chars=' '] The string used as padding.
  14903. * @returns {string} Returns the padded string.
  14904. * @example
  14905. *
  14906. * _.padStart('abc', 6);
  14907. * // => ' abc'
  14908. *
  14909. * _.padStart('abc', 6, '_-');
  14910. * // => '_-_abc'
  14911. *
  14912. * _.padStart('abc', 3);
  14913. * // => 'abc'
  14914. */
  14915. function padStart(string, length, chars) {
  14916. string = toString(string);
  14917. length = toInteger(length);
  14918. var strLength = length ? stringSize(string) : 0;
  14919. return (length && strLength < length)
  14920. ? (createPadding(length - strLength, chars) + string)
  14921. : string;
  14922. }
  14923. /**
  14924. * Converts `string` to an integer of the specified radix. If `radix` is
  14925. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14926. * hexadecimal, in which case a `radix` of `16` is used.
  14927. *
  14928. * **Note:** This method aligns with the
  14929. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14930. *
  14931. * @static
  14932. * @memberOf _
  14933. * @since 1.1.0
  14934. * @category String
  14935. * @param {string} string The string to convert.
  14936. * @param {number} [radix=10] The radix to interpret `value` by.
  14937. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14938. * @returns {number} Returns the converted integer.
  14939. * @example
  14940. *
  14941. * _.parseInt('08');
  14942. * // => 8
  14943. *
  14944. * _.map(['6', '08', '10'], _.parseInt);
  14945. * // => [6, 8, 10]
  14946. */
  14947. function parseInt(string, radix, guard) {
  14948. if (guard || radix == null) {
  14949. radix = 0;
  14950. } else if (radix) {
  14951. radix = +radix;
  14952. }
  14953. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14954. }
  14955. /**
  14956. * Repeats the given string `n` times.
  14957. *
  14958. * @static
  14959. * @memberOf _
  14960. * @since 3.0.0
  14961. * @category String
  14962. * @param {string} [string=''] The string to repeat.
  14963. * @param {number} [n=1] The number of times to repeat the string.
  14964. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14965. * @returns {string} Returns the repeated string.
  14966. * @example
  14967. *
  14968. * _.repeat('*', 3);
  14969. * // => '***'
  14970. *
  14971. * _.repeat('abc', 2);
  14972. * // => 'abcabc'
  14973. *
  14974. * _.repeat('abc', 0);
  14975. * // => ''
  14976. */
  14977. function repeat(string, n, guard) {
  14978. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14979. n = 1;
  14980. } else {
  14981. n = toInteger(n);
  14982. }
  14983. return baseRepeat(toString(string), n);
  14984. }
  14985. /**
  14986. * Replaces matches for `pattern` in `string` with `replacement`.
  14987. *
  14988. * **Note:** This method is based on
  14989. * [`String#replace`](https://mdn.io/String/replace).
  14990. *
  14991. * @static
  14992. * @memberOf _
  14993. * @since 4.0.0
  14994. * @category String
  14995. * @param {string} [string=''] The string to modify.
  14996. * @param {RegExp|string} pattern The pattern to replace.
  14997. * @param {Function|string} replacement The match replacement.
  14998. * @returns {string} Returns the modified string.
  14999. * @example
  15000. *
  15001. * _.replace('Hi Fred', 'Fred', 'Barney');
  15002. * // => 'Hi Barney'
  15003. */
  15004. function replace() {
  15005. var args = arguments,
  15006. string = toString(args[0]);
  15007. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15008. }
  15009. /**
  15010. * Converts `string` to
  15011. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15012. *
  15013. * @static
  15014. * @memberOf _
  15015. * @since 3.0.0
  15016. * @category String
  15017. * @param {string} [string=''] The string to convert.
  15018. * @returns {string} Returns the snake cased string.
  15019. * @example
  15020. *
  15021. * _.snakeCase('Foo Bar');
  15022. * // => 'foo_bar'
  15023. *
  15024. * _.snakeCase('fooBar');
  15025. * // => 'foo_bar'
  15026. *
  15027. * _.snakeCase('--FOO-BAR--');
  15028. * // => 'foo_bar'
  15029. */
  15030. var snakeCase = createCompounder(function(result, word, index) {
  15031. return result + (index ? '_' : '') + word.toLowerCase();
  15032. });
  15033. /**
  15034. * Splits `string` by `separator`.
  15035. *
  15036. * **Note:** This method is based on
  15037. * [`String#split`](https://mdn.io/String/split).
  15038. *
  15039. * @static
  15040. * @memberOf _
  15041. * @since 4.0.0
  15042. * @category String
  15043. * @param {string} [string=''] The string to split.
  15044. * @param {RegExp|string} separator The separator pattern to split by.
  15045. * @param {number} [limit] The length to truncate results to.
  15046. * @returns {Array} Returns the string segments.
  15047. * @example
  15048. *
  15049. * _.split('a-b-c', '-', 2);
  15050. * // => ['a', 'b']
  15051. */
  15052. function split(string, separator, limit) {
  15053. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15054. separator = limit = undefined;
  15055. }
  15056. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15057. if (!limit) {
  15058. return [];
  15059. }
  15060. string = toString(string);
  15061. if (string && (
  15062. typeof separator == 'string' ||
  15063. (separator != null && !isRegExp(separator))
  15064. )) {
  15065. separator = baseToString(separator);
  15066. if (!separator && hasUnicode(string)) {
  15067. return castSlice(stringToArray(string), 0, limit);
  15068. }
  15069. }
  15070. return string.split(separator, limit);
  15071. }
  15072. /**
  15073. * Converts `string` to
  15074. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15075. *
  15076. * @static
  15077. * @memberOf _
  15078. * @since 3.1.0
  15079. * @category String
  15080. * @param {string} [string=''] The string to convert.
  15081. * @returns {string} Returns the start cased string.
  15082. * @example
  15083. *
  15084. * _.startCase('--foo-bar--');
  15085. * // => 'Foo Bar'
  15086. *
  15087. * _.startCase('fooBar');
  15088. * // => 'Foo Bar'
  15089. *
  15090. * _.startCase('__FOO_BAR__');
  15091. * // => 'FOO BAR'
  15092. */
  15093. var startCase = createCompounder(function(result, word, index) {
  15094. return result + (index ? ' ' : '') + upperFirst(word);
  15095. });
  15096. /**
  15097. * Checks if `string` starts with the given target string.
  15098. *
  15099. * @static
  15100. * @memberOf _
  15101. * @since 3.0.0
  15102. * @category String
  15103. * @param {string} [string=''] The string to inspect.
  15104. * @param {string} [target] The string to search for.
  15105. * @param {number} [position=0] The position to search from.
  15106. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15107. * else `false`.
  15108. * @example
  15109. *
  15110. * _.startsWith('abc', 'a');
  15111. * // => true
  15112. *
  15113. * _.startsWith('abc', 'b');
  15114. * // => false
  15115. *
  15116. * _.startsWith('abc', 'b', 1);
  15117. * // => true
  15118. */
  15119. function startsWith(string, target, position) {
  15120. string = toString(string);
  15121. position = position == null
  15122. ? 0
  15123. : baseClamp(toInteger(position), 0, string.length);
  15124. target = baseToString(target);
  15125. return string.slice(position, position + target.length) == target;
  15126. }
  15127. /**
  15128. * Creates a compiled template function that can interpolate data properties
  15129. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15130. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15131. * properties may be accessed as free variables in the template. If a setting
  15132. * object is given, it takes precedence over `_.templateSettings` values.
  15133. *
  15134. * **Note:** In the development build `_.template` utilizes
  15135. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15136. * for easier debugging.
  15137. *
  15138. * For more information on precompiling templates see
  15139. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15140. *
  15141. * For more information on Chrome extension sandboxes see
  15142. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15143. *
  15144. * @static
  15145. * @since 0.1.0
  15146. * @memberOf _
  15147. * @category String
  15148. * @param {string} [string=''] The template string.
  15149. * @param {Object} [options={}] The options object.
  15150. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15151. * The HTML "escape" delimiter.
  15152. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15153. * The "evaluate" delimiter.
  15154. * @param {Object} [options.imports=_.templateSettings.imports]
  15155. * An object to import into the template as free variables.
  15156. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15157. * The "interpolate" delimiter.
  15158. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15159. * The sourceURL of the compiled template.
  15160. * @param {string} [options.variable='obj']
  15161. * The data object variable name.
  15162. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15163. * @returns {Function} Returns the compiled template function.
  15164. * @example
  15165. *
  15166. * // Use the "interpolate" delimiter to create a compiled template.
  15167. * var compiled = _.template('hello <%= user %>!');
  15168. * compiled({ 'user': 'fred' });
  15169. * // => 'hello fred!'
  15170. *
  15171. * // Use the HTML "escape" delimiter to escape data property values.
  15172. * var compiled = _.template('<b><%- value %></b>');
  15173. * compiled({ 'value': '<script>' });
  15174. * // => '<b>&lt;script&gt;</b>'
  15175. *
  15176. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15177. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15178. * compiled({ 'users': ['fred', 'barney'] });
  15179. * // => '<li>fred</li><li>barney</li>'
  15180. *
  15181. * // Use the internal `print` function in "evaluate" delimiters.
  15182. * var compiled = _.template('<% print("hello " + user); %>!');
  15183. * compiled({ 'user': 'barney' });
  15184. * // => 'hello barney!'
  15185. *
  15186. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15187. * // Disable support by replacing the "interpolate" delimiter.
  15188. * var compiled = _.template('hello ${ user }!');
  15189. * compiled({ 'user': 'pebbles' });
  15190. * // => 'hello pebbles!'
  15191. *
  15192. * // Use backslashes to treat delimiters as plain text.
  15193. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15194. * compiled({ 'value': 'ignored' });
  15195. * // => '<%- value %>'
  15196. *
  15197. * // Use the `imports` option to import `jQuery` as `jq`.
  15198. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15199. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15200. * compiled({ 'users': ['fred', 'barney'] });
  15201. * // => '<li>fred</li><li>barney</li>'
  15202. *
  15203. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15204. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15205. * compiled(data);
  15206. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15207. *
  15208. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15209. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15210. * compiled.source;
  15211. * // => function(data) {
  15212. * // var __t, __p = '';
  15213. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15214. * // return __p;
  15215. * // }
  15216. *
  15217. * // Use custom template delimiters.
  15218. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15219. * var compiled = _.template('hello {{ user }}!');
  15220. * compiled({ 'user': 'mustache' });
  15221. * // => 'hello mustache!'
  15222. *
  15223. * // Use the `source` property to inline compiled templates for meaningful
  15224. * // line numbers in error messages and stack traces.
  15225. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15226. * var JST = {\
  15227. * "main": ' + _.template(mainText).source + '\
  15228. * };\
  15229. * ');
  15230. */
  15231. function template(string, options, guard) {
  15232. // Based on John Resig's `tmpl` implementation
  15233. // (http://ejohn.org/blog/javascript-micro-templating/)
  15234. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15235. var settings = lodash.templateSettings;
  15236. if (guard && isIterateeCall(string, options, guard)) {
  15237. options = undefined;
  15238. }
  15239. string = toString(string);
  15240. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15241. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15242. importsKeys = keys(imports),
  15243. importsValues = baseValues(imports, importsKeys);
  15244. var isEscaping,
  15245. isEvaluating,
  15246. index = 0,
  15247. interpolate = options.interpolate || reNoMatch,
  15248. source = "__p += '";
  15249. // Compile the regexp to match each delimiter.
  15250. var reDelimiters = RegExp(
  15251. (options.escape || reNoMatch).source + '|' +
  15252. interpolate.source + '|' +
  15253. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15254. (options.evaluate || reNoMatch).source + '|$'
  15255. , 'g');
  15256. // Use a sourceURL for easier debugging.
  15257. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15258. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15259. // and escape the comment, thus injecting code that gets evaled.
  15260. var sourceURL = '//# sourceURL=' +
  15261. (hasOwnProperty.call(options, 'sourceURL')
  15262. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15263. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15264. ) + '\n';
  15265. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15266. interpolateValue || (interpolateValue = esTemplateValue);
  15267. // Escape characters that can't be included in string literals.
  15268. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15269. // Replace delimiters with snippets.
  15270. if (escapeValue) {
  15271. isEscaping = true;
  15272. source += "' +\n__e(" + escapeValue + ") +\n'";
  15273. }
  15274. if (evaluateValue) {
  15275. isEvaluating = true;
  15276. source += "';\n" + evaluateValue + ";\n__p += '";
  15277. }
  15278. if (interpolateValue) {
  15279. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15280. }
  15281. index = offset + match.length;
  15282. // The JS engine embedded in Adobe products needs `match` returned in
  15283. // order to produce the correct `offset` value.
  15284. return match;
  15285. });
  15286. source += "';\n";
  15287. // If `variable` is not specified wrap a with-statement around the generated
  15288. // code to add the data object to the top of the scope chain.
  15289. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15290. if (!variable) {
  15291. source = 'with (obj) {\n' + source + '\n}\n';
  15292. }
  15293. // Throw an error if a forbidden character was found in `variable`, to prevent
  15294. // potential command injection attacks.
  15295. else if (reForbiddenIdentifierChars.test(variable)) {
  15296. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15297. }
  15298. // Cleanup code by stripping empty strings.
  15299. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15300. .replace(reEmptyStringMiddle, '$1')
  15301. .replace(reEmptyStringTrailing, '$1;');
  15302. // Frame code as the function body.
  15303. source = 'function(' + (variable || 'obj') + ') {\n' +
  15304. (variable
  15305. ? ''
  15306. : 'obj || (obj = {});\n'
  15307. ) +
  15308. "var __t, __p = ''" +
  15309. (isEscaping
  15310. ? ', __e = _.escape'
  15311. : ''
  15312. ) +
  15313. (isEvaluating
  15314. ? ', __j = Array.prototype.join;\n' +
  15315. "function print() { __p += __j.call(arguments, '') }\n"
  15316. : ';\n'
  15317. ) +
  15318. source +
  15319. 'return __p\n}';
  15320. var result = attempt(function() {
  15321. return Function(importsKeys, sourceURL + 'return ' + source)
  15322. .apply(undefined, importsValues);
  15323. });
  15324. // Provide the compiled function's source by its `toString` method or
  15325. // the `source` property as a convenience for inlining compiled templates.
  15326. result.source = source;
  15327. if (isError(result)) {
  15328. throw result;
  15329. }
  15330. return result;
  15331. }
  15332. /**
  15333. * Converts `string`, as a whole, to lower case just like
  15334. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15335. *
  15336. * @static
  15337. * @memberOf _
  15338. * @since 4.0.0
  15339. * @category String
  15340. * @param {string} [string=''] The string to convert.
  15341. * @returns {string} Returns the lower cased string.
  15342. * @example
  15343. *
  15344. * _.toLower('--Foo-Bar--');
  15345. * // => '--foo-bar--'
  15346. *
  15347. * _.toLower('fooBar');
  15348. * // => 'foobar'
  15349. *
  15350. * _.toLower('__FOO_BAR__');
  15351. * // => '__foo_bar__'
  15352. */
  15353. function toLower(value) {
  15354. return toString(value).toLowerCase();
  15355. }
  15356. /**
  15357. * Converts `string`, as a whole, to upper case just like
  15358. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15359. *
  15360. * @static
  15361. * @memberOf _
  15362. * @since 4.0.0
  15363. * @category String
  15364. * @param {string} [string=''] The string to convert.
  15365. * @returns {string} Returns the upper cased string.
  15366. * @example
  15367. *
  15368. * _.toUpper('--foo-bar--');
  15369. * // => '--FOO-BAR--'
  15370. *
  15371. * _.toUpper('fooBar');
  15372. * // => 'FOOBAR'
  15373. *
  15374. * _.toUpper('__foo_bar__');
  15375. * // => '__FOO_BAR__'
  15376. */
  15377. function toUpper(value) {
  15378. return toString(value).toUpperCase();
  15379. }
  15380. /**
  15381. * Removes leading and trailing whitespace or specified characters from `string`.
  15382. *
  15383. * @static
  15384. * @memberOf _
  15385. * @since 3.0.0
  15386. * @category String
  15387. * @param {string} [string=''] The string to trim.
  15388. * @param {string} [chars=whitespace] The characters to trim.
  15389. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15390. * @returns {string} Returns the trimmed string.
  15391. * @example
  15392. *
  15393. * _.trim(' abc ');
  15394. * // => 'abc'
  15395. *
  15396. * _.trim('-_-abc-_-', '_-');
  15397. * // => 'abc'
  15398. *
  15399. * _.map([' foo ', ' bar '], _.trim);
  15400. * // => ['foo', 'bar']
  15401. */
  15402. function trim(string, chars, guard) {
  15403. string = toString(string);
  15404. if (string && (guard || chars === undefined)) {
  15405. return baseTrim(string);
  15406. }
  15407. if (!string || !(chars = baseToString(chars))) {
  15408. return string;
  15409. }
  15410. var strSymbols = stringToArray(string),
  15411. chrSymbols = stringToArray(chars),
  15412. start = charsStartIndex(strSymbols, chrSymbols),
  15413. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15414. return castSlice(strSymbols, start, end).join('');
  15415. }
  15416. /**
  15417. * Removes trailing whitespace or specified characters from `string`.
  15418. *
  15419. * @static
  15420. * @memberOf _
  15421. * @since 4.0.0
  15422. * @category String
  15423. * @param {string} [string=''] The string to trim.
  15424. * @param {string} [chars=whitespace] The characters to trim.
  15425. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15426. * @returns {string} Returns the trimmed string.
  15427. * @example
  15428. *
  15429. * _.trimEnd(' abc ');
  15430. * // => ' abc'
  15431. *
  15432. * _.trimEnd('-_-abc-_-', '_-');
  15433. * // => '-_-abc'
  15434. */
  15435. function trimEnd(string, chars, guard) {
  15436. string = toString(string);
  15437. if (string && (guard || chars === undefined)) {
  15438. return string.slice(0, trimmedEndIndex(string) + 1);
  15439. }
  15440. if (!string || !(chars = baseToString(chars))) {
  15441. return string;
  15442. }
  15443. var strSymbols = stringToArray(string),
  15444. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15445. return castSlice(strSymbols, 0, end).join('');
  15446. }
  15447. /**
  15448. * Removes leading whitespace or specified characters from `string`.
  15449. *
  15450. * @static
  15451. * @memberOf _
  15452. * @since 4.0.0
  15453. * @category String
  15454. * @param {string} [string=''] The string to trim.
  15455. * @param {string} [chars=whitespace] The characters to trim.
  15456. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15457. * @returns {string} Returns the trimmed string.
  15458. * @example
  15459. *
  15460. * _.trimStart(' abc ');
  15461. * // => 'abc '
  15462. *
  15463. * _.trimStart('-_-abc-_-', '_-');
  15464. * // => 'abc-_-'
  15465. */
  15466. function trimStart(string, chars, guard) {
  15467. string = toString(string);
  15468. if (string && (guard || chars === undefined)) {
  15469. return string.replace(reTrimStart, '');
  15470. }
  15471. if (!string || !(chars = baseToString(chars))) {
  15472. return string;
  15473. }
  15474. var strSymbols = stringToArray(string),
  15475. start = charsStartIndex(strSymbols, stringToArray(chars));
  15476. return castSlice(strSymbols, start).join('');
  15477. }
  15478. /**
  15479. * Truncates `string` if it's longer than the given maximum string length.
  15480. * The last characters of the truncated string are replaced with the omission
  15481. * string which defaults to "...".
  15482. *
  15483. * @static
  15484. * @memberOf _
  15485. * @since 4.0.0
  15486. * @category String
  15487. * @param {string} [string=''] The string to truncate.
  15488. * @param {Object} [options={}] The options object.
  15489. * @param {number} [options.length=30] The maximum string length.
  15490. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15491. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15492. * @returns {string} Returns the truncated string.
  15493. * @example
  15494. *
  15495. * _.truncate('hi-diddly-ho there, neighborino');
  15496. * // => 'hi-diddly-ho there, neighbo...'
  15497. *
  15498. * _.truncate('hi-diddly-ho there, neighborino', {
  15499. * 'length': 24,
  15500. * 'separator': ' '
  15501. * });
  15502. * // => 'hi-diddly-ho there,...'
  15503. *
  15504. * _.truncate('hi-diddly-ho there, neighborino', {
  15505. * 'length': 24,
  15506. * 'separator': /,? +/
  15507. * });
  15508. * // => 'hi-diddly-ho there...'
  15509. *
  15510. * _.truncate('hi-diddly-ho there, neighborino', {
  15511. * 'omission': ' [...]'
  15512. * });
  15513. * // => 'hi-diddly-ho there, neig [...]'
  15514. */
  15515. function truncate(string, options) {
  15516. var length = DEFAULT_TRUNC_LENGTH,
  15517. omission = DEFAULT_TRUNC_OMISSION;
  15518. if (isObject(options)) {
  15519. var separator = 'separator' in options ? options.separator : separator;
  15520. length = 'length' in options ? toInteger(options.length) : length;
  15521. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15522. }
  15523. string = toString(string);
  15524. var strLength = string.length;
  15525. if (hasUnicode(string)) {
  15526. var strSymbols = stringToArray(string);
  15527. strLength = strSymbols.length;
  15528. }
  15529. if (length >= strLength) {
  15530. return string;
  15531. }
  15532. var end = length - stringSize(omission);
  15533. if (end < 1) {
  15534. return omission;
  15535. }
  15536. var result = strSymbols
  15537. ? castSlice(strSymbols, 0, end).join('')
  15538. : string.slice(0, end);
  15539. if (separator === undefined) {
  15540. return result + omission;
  15541. }
  15542. if (strSymbols) {
  15543. end += (result.length - end);
  15544. }
  15545. if (isRegExp(separator)) {
  15546. if (string.slice(end).search(separator)) {
  15547. var match,
  15548. substring = result;
  15549. if (!separator.global) {
  15550. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15551. }
  15552. separator.lastIndex = 0;
  15553. while ((match = separator.exec(substring))) {
  15554. var newEnd = match.index;
  15555. }
  15556. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15557. }
  15558. } else if (string.indexOf(baseToString(separator), end) != end) {
  15559. var index = result.lastIndexOf(separator);
  15560. if (index > -1) {
  15561. result = result.slice(0, index);
  15562. }
  15563. }
  15564. return result + omission;
  15565. }
  15566. /**
  15567. * The inverse of `_.escape`; this method converts the HTML entities
  15568. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15569. * their corresponding characters.
  15570. *
  15571. * **Note:** No other HTML entities are unescaped. To unescape additional
  15572. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15573. *
  15574. * @static
  15575. * @memberOf _
  15576. * @since 0.6.0
  15577. * @category String
  15578. * @param {string} [string=''] The string to unescape.
  15579. * @returns {string} Returns the unescaped string.
  15580. * @example
  15581. *
  15582. * _.unescape('fred, barney, &amp; pebbles');
  15583. * // => 'fred, barney, & pebbles'
  15584. */
  15585. function unescape(string) {
  15586. string = toString(string);
  15587. return (string && reHasEscapedHtml.test(string))
  15588. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15589. : string;
  15590. }
  15591. /**
  15592. * Converts `string`, as space separated words, to upper case.
  15593. *
  15594. * @static
  15595. * @memberOf _
  15596. * @since 4.0.0
  15597. * @category String
  15598. * @param {string} [string=''] The string to convert.
  15599. * @returns {string} Returns the upper cased string.
  15600. * @example
  15601. *
  15602. * _.upperCase('--foo-bar');
  15603. * // => 'FOO BAR'
  15604. *
  15605. * _.upperCase('fooBar');
  15606. * // => 'FOO BAR'
  15607. *
  15608. * _.upperCase('__foo_bar__');
  15609. * // => 'FOO BAR'
  15610. */
  15611. var upperCase = createCompounder(function(result, word, index) {
  15612. return result + (index ? ' ' : '') + word.toUpperCase();
  15613. });
  15614. /**
  15615. * Converts the first character of `string` to upper case.
  15616. *
  15617. * @static
  15618. * @memberOf _
  15619. * @since 4.0.0
  15620. * @category String
  15621. * @param {string} [string=''] The string to convert.
  15622. * @returns {string} Returns the converted string.
  15623. * @example
  15624. *
  15625. * _.upperFirst('fred');
  15626. * // => 'Fred'
  15627. *
  15628. * _.upperFirst('FRED');
  15629. * // => 'FRED'
  15630. */
  15631. var upperFirst = createCaseFirst('toUpperCase');
  15632. /**
  15633. * Splits `string` into an array of its words.
  15634. *
  15635. * @static
  15636. * @memberOf _
  15637. * @since 3.0.0
  15638. * @category String
  15639. * @param {string} [string=''] The string to inspect.
  15640. * @param {RegExp|string} [pattern] The pattern to match words.
  15641. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15642. * @returns {Array} Returns the words of `string`.
  15643. * @example
  15644. *
  15645. * _.words('fred, barney, & pebbles');
  15646. * // => ['fred', 'barney', 'pebbles']
  15647. *
  15648. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15649. * // => ['fred', 'barney', '&', 'pebbles']
  15650. */
  15651. function words(string, pattern, guard) {
  15652. string = toString(string);
  15653. pattern = guard ? undefined : pattern;
  15654. if (pattern === undefined) {
  15655. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15656. }
  15657. return string.match(pattern) || [];
  15658. }
  15659. /*------------------------------------------------------------------------*/
  15660. /**
  15661. * Attempts to invoke `func`, returning either the result or the caught error
  15662. * object. Any additional arguments are provided to `func` when it's invoked.
  15663. *
  15664. * @static
  15665. * @memberOf _
  15666. * @since 3.0.0
  15667. * @category Util
  15668. * @param {Function} func The function to attempt.
  15669. * @param {...*} [args] The arguments to invoke `func` with.
  15670. * @returns {*} Returns the `func` result or error object.
  15671. * @example
  15672. *
  15673. * // Avoid throwing errors for invalid selectors.
  15674. * var elements = _.attempt(function(selector) {
  15675. * return document.querySelectorAll(selector);
  15676. * }, '>_>');
  15677. *
  15678. * if (_.isError(elements)) {
  15679. * elements = [];
  15680. * }
  15681. */
  15682. var attempt = baseRest(function(func, args) {
  15683. try {
  15684. return apply(func, undefined, args);
  15685. } catch (e) {
  15686. return isError(e) ? e : new Error(e);
  15687. }
  15688. });
  15689. /**
  15690. * Binds methods of an object to the object itself, overwriting the existing
  15691. * method.
  15692. *
  15693. * **Note:** This method doesn't set the "length" property of bound functions.
  15694. *
  15695. * @static
  15696. * @since 0.1.0
  15697. * @memberOf _
  15698. * @category Util
  15699. * @param {Object} object The object to bind and assign the bound methods to.
  15700. * @param {...(string|string[])} methodNames The object method names to bind.
  15701. * @returns {Object} Returns `object`.
  15702. * @example
  15703. *
  15704. * var view = {
  15705. * 'label': 'docs',
  15706. * 'click': function() {
  15707. * console.log('clicked ' + this.label);
  15708. * }
  15709. * };
  15710. *
  15711. * _.bindAll(view, ['click']);
  15712. * jQuery(element).on('click', view.click);
  15713. * // => Logs 'clicked docs' when clicked.
  15714. */
  15715. var bindAll = flatRest(function(object, methodNames) {
  15716. arrayEach(methodNames, function(key) {
  15717. key = toKey(key);
  15718. baseAssignValue(object, key, bind(object[key], object));
  15719. });
  15720. return object;
  15721. });
  15722. /**
  15723. * Creates a function that iterates over `pairs` and invokes the corresponding
  15724. * function of the first predicate to return truthy. The predicate-function
  15725. * pairs are invoked with the `this` binding and arguments of the created
  15726. * function.
  15727. *
  15728. * @static
  15729. * @memberOf _
  15730. * @since 4.0.0
  15731. * @category Util
  15732. * @param {Array} pairs The predicate-function pairs.
  15733. * @returns {Function} Returns the new composite function.
  15734. * @example
  15735. *
  15736. * var func = _.cond([
  15737. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15738. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15739. * [_.stubTrue, _.constant('no match')]
  15740. * ]);
  15741. *
  15742. * func({ 'a': 1, 'b': 2 });
  15743. * // => 'matches A'
  15744. *
  15745. * func({ 'a': 0, 'b': 1 });
  15746. * // => 'matches B'
  15747. *
  15748. * func({ 'a': '1', 'b': '2' });
  15749. * // => 'no match'
  15750. */
  15751. function cond(pairs) {
  15752. var length = pairs == null ? 0 : pairs.length,
  15753. toIteratee = getIteratee();
  15754. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15755. if (typeof pair[1] != 'function') {
  15756. throw new TypeError(FUNC_ERROR_TEXT);
  15757. }
  15758. return [toIteratee(pair[0]), pair[1]];
  15759. });
  15760. return baseRest(function(args) {
  15761. var index = -1;
  15762. while (++index < length) {
  15763. var pair = pairs[index];
  15764. if (apply(pair[0], this, args)) {
  15765. return apply(pair[1], this, args);
  15766. }
  15767. }
  15768. });
  15769. }
  15770. /**
  15771. * Creates a function that invokes the predicate properties of `source` with
  15772. * the corresponding property values of a given object, returning `true` if
  15773. * all predicates return truthy, else `false`.
  15774. *
  15775. * **Note:** The created function is equivalent to `_.conformsTo` with
  15776. * `source` partially applied.
  15777. *
  15778. * @static
  15779. * @memberOf _
  15780. * @since 4.0.0
  15781. * @category Util
  15782. * @param {Object} source The object of property predicates to conform to.
  15783. * @returns {Function} Returns the new spec function.
  15784. * @example
  15785. *
  15786. * var objects = [
  15787. * { 'a': 2, 'b': 1 },
  15788. * { 'a': 1, 'b': 2 }
  15789. * ];
  15790. *
  15791. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15792. * // => [{ 'a': 1, 'b': 2 }]
  15793. */
  15794. function conforms(source) {
  15795. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15796. }
  15797. /**
  15798. * Creates a function that returns `value`.
  15799. *
  15800. * @static
  15801. * @memberOf _
  15802. * @since 2.4.0
  15803. * @category Util
  15804. * @param {*} value The value to return from the new function.
  15805. * @returns {Function} Returns the new constant function.
  15806. * @example
  15807. *
  15808. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15809. *
  15810. * console.log(objects);
  15811. * // => [{ 'a': 1 }, { 'a': 1 }]
  15812. *
  15813. * console.log(objects[0] === objects[1]);
  15814. * // => true
  15815. */
  15816. function constant(value) {
  15817. return function() {
  15818. return value;
  15819. };
  15820. }
  15821. /**
  15822. * Checks `value` to determine whether a default value should be returned in
  15823. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15824. * or `undefined`.
  15825. *
  15826. * @static
  15827. * @memberOf _
  15828. * @since 4.14.0
  15829. * @category Util
  15830. * @param {*} value The value to check.
  15831. * @param {*} defaultValue The default value.
  15832. * @returns {*} Returns the resolved value.
  15833. * @example
  15834. *
  15835. * _.defaultTo(1, 10);
  15836. * // => 1
  15837. *
  15838. * _.defaultTo(undefined, 10);
  15839. * // => 10
  15840. */
  15841. function defaultTo(value, defaultValue) {
  15842. return (value == null || value !== value) ? defaultValue : value;
  15843. }
  15844. /**
  15845. * Creates a function that returns the result of invoking the given functions
  15846. * with the `this` binding of the created function, where each successive
  15847. * invocation is supplied the return value of the previous.
  15848. *
  15849. * @static
  15850. * @memberOf _
  15851. * @since 3.0.0
  15852. * @category Util
  15853. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15854. * @returns {Function} Returns the new composite function.
  15855. * @see _.flowRight
  15856. * @example
  15857. *
  15858. * function square(n) {
  15859. * return n * n;
  15860. * }
  15861. *
  15862. * var addSquare = _.flow([_.add, square]);
  15863. * addSquare(1, 2);
  15864. * // => 9
  15865. */
  15866. var flow = createFlow();
  15867. /**
  15868. * This method is like `_.flow` except that it creates a function that
  15869. * invokes the given functions from right to left.
  15870. *
  15871. * @static
  15872. * @since 3.0.0
  15873. * @memberOf _
  15874. * @category Util
  15875. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15876. * @returns {Function} Returns the new composite function.
  15877. * @see _.flow
  15878. * @example
  15879. *
  15880. * function square(n) {
  15881. * return n * n;
  15882. * }
  15883. *
  15884. * var addSquare = _.flowRight([square, _.add]);
  15885. * addSquare(1, 2);
  15886. * // => 9
  15887. */
  15888. var flowRight = createFlow(true);
  15889. /**
  15890. * This method returns the first argument it receives.
  15891. *
  15892. * @static
  15893. * @since 0.1.0
  15894. * @memberOf _
  15895. * @category Util
  15896. * @param {*} value Any value.
  15897. * @returns {*} Returns `value`.
  15898. * @example
  15899. *
  15900. * var object = { 'a': 1 };
  15901. *
  15902. * console.log(_.identity(object) === object);
  15903. * // => true
  15904. */
  15905. function identity(value) {
  15906. return value;
  15907. }
  15908. /**
  15909. * Creates a function that invokes `func` with the arguments of the created
  15910. * function. If `func` is a property name, the created function returns the
  15911. * property value for a given element. If `func` is an array or object, the
  15912. * created function returns `true` for elements that contain the equivalent
  15913. * source properties, otherwise it returns `false`.
  15914. *
  15915. * @static
  15916. * @since 4.0.0
  15917. * @memberOf _
  15918. * @category Util
  15919. * @param {*} [func=_.identity] The value to convert to a callback.
  15920. * @returns {Function} Returns the callback.
  15921. * @example
  15922. *
  15923. * var users = [
  15924. * { 'user': 'barney', 'age': 36, 'active': true },
  15925. * { 'user': 'fred', 'age': 40, 'active': false }
  15926. * ];
  15927. *
  15928. * // The `_.matches` iteratee shorthand.
  15929. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15930. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15931. *
  15932. * // The `_.matchesProperty` iteratee shorthand.
  15933. * _.filter(users, _.iteratee(['user', 'fred']));
  15934. * // => [{ 'user': 'fred', 'age': 40 }]
  15935. *
  15936. * // The `_.property` iteratee shorthand.
  15937. * _.map(users, _.iteratee('user'));
  15938. * // => ['barney', 'fred']
  15939. *
  15940. * // Create custom iteratee shorthands.
  15941. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15942. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15943. * return func.test(string);
  15944. * };
  15945. * });
  15946. *
  15947. * _.filter(['abc', 'def'], /ef/);
  15948. * // => ['def']
  15949. */
  15950. function iteratee(func) {
  15951. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15952. }
  15953. /**
  15954. * Creates a function that performs a partial deep comparison between a given
  15955. * object and `source`, returning `true` if the given object has equivalent
  15956. * property values, else `false`.
  15957. *
  15958. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15959. * partially applied.
  15960. *
  15961. * Partial comparisons will match empty array and empty object `source`
  15962. * values against any array or object value, respectively. See `_.isEqual`
  15963. * for a list of supported value comparisons.
  15964. *
  15965. * **Note:** Multiple values can be checked by combining several matchers
  15966. * using `_.overSome`
  15967. *
  15968. * @static
  15969. * @memberOf _
  15970. * @since 3.0.0
  15971. * @category Util
  15972. * @param {Object} source The object of property values to match.
  15973. * @returns {Function} Returns the new spec function.
  15974. * @example
  15975. *
  15976. * var objects = [
  15977. * { 'a': 1, 'b': 2, 'c': 3 },
  15978. * { 'a': 4, 'b': 5, 'c': 6 }
  15979. * ];
  15980. *
  15981. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15982. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15983. *
  15984. * // Checking for several possible values
  15985. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15986. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15987. */
  15988. function matches(source) {
  15989. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15990. }
  15991. /**
  15992. * Creates a function that performs a partial deep comparison between the
  15993. * value at `path` of a given object to `srcValue`, returning `true` if the
  15994. * object value is equivalent, else `false`.
  15995. *
  15996. * **Note:** Partial comparisons will match empty array and empty object
  15997. * `srcValue` values against any array or object value, respectively. See
  15998. * `_.isEqual` for a list of supported value comparisons.
  15999. *
  16000. * **Note:** Multiple values can be checked by combining several matchers
  16001. * using `_.overSome`
  16002. *
  16003. * @static
  16004. * @memberOf _
  16005. * @since 3.2.0
  16006. * @category Util
  16007. * @param {Array|string} path The path of the property to get.
  16008. * @param {*} srcValue The value to match.
  16009. * @returns {Function} Returns the new spec function.
  16010. * @example
  16011. *
  16012. * var objects = [
  16013. * { 'a': 1, 'b': 2, 'c': 3 },
  16014. * { 'a': 4, 'b': 5, 'c': 6 }
  16015. * ];
  16016. *
  16017. * _.find(objects, _.matchesProperty('a', 4));
  16018. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16019. *
  16020. * // Checking for several possible values
  16021. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16022. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16023. */
  16024. function matchesProperty(path, srcValue) {
  16025. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16026. }
  16027. /**
  16028. * Creates a function that invokes the method at `path` of a given object.
  16029. * Any additional arguments are provided to the invoked method.
  16030. *
  16031. * @static
  16032. * @memberOf _
  16033. * @since 3.7.0
  16034. * @category Util
  16035. * @param {Array|string} path The path of the method to invoke.
  16036. * @param {...*} [args] The arguments to invoke the method with.
  16037. * @returns {Function} Returns the new invoker function.
  16038. * @example
  16039. *
  16040. * var objects = [
  16041. * { 'a': { 'b': _.constant(2) } },
  16042. * { 'a': { 'b': _.constant(1) } }
  16043. * ];
  16044. *
  16045. * _.map(objects, _.method('a.b'));
  16046. * // => [2, 1]
  16047. *
  16048. * _.map(objects, _.method(['a', 'b']));
  16049. * // => [2, 1]
  16050. */
  16051. var method = baseRest(function(path, args) {
  16052. return function(object) {
  16053. return baseInvoke(object, path, args);
  16054. };
  16055. });
  16056. /**
  16057. * The opposite of `_.method`; this method creates a function that invokes
  16058. * the method at a given path of `object`. Any additional arguments are
  16059. * provided to the invoked method.
  16060. *
  16061. * @static
  16062. * @memberOf _
  16063. * @since 3.7.0
  16064. * @category Util
  16065. * @param {Object} object The object to query.
  16066. * @param {...*} [args] The arguments to invoke the method with.
  16067. * @returns {Function} Returns the new invoker function.
  16068. * @example
  16069. *
  16070. * var array = _.times(3, _.constant),
  16071. * object = { 'a': array, 'b': array, 'c': array };
  16072. *
  16073. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16074. * // => [2, 0]
  16075. *
  16076. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16077. * // => [2, 0]
  16078. */
  16079. var methodOf = baseRest(function(object, args) {
  16080. return function(path) {
  16081. return baseInvoke(object, path, args);
  16082. };
  16083. });
  16084. /**
  16085. * Adds all own enumerable string keyed function properties of a source
  16086. * object to the destination object. If `object` is a function, then methods
  16087. * are added to its prototype as well.
  16088. *
  16089. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16090. * avoid conflicts caused by modifying the original.
  16091. *
  16092. * @static
  16093. * @since 0.1.0
  16094. * @memberOf _
  16095. * @category Util
  16096. * @param {Function|Object} [object=lodash] The destination object.
  16097. * @param {Object} source The object of functions to add.
  16098. * @param {Object} [options={}] The options object.
  16099. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16100. * @returns {Function|Object} Returns `object`.
  16101. * @example
  16102. *
  16103. * function vowels(string) {
  16104. * return _.filter(string, function(v) {
  16105. * return /[aeiou]/i.test(v);
  16106. * });
  16107. * }
  16108. *
  16109. * _.mixin({ 'vowels': vowels });
  16110. * _.vowels('fred');
  16111. * // => ['e']
  16112. *
  16113. * _('fred').vowels().value();
  16114. * // => ['e']
  16115. *
  16116. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16117. * _('fred').vowels();
  16118. * // => ['e']
  16119. */
  16120. function mixin(object, source, options) {
  16121. var props = keys(source),
  16122. methodNames = baseFunctions(source, props);
  16123. if (options == null &&
  16124. !(isObject(source) && (methodNames.length || !props.length))) {
  16125. options = source;
  16126. source = object;
  16127. object = this;
  16128. methodNames = baseFunctions(source, keys(source));
  16129. }
  16130. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16131. isFunc = isFunction(object);
  16132. arrayEach(methodNames, function(methodName) {
  16133. var func = source[methodName];
  16134. object[methodName] = func;
  16135. if (isFunc) {
  16136. object.prototype[methodName] = function() {
  16137. var chainAll = this.__chain__;
  16138. if (chain || chainAll) {
  16139. var result = object(this.__wrapped__),
  16140. actions = result.__actions__ = copyArray(this.__actions__);
  16141. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16142. result.__chain__ = chainAll;
  16143. return result;
  16144. }
  16145. return func.apply(object, arrayPush([this.value()], arguments));
  16146. };
  16147. }
  16148. });
  16149. return object;
  16150. }
  16151. /**
  16152. * Reverts the `_` variable to its previous value and returns a reference to
  16153. * the `lodash` function.
  16154. *
  16155. * @static
  16156. * @since 0.1.0
  16157. * @memberOf _
  16158. * @category Util
  16159. * @returns {Function} Returns the `lodash` function.
  16160. * @example
  16161. *
  16162. * var lodash = _.noConflict();
  16163. */
  16164. function noConflict() {
  16165. if (root._ === this) {
  16166. root._ = oldDash;
  16167. }
  16168. return this;
  16169. }
  16170. /**
  16171. * This method returns `undefined`.
  16172. *
  16173. * @static
  16174. * @memberOf _
  16175. * @since 2.3.0
  16176. * @category Util
  16177. * @example
  16178. *
  16179. * _.times(2, _.noop);
  16180. * // => [undefined, undefined]
  16181. */
  16182. function noop() {
  16183. // No operation performed.
  16184. }
  16185. /**
  16186. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16187. * the nth argument from the end is returned.
  16188. *
  16189. * @static
  16190. * @memberOf _
  16191. * @since 4.0.0
  16192. * @category Util
  16193. * @param {number} [n=0] The index of the argument to return.
  16194. * @returns {Function} Returns the new pass-thru function.
  16195. * @example
  16196. *
  16197. * var func = _.nthArg(1);
  16198. * func('a', 'b', 'c', 'd');
  16199. * // => 'b'
  16200. *
  16201. * var func = _.nthArg(-2);
  16202. * func('a', 'b', 'c', 'd');
  16203. * // => 'c'
  16204. */
  16205. function nthArg(n) {
  16206. n = toInteger(n);
  16207. return baseRest(function(args) {
  16208. return baseNth(args, n);
  16209. });
  16210. }
  16211. /**
  16212. * Creates a function that invokes `iteratees` with the arguments it receives
  16213. * and returns their results.
  16214. *
  16215. * @static
  16216. * @memberOf _
  16217. * @since 4.0.0
  16218. * @category Util
  16219. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16220. * The iteratees to invoke.
  16221. * @returns {Function} Returns the new function.
  16222. * @example
  16223. *
  16224. * var func = _.over([Math.max, Math.min]);
  16225. *
  16226. * func(1, 2, 3, 4);
  16227. * // => [4, 1]
  16228. */
  16229. var over = createOver(arrayMap);
  16230. /**
  16231. * Creates a function that checks if **all** of the `predicates` return
  16232. * truthy when invoked with the arguments it receives.
  16233. *
  16234. * Following shorthands are possible for providing predicates.
  16235. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16236. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16237. *
  16238. * @static
  16239. * @memberOf _
  16240. * @since 4.0.0
  16241. * @category Util
  16242. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16243. * The predicates to check.
  16244. * @returns {Function} Returns the new function.
  16245. * @example
  16246. *
  16247. * var func = _.overEvery([Boolean, isFinite]);
  16248. *
  16249. * func('1');
  16250. * // => true
  16251. *
  16252. * func(null);
  16253. * // => false
  16254. *
  16255. * func(NaN);
  16256. * // => false
  16257. */
  16258. var overEvery = createOver(arrayEvery);
  16259. /**
  16260. * Creates a function that checks if **any** of the `predicates` return
  16261. * truthy when invoked with the arguments it receives.
  16262. *
  16263. * Following shorthands are possible for providing predicates.
  16264. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16265. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16266. *
  16267. * @static
  16268. * @memberOf _
  16269. * @since 4.0.0
  16270. * @category Util
  16271. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16272. * The predicates to check.
  16273. * @returns {Function} Returns the new function.
  16274. * @example
  16275. *
  16276. * var func = _.overSome([Boolean, isFinite]);
  16277. *
  16278. * func('1');
  16279. * // => true
  16280. *
  16281. * func(null);
  16282. * // => true
  16283. *
  16284. * func(NaN);
  16285. * // => false
  16286. *
  16287. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16288. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16289. */
  16290. var overSome = createOver(arraySome);
  16291. /**
  16292. * Creates a function that returns the value at `path` of a given object.
  16293. *
  16294. * @static
  16295. * @memberOf _
  16296. * @since 2.4.0
  16297. * @category Util
  16298. * @param {Array|string} path The path of the property to get.
  16299. * @returns {Function} Returns the new accessor function.
  16300. * @example
  16301. *
  16302. * var objects = [
  16303. * { 'a': { 'b': 2 } },
  16304. * { 'a': { 'b': 1 } }
  16305. * ];
  16306. *
  16307. * _.map(objects, _.property('a.b'));
  16308. * // => [2, 1]
  16309. *
  16310. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16311. * // => [1, 2]
  16312. */
  16313. function property(path) {
  16314. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16315. }
  16316. /**
  16317. * The opposite of `_.property`; this method creates a function that returns
  16318. * the value at a given path of `object`.
  16319. *
  16320. * @static
  16321. * @memberOf _
  16322. * @since 3.0.0
  16323. * @category Util
  16324. * @param {Object} object The object to query.
  16325. * @returns {Function} Returns the new accessor function.
  16326. * @example
  16327. *
  16328. * var array = [0, 1, 2],
  16329. * object = { 'a': array, 'b': array, 'c': array };
  16330. *
  16331. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16332. * // => [2, 0]
  16333. *
  16334. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16335. * // => [2, 0]
  16336. */
  16337. function propertyOf(object) {
  16338. return function(path) {
  16339. return object == null ? undefined : baseGet(object, path);
  16340. };
  16341. }
  16342. /**
  16343. * Creates an array of numbers (positive and/or negative) progressing from
  16344. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16345. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16346. * it's set to `start` with `start` then set to `0`.
  16347. *
  16348. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16349. * floating-point values which can produce unexpected results.
  16350. *
  16351. * @static
  16352. * @since 0.1.0
  16353. * @memberOf _
  16354. * @category Util
  16355. * @param {number} [start=0] The start of the range.
  16356. * @param {number} end The end of the range.
  16357. * @param {number} [step=1] The value to increment or decrement by.
  16358. * @returns {Array} Returns the range of numbers.
  16359. * @see _.inRange, _.rangeRight
  16360. * @example
  16361. *
  16362. * _.range(4);
  16363. * // => [0, 1, 2, 3]
  16364. *
  16365. * _.range(-4);
  16366. * // => [0, -1, -2, -3]
  16367. *
  16368. * _.range(1, 5);
  16369. * // => [1, 2, 3, 4]
  16370. *
  16371. * _.range(0, 20, 5);
  16372. * // => [0, 5, 10, 15]
  16373. *
  16374. * _.range(0, -4, -1);
  16375. * // => [0, -1, -2, -3]
  16376. *
  16377. * _.range(1, 4, 0);
  16378. * // => [1, 1, 1]
  16379. *
  16380. * _.range(0);
  16381. * // => []
  16382. */
  16383. var range = createRange();
  16384. /**
  16385. * This method is like `_.range` except that it populates values in
  16386. * descending order.
  16387. *
  16388. * @static
  16389. * @memberOf _
  16390. * @since 4.0.0
  16391. * @category Util
  16392. * @param {number} [start=0] The start of the range.
  16393. * @param {number} end The end of the range.
  16394. * @param {number} [step=1] The value to increment or decrement by.
  16395. * @returns {Array} Returns the range of numbers.
  16396. * @see _.inRange, _.range
  16397. * @example
  16398. *
  16399. * _.rangeRight(4);
  16400. * // => [3, 2, 1, 0]
  16401. *
  16402. * _.rangeRight(-4);
  16403. * // => [-3, -2, -1, 0]
  16404. *
  16405. * _.rangeRight(1, 5);
  16406. * // => [4, 3, 2, 1]
  16407. *
  16408. * _.rangeRight(0, 20, 5);
  16409. * // => [15, 10, 5, 0]
  16410. *
  16411. * _.rangeRight(0, -4, -1);
  16412. * // => [-3, -2, -1, 0]
  16413. *
  16414. * _.rangeRight(1, 4, 0);
  16415. * // => [1, 1, 1]
  16416. *
  16417. * _.rangeRight(0);
  16418. * // => []
  16419. */
  16420. var rangeRight = createRange(true);
  16421. /**
  16422. * This method returns a new empty array.
  16423. *
  16424. * @static
  16425. * @memberOf _
  16426. * @since 4.13.0
  16427. * @category Util
  16428. * @returns {Array} Returns the new empty array.
  16429. * @example
  16430. *
  16431. * var arrays = _.times(2, _.stubArray);
  16432. *
  16433. * console.log(arrays);
  16434. * // => [[], []]
  16435. *
  16436. * console.log(arrays[0] === arrays[1]);
  16437. * // => false
  16438. */
  16439. function stubArray() {
  16440. return [];
  16441. }
  16442. /**
  16443. * This method returns `false`.
  16444. *
  16445. * @static
  16446. * @memberOf _
  16447. * @since 4.13.0
  16448. * @category Util
  16449. * @returns {boolean} Returns `false`.
  16450. * @example
  16451. *
  16452. * _.times(2, _.stubFalse);
  16453. * // => [false, false]
  16454. */
  16455. function stubFalse() {
  16456. return false;
  16457. }
  16458. /**
  16459. * This method returns a new empty object.
  16460. *
  16461. * @static
  16462. * @memberOf _
  16463. * @since 4.13.0
  16464. * @category Util
  16465. * @returns {Object} Returns the new empty object.
  16466. * @example
  16467. *
  16468. * var objects = _.times(2, _.stubObject);
  16469. *
  16470. * console.log(objects);
  16471. * // => [{}, {}]
  16472. *
  16473. * console.log(objects[0] === objects[1]);
  16474. * // => false
  16475. */
  16476. function stubObject() {
  16477. return {};
  16478. }
  16479. /**
  16480. * This method returns an empty string.
  16481. *
  16482. * @static
  16483. * @memberOf _
  16484. * @since 4.13.0
  16485. * @category Util
  16486. * @returns {string} Returns the empty string.
  16487. * @example
  16488. *
  16489. * _.times(2, _.stubString);
  16490. * // => ['', '']
  16491. */
  16492. function stubString() {
  16493. return '';
  16494. }
  16495. /**
  16496. * This method returns `true`.
  16497. *
  16498. * @static
  16499. * @memberOf _
  16500. * @since 4.13.0
  16501. * @category Util
  16502. * @returns {boolean} Returns `true`.
  16503. * @example
  16504. *
  16505. * _.times(2, _.stubTrue);
  16506. * // => [true, true]
  16507. */
  16508. function stubTrue() {
  16509. return true;
  16510. }
  16511. /**
  16512. * Invokes the iteratee `n` times, returning an array of the results of
  16513. * each invocation. The iteratee is invoked with one argument; (index).
  16514. *
  16515. * @static
  16516. * @since 0.1.0
  16517. * @memberOf _
  16518. * @category Util
  16519. * @param {number} n The number of times to invoke `iteratee`.
  16520. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16521. * @returns {Array} Returns the array of results.
  16522. * @example
  16523. *
  16524. * _.times(3, String);
  16525. * // => ['0', '1', '2']
  16526. *
  16527. * _.times(4, _.constant(0));
  16528. * // => [0, 0, 0, 0]
  16529. */
  16530. function times(n, iteratee) {
  16531. n = toInteger(n);
  16532. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16533. return [];
  16534. }
  16535. var index = MAX_ARRAY_LENGTH,
  16536. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16537. iteratee = getIteratee(iteratee);
  16538. n -= MAX_ARRAY_LENGTH;
  16539. var result = baseTimes(length, iteratee);
  16540. while (++index < n) {
  16541. iteratee(index);
  16542. }
  16543. return result;
  16544. }
  16545. /**
  16546. * Converts `value` to a property path array.
  16547. *
  16548. * @static
  16549. * @memberOf _
  16550. * @since 4.0.0
  16551. * @category Util
  16552. * @param {*} value The value to convert.
  16553. * @returns {Array} Returns the new property path array.
  16554. * @example
  16555. *
  16556. * _.toPath('a.b.c');
  16557. * // => ['a', 'b', 'c']
  16558. *
  16559. * _.toPath('a[0].b.c');
  16560. * // => ['a', '0', 'b', 'c']
  16561. */
  16562. function toPath(value) {
  16563. if (isArray(value)) {
  16564. return arrayMap(value, toKey);
  16565. }
  16566. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16567. }
  16568. /**
  16569. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16570. *
  16571. * @static
  16572. * @since 0.1.0
  16573. * @memberOf _
  16574. * @category Util
  16575. * @param {string} [prefix=''] The value to prefix the ID with.
  16576. * @returns {string} Returns the unique ID.
  16577. * @example
  16578. *
  16579. * _.uniqueId('contact_');
  16580. * // => 'contact_104'
  16581. *
  16582. * _.uniqueId();
  16583. * // => '105'
  16584. */
  16585. function uniqueId(prefix) {
  16586. var id = ++idCounter;
  16587. return toString(prefix) + id;
  16588. }
  16589. /*------------------------------------------------------------------------*/
  16590. /**
  16591. * Adds two numbers.
  16592. *
  16593. * @static
  16594. * @memberOf _
  16595. * @since 3.4.0
  16596. * @category Math
  16597. * @param {number} augend The first number in an addition.
  16598. * @param {number} addend The second number in an addition.
  16599. * @returns {number} Returns the total.
  16600. * @example
  16601. *
  16602. * _.add(6, 4);
  16603. * // => 10
  16604. */
  16605. var add = createMathOperation(function(augend, addend) {
  16606. return augend + addend;
  16607. }, 0);
  16608. /**
  16609. * Computes `number` rounded up to `precision`.
  16610. *
  16611. * @static
  16612. * @memberOf _
  16613. * @since 3.10.0
  16614. * @category Math
  16615. * @param {number} number The number to round up.
  16616. * @param {number} [precision=0] The precision to round up to.
  16617. * @returns {number} Returns the rounded up number.
  16618. * @example
  16619. *
  16620. * _.ceil(4.006);
  16621. * // => 5
  16622. *
  16623. * _.ceil(6.004, 2);
  16624. * // => 6.01
  16625. *
  16626. * _.ceil(6040, -2);
  16627. * // => 6100
  16628. */
  16629. var ceil = createRound('ceil');
  16630. /**
  16631. * Divide two numbers.
  16632. *
  16633. * @static
  16634. * @memberOf _
  16635. * @since 4.7.0
  16636. * @category Math
  16637. * @param {number} dividend The first number in a division.
  16638. * @param {number} divisor The second number in a division.
  16639. * @returns {number} Returns the quotient.
  16640. * @example
  16641. *
  16642. * _.divide(6, 4);
  16643. * // => 1.5
  16644. */
  16645. var divide = createMathOperation(function(dividend, divisor) {
  16646. return dividend / divisor;
  16647. }, 1);
  16648. /**
  16649. * Computes `number` rounded down to `precision`.
  16650. *
  16651. * @static
  16652. * @memberOf _
  16653. * @since 3.10.0
  16654. * @category Math
  16655. * @param {number} number The number to round down.
  16656. * @param {number} [precision=0] The precision to round down to.
  16657. * @returns {number} Returns the rounded down number.
  16658. * @example
  16659. *
  16660. * _.floor(4.006);
  16661. * // => 4
  16662. *
  16663. * _.floor(0.046, 2);
  16664. * // => 0.04
  16665. *
  16666. * _.floor(4060, -2);
  16667. * // => 4000
  16668. */
  16669. var floor = createRound('floor');
  16670. /**
  16671. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16672. * `undefined` is returned.
  16673. *
  16674. * @static
  16675. * @since 0.1.0
  16676. * @memberOf _
  16677. * @category Math
  16678. * @param {Array} array The array to iterate over.
  16679. * @returns {*} Returns the maximum value.
  16680. * @example
  16681. *
  16682. * _.max([4, 2, 8, 6]);
  16683. * // => 8
  16684. *
  16685. * _.max([]);
  16686. * // => undefined
  16687. */
  16688. function max(array) {
  16689. return (array && array.length)
  16690. ? baseExtremum(array, identity, baseGt)
  16691. : undefined;
  16692. }
  16693. /**
  16694. * This method is like `_.max` except that it accepts `iteratee` which is
  16695. * invoked for each element in `array` to generate the criterion by which
  16696. * the value is ranked. The iteratee is invoked with one argument: (value).
  16697. *
  16698. * @static
  16699. * @memberOf _
  16700. * @since 4.0.0
  16701. * @category Math
  16702. * @param {Array} array The array to iterate over.
  16703. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16704. * @returns {*} Returns the maximum value.
  16705. * @example
  16706. *
  16707. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16708. *
  16709. * _.maxBy(objects, function(o) { return o.n; });
  16710. * // => { 'n': 2 }
  16711. *
  16712. * // The `_.property` iteratee shorthand.
  16713. * _.maxBy(objects, 'n');
  16714. * // => { 'n': 2 }
  16715. */
  16716. function maxBy(array, iteratee) {
  16717. return (array && array.length)
  16718. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16719. : undefined;
  16720. }
  16721. /**
  16722. * Computes the mean of the values in `array`.
  16723. *
  16724. * @static
  16725. * @memberOf _
  16726. * @since 4.0.0
  16727. * @category Math
  16728. * @param {Array} array The array to iterate over.
  16729. * @returns {number} Returns the mean.
  16730. * @example
  16731. *
  16732. * _.mean([4, 2, 8, 6]);
  16733. * // => 5
  16734. */
  16735. function mean(array) {
  16736. return baseMean(array, identity);
  16737. }
  16738. /**
  16739. * This method is like `_.mean` except that it accepts `iteratee` which is
  16740. * invoked for each element in `array` to generate the value to be averaged.
  16741. * The iteratee is invoked with one argument: (value).
  16742. *
  16743. * @static
  16744. * @memberOf _
  16745. * @since 4.7.0
  16746. * @category Math
  16747. * @param {Array} array The array to iterate over.
  16748. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16749. * @returns {number} Returns the mean.
  16750. * @example
  16751. *
  16752. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16753. *
  16754. * _.meanBy(objects, function(o) { return o.n; });
  16755. * // => 5
  16756. *
  16757. * // The `_.property` iteratee shorthand.
  16758. * _.meanBy(objects, 'n');
  16759. * // => 5
  16760. */
  16761. function meanBy(array, iteratee) {
  16762. return baseMean(array, getIteratee(iteratee, 2));
  16763. }
  16764. /**
  16765. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16766. * `undefined` is returned.
  16767. *
  16768. * @static
  16769. * @since 0.1.0
  16770. * @memberOf _
  16771. * @category Math
  16772. * @param {Array} array The array to iterate over.
  16773. * @returns {*} Returns the minimum value.
  16774. * @example
  16775. *
  16776. * _.min([4, 2, 8, 6]);
  16777. * // => 2
  16778. *
  16779. * _.min([]);
  16780. * // => undefined
  16781. */
  16782. function min(array) {
  16783. return (array && array.length)
  16784. ? baseExtremum(array, identity, baseLt)
  16785. : undefined;
  16786. }
  16787. /**
  16788. * This method is like `_.min` except that it accepts `iteratee` which is
  16789. * invoked for each element in `array` to generate the criterion by which
  16790. * the value is ranked. The iteratee is invoked with one argument: (value).
  16791. *
  16792. * @static
  16793. * @memberOf _
  16794. * @since 4.0.0
  16795. * @category Math
  16796. * @param {Array} array The array to iterate over.
  16797. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16798. * @returns {*} Returns the minimum value.
  16799. * @example
  16800. *
  16801. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16802. *
  16803. * _.minBy(objects, function(o) { return o.n; });
  16804. * // => { 'n': 1 }
  16805. *
  16806. * // The `_.property` iteratee shorthand.
  16807. * _.minBy(objects, 'n');
  16808. * // => { 'n': 1 }
  16809. */
  16810. function minBy(array, iteratee) {
  16811. return (array && array.length)
  16812. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16813. : undefined;
  16814. }
  16815. /**
  16816. * Multiply two numbers.
  16817. *
  16818. * @static
  16819. * @memberOf _
  16820. * @since 4.7.0
  16821. * @category Math
  16822. * @param {number} multiplier The first number in a multiplication.
  16823. * @param {number} multiplicand The second number in a multiplication.
  16824. * @returns {number} Returns the product.
  16825. * @example
  16826. *
  16827. * _.multiply(6, 4);
  16828. * // => 24
  16829. */
  16830. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16831. return multiplier * multiplicand;
  16832. }, 1);
  16833. /**
  16834. * Computes `number` rounded to `precision`.
  16835. *
  16836. * @static
  16837. * @memberOf _
  16838. * @since 3.10.0
  16839. * @category Math
  16840. * @param {number} number The number to round.
  16841. * @param {number} [precision=0] The precision to round to.
  16842. * @returns {number} Returns the rounded number.
  16843. * @example
  16844. *
  16845. * _.round(4.006);
  16846. * // => 4
  16847. *
  16848. * _.round(4.006, 2);
  16849. * // => 4.01
  16850. *
  16851. * _.round(4060, -2);
  16852. * // => 4100
  16853. */
  16854. var round = createRound('round');
  16855. /**
  16856. * Subtract two numbers.
  16857. *
  16858. * @static
  16859. * @memberOf _
  16860. * @since 4.0.0
  16861. * @category Math
  16862. * @param {number} minuend The first number in a subtraction.
  16863. * @param {number} subtrahend The second number in a subtraction.
  16864. * @returns {number} Returns the difference.
  16865. * @example
  16866. *
  16867. * _.subtract(6, 4);
  16868. * // => 2
  16869. */
  16870. var subtract = createMathOperation(function(minuend, subtrahend) {
  16871. return minuend - subtrahend;
  16872. }, 0);
  16873. /**
  16874. * Computes the sum of the values in `array`.
  16875. *
  16876. * @static
  16877. * @memberOf _
  16878. * @since 3.4.0
  16879. * @category Math
  16880. * @param {Array} array The array to iterate over.
  16881. * @returns {number} Returns the sum.
  16882. * @example
  16883. *
  16884. * _.sum([4, 2, 8, 6]);
  16885. * // => 20
  16886. */
  16887. function sum(array) {
  16888. return (array && array.length)
  16889. ? baseSum(array, identity)
  16890. : 0;
  16891. }
  16892. /**
  16893. * This method is like `_.sum` except that it accepts `iteratee` which is
  16894. * invoked for each element in `array` to generate the value to be summed.
  16895. * The iteratee is invoked with one argument: (value).
  16896. *
  16897. * @static
  16898. * @memberOf _
  16899. * @since 4.0.0
  16900. * @category Math
  16901. * @param {Array} array The array to iterate over.
  16902. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16903. * @returns {number} Returns the sum.
  16904. * @example
  16905. *
  16906. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16907. *
  16908. * _.sumBy(objects, function(o) { return o.n; });
  16909. * // => 20
  16910. *
  16911. * // The `_.property` iteratee shorthand.
  16912. * _.sumBy(objects, 'n');
  16913. * // => 20
  16914. */
  16915. function sumBy(array, iteratee) {
  16916. return (array && array.length)
  16917. ? baseSum(array, getIteratee(iteratee, 2))
  16918. : 0;
  16919. }
  16920. /*------------------------------------------------------------------------*/
  16921. // Add methods that return wrapped values in chain sequences.
  16922. lodash.after = after;
  16923. lodash.ary = ary;
  16924. lodash.assign = assign;
  16925. lodash.assignIn = assignIn;
  16926. lodash.assignInWith = assignInWith;
  16927. lodash.assignWith = assignWith;
  16928. lodash.at = at;
  16929. lodash.before = before;
  16930. lodash.bind = bind;
  16931. lodash.bindAll = bindAll;
  16932. lodash.bindKey = bindKey;
  16933. lodash.castArray = castArray;
  16934. lodash.chain = chain;
  16935. lodash.chunk = chunk;
  16936. lodash.compact = compact;
  16937. lodash.concat = concat;
  16938. lodash.cond = cond;
  16939. lodash.conforms = conforms;
  16940. lodash.constant = constant;
  16941. lodash.countBy = countBy;
  16942. lodash.create = create;
  16943. lodash.curry = curry;
  16944. lodash.curryRight = curryRight;
  16945. lodash.debounce = debounce;
  16946. lodash.defaults = defaults;
  16947. lodash.defaultsDeep = defaultsDeep;
  16948. lodash.defer = defer;
  16949. lodash.delay = delay;
  16950. lodash.difference = difference;
  16951. lodash.differenceBy = differenceBy;
  16952. lodash.differenceWith = differenceWith;
  16953. lodash.drop = drop;
  16954. lodash.dropRight = dropRight;
  16955. lodash.dropRightWhile = dropRightWhile;
  16956. lodash.dropWhile = dropWhile;
  16957. lodash.fill = fill;
  16958. lodash.filter = filter;
  16959. lodash.flatMap = flatMap;
  16960. lodash.flatMapDeep = flatMapDeep;
  16961. lodash.flatMapDepth = flatMapDepth;
  16962. lodash.flatten = flatten;
  16963. lodash.flattenDeep = flattenDeep;
  16964. lodash.flattenDepth = flattenDepth;
  16965. lodash.flip = flip;
  16966. lodash.flow = flow;
  16967. lodash.flowRight = flowRight;
  16968. lodash.fromPairs = fromPairs;
  16969. lodash.functions = functions;
  16970. lodash.functionsIn = functionsIn;
  16971. lodash.groupBy = groupBy;
  16972. lodash.initial = initial;
  16973. lodash.intersection = intersection;
  16974. lodash.intersectionBy = intersectionBy;
  16975. lodash.intersectionWith = intersectionWith;
  16976. lodash.invert = invert;
  16977. lodash.invertBy = invertBy;
  16978. lodash.invokeMap = invokeMap;
  16979. lodash.iteratee = iteratee;
  16980. lodash.keyBy = keyBy;
  16981. lodash.keys = keys;
  16982. lodash.keysIn = keysIn;
  16983. lodash.map = map;
  16984. lodash.mapKeys = mapKeys;
  16985. lodash.mapValues = mapValues;
  16986. lodash.matches = matches;
  16987. lodash.matchesProperty = matchesProperty;
  16988. lodash.memoize = memoize;
  16989. lodash.merge = merge;
  16990. lodash.mergeWith = mergeWith;
  16991. lodash.method = method;
  16992. lodash.methodOf = methodOf;
  16993. lodash.mixin = mixin;
  16994. lodash.negate = negate;
  16995. lodash.nthArg = nthArg;
  16996. lodash.omit = omit;
  16997. lodash.omitBy = omitBy;
  16998. lodash.once = once;
  16999. lodash.orderBy = orderBy;
  17000. lodash.over = over;
  17001. lodash.overArgs = overArgs;
  17002. lodash.overEvery = overEvery;
  17003. lodash.overSome = overSome;
  17004. lodash.partial = partial;
  17005. lodash.partialRight = partialRight;
  17006. lodash.partition = partition;
  17007. lodash.pick = pick;
  17008. lodash.pickBy = pickBy;
  17009. lodash.property = property;
  17010. lodash.propertyOf = propertyOf;
  17011. lodash.pull = pull;
  17012. lodash.pullAll = pullAll;
  17013. lodash.pullAllBy = pullAllBy;
  17014. lodash.pullAllWith = pullAllWith;
  17015. lodash.pullAt = pullAt;
  17016. lodash.range = range;
  17017. lodash.rangeRight = rangeRight;
  17018. lodash.rearg = rearg;
  17019. lodash.reject = reject;
  17020. lodash.remove = remove;
  17021. lodash.rest = rest;
  17022. lodash.reverse = reverse;
  17023. lodash.sampleSize = sampleSize;
  17024. lodash.set = set;
  17025. lodash.setWith = setWith;
  17026. lodash.shuffle = shuffle;
  17027. lodash.slice = slice;
  17028. lodash.sortBy = sortBy;
  17029. lodash.sortedUniq = sortedUniq;
  17030. lodash.sortedUniqBy = sortedUniqBy;
  17031. lodash.split = split;
  17032. lodash.spread = spread;
  17033. lodash.tail = tail;
  17034. lodash.take = take;
  17035. lodash.takeRight = takeRight;
  17036. lodash.takeRightWhile = takeRightWhile;
  17037. lodash.takeWhile = takeWhile;
  17038. lodash.tap = tap;
  17039. lodash.throttle = throttle;
  17040. lodash.thru = thru;
  17041. lodash.toArray = toArray;
  17042. lodash.toPairs = toPairs;
  17043. lodash.toPairsIn = toPairsIn;
  17044. lodash.toPath = toPath;
  17045. lodash.toPlainObject = toPlainObject;
  17046. lodash.transform = transform;
  17047. lodash.unary = unary;
  17048. lodash.union = union;
  17049. lodash.unionBy = unionBy;
  17050. lodash.unionWith = unionWith;
  17051. lodash.uniq = uniq;
  17052. lodash.uniqBy = uniqBy;
  17053. lodash.uniqWith = uniqWith;
  17054. lodash.unset = unset;
  17055. lodash.unzip = unzip;
  17056. lodash.unzipWith = unzipWith;
  17057. lodash.update = update;
  17058. lodash.updateWith = updateWith;
  17059. lodash.values = values;
  17060. lodash.valuesIn = valuesIn;
  17061. lodash.without = without;
  17062. lodash.words = words;
  17063. lodash.wrap = wrap;
  17064. lodash.xor = xor;
  17065. lodash.xorBy = xorBy;
  17066. lodash.xorWith = xorWith;
  17067. lodash.zip = zip;
  17068. lodash.zipObject = zipObject;
  17069. lodash.zipObjectDeep = zipObjectDeep;
  17070. lodash.zipWith = zipWith;
  17071. // Add aliases.
  17072. lodash.entries = toPairs;
  17073. lodash.entriesIn = toPairsIn;
  17074. lodash.extend = assignIn;
  17075. lodash.extendWith = assignInWith;
  17076. // Add methods to `lodash.prototype`.
  17077. mixin(lodash, lodash);
  17078. /*------------------------------------------------------------------------*/
  17079. // Add methods that return unwrapped values in chain sequences.
  17080. lodash.add = add;
  17081. lodash.attempt = attempt;
  17082. lodash.camelCase = camelCase;
  17083. lodash.capitalize = capitalize;
  17084. lodash.ceil = ceil;
  17085. lodash.clamp = clamp;
  17086. lodash.clone = clone;
  17087. lodash.cloneDeep = cloneDeep;
  17088. lodash.cloneDeepWith = cloneDeepWith;
  17089. lodash.cloneWith = cloneWith;
  17090. lodash.conformsTo = conformsTo;
  17091. lodash.deburr = deburr;
  17092. lodash.defaultTo = defaultTo;
  17093. lodash.divide = divide;
  17094. lodash.endsWith = endsWith;
  17095. lodash.eq = eq;
  17096. lodash.escape = escape;
  17097. lodash.escapeRegExp = escapeRegExp;
  17098. lodash.every = every;
  17099. lodash.find = find;
  17100. lodash.findIndex = findIndex;
  17101. lodash.findKey = findKey;
  17102. lodash.findLast = findLast;
  17103. lodash.findLastIndex = findLastIndex;
  17104. lodash.findLastKey = findLastKey;
  17105. lodash.floor = floor;
  17106. lodash.forEach = forEach;
  17107. lodash.forEachRight = forEachRight;
  17108. lodash.forIn = forIn;
  17109. lodash.forInRight = forInRight;
  17110. lodash.forOwn = forOwn;
  17111. lodash.forOwnRight = forOwnRight;
  17112. lodash.get = get;
  17113. lodash.gt = gt;
  17114. lodash.gte = gte;
  17115. lodash.has = has;
  17116. lodash.hasIn = hasIn;
  17117. lodash.head = head;
  17118. lodash.identity = identity;
  17119. lodash.includes = includes;
  17120. lodash.indexOf = indexOf;
  17121. lodash.inRange = inRange;
  17122. lodash.invoke = invoke;
  17123. lodash.isArguments = isArguments;
  17124. lodash.isArray = isArray;
  17125. lodash.isArrayBuffer = isArrayBuffer;
  17126. lodash.isArrayLike = isArrayLike;
  17127. lodash.isArrayLikeObject = isArrayLikeObject;
  17128. lodash.isBoolean = isBoolean;
  17129. lodash.isBuffer = isBuffer;
  17130. lodash.isDate = isDate;
  17131. lodash.isElement = isElement;
  17132. lodash.isEmpty = isEmpty;
  17133. lodash.isEqual = isEqual;
  17134. lodash.isEqualWith = isEqualWith;
  17135. lodash.isError = isError;
  17136. lodash.isFinite = isFinite;
  17137. lodash.isFunction = isFunction;
  17138. lodash.isInteger = isInteger;
  17139. lodash.isLength = isLength;
  17140. lodash.isMap = isMap;
  17141. lodash.isMatch = isMatch;
  17142. lodash.isMatchWith = isMatchWith;
  17143. lodash.isNaN = isNaN;
  17144. lodash.isNative = isNative;
  17145. lodash.isNil = isNil;
  17146. lodash.isNull = isNull;
  17147. lodash.isNumber = isNumber;
  17148. lodash.isObject = isObject;
  17149. lodash.isObjectLike = isObjectLike;
  17150. lodash.isPlainObject = isPlainObject;
  17151. lodash.isRegExp = isRegExp;
  17152. lodash.isSafeInteger = isSafeInteger;
  17153. lodash.isSet = isSet;
  17154. lodash.isString = isString;
  17155. lodash.isSymbol = isSymbol;
  17156. lodash.isTypedArray = isTypedArray;
  17157. lodash.isUndefined = isUndefined;
  17158. lodash.isWeakMap = isWeakMap;
  17159. lodash.isWeakSet = isWeakSet;
  17160. lodash.join = join;
  17161. lodash.kebabCase = kebabCase;
  17162. lodash.last = last;
  17163. lodash.lastIndexOf = lastIndexOf;
  17164. lodash.lowerCase = lowerCase;
  17165. lodash.lowerFirst = lowerFirst;
  17166. lodash.lt = lt;
  17167. lodash.lte = lte;
  17168. lodash.max = max;
  17169. lodash.maxBy = maxBy;
  17170. lodash.mean = mean;
  17171. lodash.meanBy = meanBy;
  17172. lodash.min = min;
  17173. lodash.minBy = minBy;
  17174. lodash.stubArray = stubArray;
  17175. lodash.stubFalse = stubFalse;
  17176. lodash.stubObject = stubObject;
  17177. lodash.stubString = stubString;
  17178. lodash.stubTrue = stubTrue;
  17179. lodash.multiply = multiply;
  17180. lodash.nth = nth;
  17181. lodash.noConflict = noConflict;
  17182. lodash.noop = noop;
  17183. lodash.now = now;
  17184. lodash.pad = pad;
  17185. lodash.padEnd = padEnd;
  17186. lodash.padStart = padStart;
  17187. lodash.parseInt = parseInt;
  17188. lodash.random = random;
  17189. lodash.reduce = reduce;
  17190. lodash.reduceRight = reduceRight;
  17191. lodash.repeat = repeat;
  17192. lodash.replace = replace;
  17193. lodash.result = result;
  17194. lodash.round = round;
  17195. lodash.runInContext = runInContext;
  17196. lodash.sample = sample;
  17197. lodash.size = size;
  17198. lodash.snakeCase = snakeCase;
  17199. lodash.some = some;
  17200. lodash.sortedIndex = sortedIndex;
  17201. lodash.sortedIndexBy = sortedIndexBy;
  17202. lodash.sortedIndexOf = sortedIndexOf;
  17203. lodash.sortedLastIndex = sortedLastIndex;
  17204. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17205. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17206. lodash.startCase = startCase;
  17207. lodash.startsWith = startsWith;
  17208. lodash.subtract = subtract;
  17209. lodash.sum = sum;
  17210. lodash.sumBy = sumBy;
  17211. lodash.template = template;
  17212. lodash.times = times;
  17213. lodash.toFinite = toFinite;
  17214. lodash.toInteger = toInteger;
  17215. lodash.toLength = toLength;
  17216. lodash.toLower = toLower;
  17217. lodash.toNumber = toNumber;
  17218. lodash.toSafeInteger = toSafeInteger;
  17219. lodash.toString = toString;
  17220. lodash.toUpper = toUpper;
  17221. lodash.trim = trim;
  17222. lodash.trimEnd = trimEnd;
  17223. lodash.trimStart = trimStart;
  17224. lodash.truncate = truncate;
  17225. lodash.unescape = unescape;
  17226. lodash.uniqueId = uniqueId;
  17227. lodash.upperCase = upperCase;
  17228. lodash.upperFirst = upperFirst;
  17229. // Add aliases.
  17230. lodash.each = forEach;
  17231. lodash.eachRight = forEachRight;
  17232. lodash.first = head;
  17233. mixin(lodash, (function() {
  17234. var source = {};
  17235. baseForOwn(lodash, function(func, methodName) {
  17236. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17237. source[methodName] = func;
  17238. }
  17239. });
  17240. return source;
  17241. }()), { 'chain': false });
  17242. /*------------------------------------------------------------------------*/
  17243. /**
  17244. * The semantic version number.
  17245. *
  17246. * @static
  17247. * @memberOf _
  17248. * @type {string}
  17249. */
  17250. lodash.VERSION = VERSION;
  17251. // Assign default placeholders.
  17252. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17253. lodash[methodName].placeholder = lodash;
  17254. });
  17255. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17256. arrayEach(['drop', 'take'], function(methodName, index) {
  17257. LazyWrapper.prototype[methodName] = function(n) {
  17258. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17259. var result = (this.__filtered__ && !index)
  17260. ? new LazyWrapper(this)
  17261. : this.clone();
  17262. if (result.__filtered__) {
  17263. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17264. } else {
  17265. result.__views__.push({
  17266. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17267. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17268. });
  17269. }
  17270. return result;
  17271. };
  17272. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17273. return this.reverse()[methodName](n).reverse();
  17274. };
  17275. });
  17276. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17277. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17278. var type = index + 1,
  17279. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17280. LazyWrapper.prototype[methodName] = function(iteratee) {
  17281. var result = this.clone();
  17282. result.__iteratees__.push({
  17283. 'iteratee': getIteratee(iteratee, 3),
  17284. 'type': type
  17285. });
  17286. result.__filtered__ = result.__filtered__ || isFilter;
  17287. return result;
  17288. };
  17289. });
  17290. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17291. arrayEach(['head', 'last'], function(methodName, index) {
  17292. var takeName = 'take' + (index ? 'Right' : '');
  17293. LazyWrapper.prototype[methodName] = function() {
  17294. return this[takeName](1).value()[0];
  17295. };
  17296. });
  17297. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17298. arrayEach(['initial', 'tail'], function(methodName, index) {
  17299. var dropName = 'drop' + (index ? '' : 'Right');
  17300. LazyWrapper.prototype[methodName] = function() {
  17301. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17302. };
  17303. });
  17304. LazyWrapper.prototype.compact = function() {
  17305. return this.filter(identity);
  17306. };
  17307. LazyWrapper.prototype.find = function(predicate) {
  17308. return this.filter(predicate).head();
  17309. };
  17310. LazyWrapper.prototype.findLast = function(predicate) {
  17311. return this.reverse().find(predicate);
  17312. };
  17313. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17314. if (typeof path == 'function') {
  17315. return new LazyWrapper(this);
  17316. }
  17317. return this.map(function(value) {
  17318. return baseInvoke(value, path, args);
  17319. });
  17320. });
  17321. LazyWrapper.prototype.reject = function(predicate) {
  17322. return this.filter(negate(getIteratee(predicate)));
  17323. };
  17324. LazyWrapper.prototype.slice = function(start, end) {
  17325. start = toInteger(start);
  17326. var result = this;
  17327. if (result.__filtered__ && (start > 0 || end < 0)) {
  17328. return new LazyWrapper(result);
  17329. }
  17330. if (start < 0) {
  17331. result = result.takeRight(-start);
  17332. } else if (start) {
  17333. result = result.drop(start);
  17334. }
  17335. if (end !== undefined) {
  17336. end = toInteger(end);
  17337. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17338. }
  17339. return result;
  17340. };
  17341. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17342. return this.reverse().takeWhile(predicate).reverse();
  17343. };
  17344. LazyWrapper.prototype.toArray = function() {
  17345. return this.take(MAX_ARRAY_LENGTH);
  17346. };
  17347. // Add `LazyWrapper` methods to `lodash.prototype`.
  17348. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17349. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17350. isTaker = /^(?:head|last)$/.test(methodName),
  17351. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17352. retUnwrapped = isTaker || /^find/.test(methodName);
  17353. if (!lodashFunc) {
  17354. return;
  17355. }
  17356. lodash.prototype[methodName] = function() {
  17357. var value = this.__wrapped__,
  17358. args = isTaker ? [1] : arguments,
  17359. isLazy = value instanceof LazyWrapper,
  17360. iteratee = args[0],
  17361. useLazy = isLazy || isArray(value);
  17362. var interceptor = function(value) {
  17363. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17364. return (isTaker && chainAll) ? result[0] : result;
  17365. };
  17366. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17367. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17368. isLazy = useLazy = false;
  17369. }
  17370. var chainAll = this.__chain__,
  17371. isHybrid = !!this.__actions__.length,
  17372. isUnwrapped = retUnwrapped && !chainAll,
  17373. onlyLazy = isLazy && !isHybrid;
  17374. if (!retUnwrapped && useLazy) {
  17375. value = onlyLazy ? value : new LazyWrapper(this);
  17376. var result = func.apply(value, args);
  17377. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17378. return new LodashWrapper(result, chainAll);
  17379. }
  17380. if (isUnwrapped && onlyLazy) {
  17381. return func.apply(this, args);
  17382. }
  17383. result = this.thru(interceptor);
  17384. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17385. };
  17386. });
  17387. // Add `Array` methods to `lodash.prototype`.
  17388. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17389. var func = arrayProto[methodName],
  17390. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17391. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17392. lodash.prototype[methodName] = function() {
  17393. var args = arguments;
  17394. if (retUnwrapped && !this.__chain__) {
  17395. var value = this.value();
  17396. return func.apply(isArray(value) ? value : [], args);
  17397. }
  17398. return this[chainName](function(value) {
  17399. return func.apply(isArray(value) ? value : [], args);
  17400. });
  17401. };
  17402. });
  17403. // Map minified method names to their real names.
  17404. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17405. var lodashFunc = lodash[methodName];
  17406. if (lodashFunc) {
  17407. var key = lodashFunc.name + '';
  17408. if (!hasOwnProperty.call(realNames, key)) {
  17409. realNames[key] = [];
  17410. }
  17411. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17412. }
  17413. });
  17414. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17415. 'name': 'wrapper',
  17416. 'func': undefined
  17417. }];
  17418. // Add methods to `LazyWrapper`.
  17419. LazyWrapper.prototype.clone = lazyClone;
  17420. LazyWrapper.prototype.reverse = lazyReverse;
  17421. LazyWrapper.prototype.value = lazyValue;
  17422. // Add chain sequence methods to the `lodash` wrapper.
  17423. lodash.prototype.at = wrapperAt;
  17424. lodash.prototype.chain = wrapperChain;
  17425. lodash.prototype.commit = wrapperCommit;
  17426. lodash.prototype.next = wrapperNext;
  17427. lodash.prototype.plant = wrapperPlant;
  17428. lodash.prototype.reverse = wrapperReverse;
  17429. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17430. // Add lazy aliases.
  17431. lodash.prototype.first = lodash.prototype.head;
  17432. if (symIterator) {
  17433. lodash.prototype[symIterator] = wrapperToIterator;
  17434. }
  17435. return lodash;
  17436. });
  17437. /*--------------------------------------------------------------------------*/
  17438. // Export lodash.
  17439. var _ = runInContext();
  17440. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17441. if (true) {
  17442. // Expose Lodash on the global object to prevent errors when Lodash is
  17443. // loaded by a script tag in the presence of an AMD loader.
  17444. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17445. // Use `_.noConflict` to remove Lodash from the global object.
  17446. root._ = _;
  17447. // Define as an anonymous module so, through path mapping, it can be
  17448. // referenced as the "underscore" module.
  17449. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17450. return _;
  17451. }).call(exports, __webpack_require__, exports, module),
  17452. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17453. }
  17454. // Check for `exports` after `define` in case a build optimizer adds it.
  17455. else {}
  17456. }.call(this));
  17457. /***/ }),
  17458. /***/ "./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":
  17459. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17460. !*** ./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 ***!
  17461. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17462. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17463. "use strict";
  17464. __webpack_require__.r(__webpack_exports__);
  17465. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17466. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17467. /* harmony export */ });
  17468. /* 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");
  17469. /* 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__);
  17470. /* 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");
  17471. var options = {};
  17472. options.insert = "head";
  17473. options.singleton = false;
  17474. 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);
  17475. /* 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 || {});
  17476. /***/ }),
  17477. /***/ "./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":
  17478. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17479. !*** ./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 ***!
  17480. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17481. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17482. "use strict";
  17483. __webpack_require__.r(__webpack_exports__);
  17484. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17485. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17486. /* harmony export */ });
  17487. /* 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");
  17488. /* 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__);
  17489. /* 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");
  17490. var options = {};
  17491. options.insert = "head";
  17492. options.singleton = false;
  17493. 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);
  17494. /* 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 || {});
  17495. /***/ }),
  17496. /***/ "./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":
  17497. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17498. !*** ./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 ***!
  17499. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17501. "use strict";
  17502. __webpack_require__.r(__webpack_exports__);
  17503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17504. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17505. /* harmony export */ });
  17506. /* 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");
  17507. /* 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__);
  17508. /* 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");
  17509. var options = {};
  17510. options.insert = "head";
  17511. options.singleton = false;
  17512. 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);
  17513. /* 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 || {});
  17514. /***/ }),
  17515. /***/ "./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":
  17516. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17517. !*** ./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 ***!
  17518. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17519. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17520. "use strict";
  17521. __webpack_require__.r(__webpack_exports__);
  17522. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17523. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17524. /* harmony export */ });
  17525. /* 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");
  17526. /* 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__);
  17527. /* 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");
  17528. var options = {};
  17529. options.insert = "head";
  17530. options.singleton = false;
  17531. 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);
  17532. /* 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 || {});
  17533. /***/ }),
  17534. /***/ "./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":
  17535. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17536. !*** ./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 ***!
  17537. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17538. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17539. "use strict";
  17540. __webpack_require__.r(__webpack_exports__);
  17541. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17542. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17543. /* harmony export */ });
  17544. /* 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");
  17545. /* 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__);
  17546. /* 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");
  17547. var options = {};
  17548. options.insert = "head";
  17549. options.singleton = false;
  17550. 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);
  17551. /* 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 || {});
  17552. /***/ }),
  17553. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17554. /*!******************************************************!*\
  17555. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17556. \******************************************************/
  17557. /***/ ((__unused_webpack_module, exports) => {
  17558. "use strict";
  17559. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17560. // runtime helper for setting properties on components
  17561. // in a tree-shakable way
  17562. exports["default"] = (sfc, props) => {
  17563. const target = sfc.__vccOpts || sfc;
  17564. for (const [key, val] of props) {
  17565. target[key] = val;
  17566. }
  17567. return target;
  17568. };
  17569. /***/ }),
  17570. /***/ "./resources/js/components/AppButtonLink.vue":
  17571. /*!***************************************************!*\
  17572. !*** ./resources/js/components/AppButtonLink.vue ***!
  17573. \***************************************************/
  17574. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17575. "use strict";
  17576. __webpack_require__.r(__webpack_exports__);
  17577. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17578. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17579. /* harmony export */ });
  17580. /* harmony import */ var _AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17581. /* harmony import */ var _AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17582. /* 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");
  17583. ;
  17584. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17585. /* hot reload */
  17586. if (false) {}
  17587. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17588. /***/ }),
  17589. /***/ "./resources/js/components/AppFooter.vue":
  17590. /*!***********************************************!*\
  17591. !*** ./resources/js/components/AppFooter.vue ***!
  17592. \***********************************************/
  17593. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17594. "use strict";
  17595. __webpack_require__.r(__webpack_exports__);
  17596. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17597. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17598. /* harmony export */ });
  17599. /* 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");
  17600. /* 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");
  17601. /* 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");
  17602. const script = {}
  17603. ;
  17604. 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"]])
  17605. /* hot reload */
  17606. if (false) {}
  17607. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17608. /***/ }),
  17609. /***/ "./resources/js/components/AppMessage.vue":
  17610. /*!************************************************!*\
  17611. !*** ./resources/js/components/AppMessage.vue ***!
  17612. \************************************************/
  17613. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17614. "use strict";
  17615. __webpack_require__.r(__webpack_exports__);
  17616. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17617. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17618. /* harmony export */ });
  17619. /* 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");
  17620. /* 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");
  17621. /* 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");
  17622. ;
  17623. 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"]])
  17624. /* hot reload */
  17625. if (false) {}
  17626. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17627. /***/ }),
  17628. /***/ "./resources/js/components/AppPagination.vue":
  17629. /*!***************************************************!*\
  17630. !*** ./resources/js/components/AppPagination.vue ***!
  17631. \***************************************************/
  17632. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17633. "use strict";
  17634. __webpack_require__.r(__webpack_exports__);
  17635. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17636. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17637. /* harmony export */ });
  17638. /* harmony import */ var _AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17639. /* harmony import */ var _AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17640. /* 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");
  17641. ;
  17642. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17643. /* hot reload */
  17644. if (false) {}
  17645. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17646. /***/ }),
  17647. /***/ "./resources/js/components/AppSidebar.vue":
  17648. /*!************************************************!*\
  17649. !*** ./resources/js/components/AppSidebar.vue ***!
  17650. \************************************************/
  17651. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17652. "use strict";
  17653. __webpack_require__.r(__webpack_exports__);
  17654. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17655. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17656. /* harmony export */ });
  17657. /* 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");
  17658. /* 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");
  17659. /* 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");
  17660. /* 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");
  17661. ;
  17662. 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"]])
  17663. /* hot reload */
  17664. if (false) {}
  17665. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17666. /***/ }),
  17667. /***/ "./resources/js/components/AppSubSidebar.vue":
  17668. /*!***************************************************!*\
  17669. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17670. \***************************************************/
  17671. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17672. "use strict";
  17673. __webpack_require__.r(__webpack_exports__);
  17674. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17675. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17676. /* harmony export */ });
  17677. /* 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");
  17678. /* 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");
  17679. /* 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");
  17680. /* 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");
  17681. ;
  17682. 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"]])
  17683. /* hot reload */
  17684. if (false) {}
  17685. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17686. /***/ }),
  17687. /***/ "./resources/js/components/AppTopBar.vue":
  17688. /*!***********************************************!*\
  17689. !*** ./resources/js/components/AppTopBar.vue ***!
  17690. \***********************************************/
  17691. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17692. "use strict";
  17693. __webpack_require__.r(__webpack_exports__);
  17694. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17695. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17696. /* harmony export */ });
  17697. /* 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");
  17698. /* 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");
  17699. /* 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");
  17700. /* 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");
  17701. ;
  17702. 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"]])
  17703. /* hot reload */
  17704. if (false) {}
  17705. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17706. /***/ }),
  17707. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17708. /*!**************************************************!*\
  17709. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17710. \**************************************************/
  17711. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17712. "use strict";
  17713. __webpack_require__.r(__webpack_exports__);
  17714. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17715. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17716. /* harmony export */ });
  17717. /* 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");
  17718. /* 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");
  17719. /* 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");
  17720. /* 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");
  17721. ;
  17722. 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"]])
  17723. /* hot reload */
  17724. if (false) {}
  17725. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17726. /***/ }),
  17727. /***/ "./resources/js/pages/topup/Index.vue":
  17728. /*!********************************************!*\
  17729. !*** ./resources/js/pages/topup/Index.vue ***!
  17730. \********************************************/
  17731. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17732. "use strict";
  17733. __webpack_require__.r(__webpack_exports__);
  17734. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17735. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17736. /* harmony export */ });
  17737. /* harmony import */ var _Index_vue_vue_type_template_id_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=3bf54f8c */ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c");
  17738. /* harmony import */ var _Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js");
  17739. /* 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");
  17740. ;
  17741. 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"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/topup/Index.vue"]])
  17742. /* hot reload */
  17743. if (false) {}
  17744. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17745. /***/ }),
  17746. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17747. /*!**************************************************************************************!*\
  17748. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17749. \**************************************************************************************/
  17750. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17751. "use strict";
  17752. __webpack_require__.r(__webpack_exports__);
  17753. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17754. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17755. /* harmony export */ });
  17756. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17757. /***/ }),
  17758. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17759. /*!***********************************************************************************!*\
  17760. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17761. \***********************************************************************************/
  17762. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17763. "use strict";
  17764. __webpack_require__.r(__webpack_exports__);
  17765. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17766. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17767. /* harmony export */ });
  17768. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17769. /***/ }),
  17770. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17771. /*!**************************************************************************************!*\
  17772. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17773. \**************************************************************************************/
  17774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17775. "use strict";
  17776. __webpack_require__.r(__webpack_exports__);
  17777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17778. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17779. /* harmony export */ });
  17780. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17781. /***/ }),
  17782. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17783. /*!***********************************************************************************!*\
  17784. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17785. \***********************************************************************************/
  17786. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17787. "use strict";
  17788. __webpack_require__.r(__webpack_exports__);
  17789. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17790. /* harmony export */ "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"])
  17791. /* harmony export */ });
  17792. /* 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");
  17793. /***/ }),
  17794. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17795. /*!**************************************************************************************!*\
  17796. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17797. \**************************************************************************************/
  17798. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17799. "use strict";
  17800. __webpack_require__.r(__webpack_exports__);
  17801. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17802. /* harmony export */ "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"])
  17803. /* harmony export */ });
  17804. /* 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");
  17805. /***/ }),
  17806. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17807. /*!**********************************************************************************!*\
  17808. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17809. \**********************************************************************************/
  17810. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17811. "use strict";
  17812. __webpack_require__.r(__webpack_exports__);
  17813. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17814. /* harmony export */ "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"])
  17815. /* harmony export */ });
  17816. /* 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");
  17817. /***/ }),
  17818. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17819. /*!*************************************************************************************!*\
  17820. !*** ./resources/js/layouts/DashboardLayout.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_DashboardLayout_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_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");
  17829. /***/ }),
  17830. /***/ "./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  17831. /*!*******************************************************************************!*\
  17832. !*** ./resources/js/pages/topup/Index.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_Index_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_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js");
  17841. /***/ }),
  17842. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17843. /*!*********************************************************************************!*\
  17844. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17845. \*********************************************************************************/
  17846. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17847. "use strict";
  17848. __webpack_require__.r(__webpack_exports__);
  17849. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17850. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17851. /* harmony export */ });
  17852. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17853. /***/ }),
  17854. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17855. /*!*****************************************************************************************!*\
  17856. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17857. \*****************************************************************************************/
  17858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17859. "use strict";
  17860. __webpack_require__.r(__webpack_exports__);
  17861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17862. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17863. /* harmony export */ });
  17864. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17865. /***/ }),
  17866. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17867. /*!******************************************************************************!*\
  17868. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17869. \******************************************************************************/
  17870. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17871. "use strict";
  17872. __webpack_require__.r(__webpack_exports__);
  17873. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17874. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17875. /* harmony export */ });
  17876. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17877. /***/ }),
  17878. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17879. /*!*********************************************************************************!*\
  17880. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17881. \*********************************************************************************/
  17882. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17883. "use strict";
  17884. __webpack_require__.r(__webpack_exports__);
  17885. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17886. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17887. /* harmony export */ });
  17888. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17889. /***/ }),
  17890. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17891. /*!******************************************************************************************!*\
  17892. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17893. \******************************************************************************************/
  17894. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17895. "use strict";
  17896. __webpack_require__.r(__webpack_exports__);
  17897. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17898. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17899. /* harmony export */ });
  17900. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17901. /***/ }),
  17902. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17903. /*!*********************************************************************************************!*\
  17904. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  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 */ "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)
  17911. /* harmony export */ });
  17912. /* 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");
  17913. /***/ }),
  17914. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17915. /*!*****************************************************************************************!*\
  17916. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  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_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__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_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");
  17925. /***/ }),
  17926. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17927. /*!********************************************************************************************!*\
  17928. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&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_DashboardLayout_vue_vue_type_template_id_549bf5ac_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_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");
  17937. /***/ }),
  17938. /***/ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c":
  17939. /*!**************************************************************************!*\
  17940. !*** ./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  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_Index_vue_vue_type_template_id_3bf54f8c__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_Index_vue_vue_type_template_id_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=3bf54f8c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/topup/Index.vue?vue&type=template&id=3bf54f8c");
  17949. /***/ }),
  17950. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17951. /*!********************************************************************************************************!*\
  17952. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17953. \********************************************************************************************************/
  17954. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17955. "use strict";
  17956. __webpack_require__.r(__webpack_exports__);
  17957. /* 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");
  17958. /***/ }),
  17959. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17960. /*!*********************************************************************************************************!*\
  17961. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17962. \*********************************************************************************************************/
  17963. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17964. "use strict";
  17965. __webpack_require__.r(__webpack_exports__);
  17966. /* 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");
  17967. /***/ }),
  17968. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17969. /*!************************************************************************************************************!*\
  17970. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17971. \************************************************************************************************************/
  17972. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17973. "use strict";
  17974. __webpack_require__.r(__webpack_exports__);
  17975. /* 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");
  17976. /***/ }),
  17977. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17978. /*!********************************************************************************************************!*\
  17979. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17980. \********************************************************************************************************/
  17981. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17982. "use strict";
  17983. __webpack_require__.r(__webpack_exports__);
  17984. /* 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");
  17985. /***/ }),
  17986. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17987. /*!***********************************************************************************************************!*\
  17988. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17989. \***********************************************************************************************************/
  17990. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17991. "use strict";
  17992. __webpack_require__.r(__webpack_exports__);
  17993. /* 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");
  17994. /***/ })
  17995. }]);