resources_js_pages_topup_Index_vue.js 705KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470
  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. });
  1194. /***/ }),
  1195. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1196. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1197. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1198. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1199. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1200. "use strict";
  1201. __webpack_require__.r(__webpack_exports__);
  1202. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1203. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1204. /* harmony export */ });
  1205. /* 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");
  1206. /* 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__);
  1207. // Imports
  1208. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1209. // Module
  1210. ___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}", ""]);
  1211. // Exports
  1212. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1213. /***/ }),
  1214. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1215. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1216. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1217. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1218. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1219. "use strict";
  1220. __webpack_require__.r(__webpack_exports__);
  1221. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1222. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1223. /* harmony export */ });
  1224. /* 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");
  1225. /* 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__);
  1226. // Imports
  1227. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1228. // Module
  1229. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1230. // Exports
  1231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1232. /***/ }),
  1233. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1234. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1235. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1236. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1237. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1238. "use strict";
  1239. __webpack_require__.r(__webpack_exports__);
  1240. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1241. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1242. /* harmony export */ });
  1243. /* 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");
  1244. /* 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__);
  1245. // Imports
  1246. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1247. // Module
  1248. ___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}", ""]);
  1249. // Exports
  1250. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1251. /***/ }),
  1252. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1253. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1254. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1255. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1256. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1257. "use strict";
  1258. __webpack_require__.r(__webpack_exports__);
  1259. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1260. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1261. /* harmony export */ });
  1262. /* 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");
  1263. /* 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__);
  1264. // Imports
  1265. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1266. // Module
  1267. ___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}", ""]);
  1268. // Exports
  1269. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1270. /***/ }),
  1271. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1272. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1273. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1274. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1275. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1276. "use strict";
  1277. __webpack_require__.r(__webpack_exports__);
  1278. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1279. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1280. /* harmony export */ });
  1281. /* 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");
  1282. /* 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__);
  1283. // Imports
  1284. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1285. // Module
  1286. ___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}", ""]);
  1287. // Exports
  1288. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1289. /***/ }),
  1290. /***/ "./node_modules/dayjs/dayjs.min.js":
  1291. /*!*****************************************!*\
  1292. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1293. \*****************************************/
  1294. /***/ (function(module) {
  1295. !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}));
  1296. /***/ }),
  1297. /***/ "./node_modules/lodash/lodash.js":
  1298. /*!***************************************!*\
  1299. !*** ./node_modules/lodash/lodash.js ***!
  1300. \***************************************/
  1301. /***/ (function(module, exports, __webpack_require__) {
  1302. /* module decorator */ module = __webpack_require__.nmd(module);
  1303. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1304. * @license
  1305. * Lodash <https://lodash.com/>
  1306. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1307. * Released under MIT license <https://lodash.com/license>
  1308. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1309. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1310. */
  1311. ;(function() {
  1312. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1313. var undefined;
  1314. /** Used as the semantic version number. */
  1315. var VERSION = '4.17.21';
  1316. /** Used as the size to enable large array optimizations. */
  1317. var LARGE_ARRAY_SIZE = 200;
  1318. /** Error message constants. */
  1319. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1320. FUNC_ERROR_TEXT = 'Expected a function',
  1321. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1322. /** Used to stand-in for `undefined` hash values. */
  1323. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1324. /** Used as the maximum memoize cache size. */
  1325. var MAX_MEMOIZE_SIZE = 500;
  1326. /** Used as the internal argument placeholder. */
  1327. var PLACEHOLDER = '__lodash_placeholder__';
  1328. /** Used to compose bitmasks for cloning. */
  1329. var CLONE_DEEP_FLAG = 1,
  1330. CLONE_FLAT_FLAG = 2,
  1331. CLONE_SYMBOLS_FLAG = 4;
  1332. /** Used to compose bitmasks for value comparisons. */
  1333. var COMPARE_PARTIAL_FLAG = 1,
  1334. COMPARE_UNORDERED_FLAG = 2;
  1335. /** Used to compose bitmasks for function metadata. */
  1336. var WRAP_BIND_FLAG = 1,
  1337. WRAP_BIND_KEY_FLAG = 2,
  1338. WRAP_CURRY_BOUND_FLAG = 4,
  1339. WRAP_CURRY_FLAG = 8,
  1340. WRAP_CURRY_RIGHT_FLAG = 16,
  1341. WRAP_PARTIAL_FLAG = 32,
  1342. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1343. WRAP_ARY_FLAG = 128,
  1344. WRAP_REARG_FLAG = 256,
  1345. WRAP_FLIP_FLAG = 512;
  1346. /** Used as default options for `_.truncate`. */
  1347. var DEFAULT_TRUNC_LENGTH = 30,
  1348. DEFAULT_TRUNC_OMISSION = '...';
  1349. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1350. var HOT_COUNT = 800,
  1351. HOT_SPAN = 16;
  1352. /** Used to indicate the type of lazy iteratees. */
  1353. var LAZY_FILTER_FLAG = 1,
  1354. LAZY_MAP_FLAG = 2,
  1355. LAZY_WHILE_FLAG = 3;
  1356. /** Used as references for various `Number` constants. */
  1357. var INFINITY = 1 / 0,
  1358. MAX_SAFE_INTEGER = 9007199254740991,
  1359. MAX_INTEGER = 1.7976931348623157e+308,
  1360. NAN = 0 / 0;
  1361. /** Used as references for the maximum length and index of an array. */
  1362. var MAX_ARRAY_LENGTH = 4294967295,
  1363. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1364. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1365. /** Used to associate wrap methods with their bit flags. */
  1366. var wrapFlags = [
  1367. ['ary', WRAP_ARY_FLAG],
  1368. ['bind', WRAP_BIND_FLAG],
  1369. ['bindKey', WRAP_BIND_KEY_FLAG],
  1370. ['curry', WRAP_CURRY_FLAG],
  1371. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1372. ['flip', WRAP_FLIP_FLAG],
  1373. ['partial', WRAP_PARTIAL_FLAG],
  1374. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1375. ['rearg', WRAP_REARG_FLAG]
  1376. ];
  1377. /** `Object#toString` result references. */
  1378. var argsTag = '[object Arguments]',
  1379. arrayTag = '[object Array]',
  1380. asyncTag = '[object AsyncFunction]',
  1381. boolTag = '[object Boolean]',
  1382. dateTag = '[object Date]',
  1383. domExcTag = '[object DOMException]',
  1384. errorTag = '[object Error]',
  1385. funcTag = '[object Function]',
  1386. genTag = '[object GeneratorFunction]',
  1387. mapTag = '[object Map]',
  1388. numberTag = '[object Number]',
  1389. nullTag = '[object Null]',
  1390. objectTag = '[object Object]',
  1391. promiseTag = '[object Promise]',
  1392. proxyTag = '[object Proxy]',
  1393. regexpTag = '[object RegExp]',
  1394. setTag = '[object Set]',
  1395. stringTag = '[object String]',
  1396. symbolTag = '[object Symbol]',
  1397. undefinedTag = '[object Undefined]',
  1398. weakMapTag = '[object WeakMap]',
  1399. weakSetTag = '[object WeakSet]';
  1400. var arrayBufferTag = '[object ArrayBuffer]',
  1401. dataViewTag = '[object DataView]',
  1402. float32Tag = '[object Float32Array]',
  1403. float64Tag = '[object Float64Array]',
  1404. int8Tag = '[object Int8Array]',
  1405. int16Tag = '[object Int16Array]',
  1406. int32Tag = '[object Int32Array]',
  1407. uint8Tag = '[object Uint8Array]',
  1408. uint8ClampedTag = '[object Uint8ClampedArray]',
  1409. uint16Tag = '[object Uint16Array]',
  1410. uint32Tag = '[object Uint32Array]';
  1411. /** Used to match empty string literals in compiled template source. */
  1412. var reEmptyStringLeading = /\b__p \+= '';/g,
  1413. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1414. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1415. /** Used to match HTML entities and HTML characters. */
  1416. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1417. reUnescapedHtml = /[&<>"']/g,
  1418. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1419. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1420. /** Used to match template delimiters. */
  1421. var reEscape = /<%-([\s\S]+?)%>/g,
  1422. reEvaluate = /<%([\s\S]+?)%>/g,
  1423. reInterpolate = /<%=([\s\S]+?)%>/g;
  1424. /** Used to match property names within property paths. */
  1425. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1426. reIsPlainProp = /^\w*$/,
  1427. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1428. /**
  1429. * Used to match `RegExp`
  1430. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1431. */
  1432. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1433. reHasRegExpChar = RegExp(reRegExpChar.source);
  1434. /** Used to match leading whitespace. */
  1435. var reTrimStart = /^\s+/;
  1436. /** Used to match a single whitespace character. */
  1437. var reWhitespace = /\s/;
  1438. /** Used to match wrap detail comments. */
  1439. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1440. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1441. reSplitDetails = /,? & /;
  1442. /** Used to match words composed of alphanumeric characters. */
  1443. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1444. /**
  1445. * Used to validate the `validate` option in `_.template` variable.
  1446. *
  1447. * Forbids characters which could potentially change the meaning of the function argument definition:
  1448. * - "()," (modification of function parameters)
  1449. * - "=" (default value)
  1450. * - "[]{}" (destructuring of function parameters)
  1451. * - "/" (beginning of a comment)
  1452. * - whitespace
  1453. */
  1454. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1455. /** Used to match backslashes in property paths. */
  1456. var reEscapeChar = /\\(\\)?/g;
  1457. /**
  1458. * Used to match
  1459. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1460. */
  1461. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1462. /** Used to match `RegExp` flags from their coerced string values. */
  1463. var reFlags = /\w*$/;
  1464. /** Used to detect bad signed hexadecimal string values. */
  1465. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1466. /** Used to detect binary string values. */
  1467. var reIsBinary = /^0b[01]+$/i;
  1468. /** Used to detect host constructors (Safari). */
  1469. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1470. /** Used to detect octal string values. */
  1471. var reIsOctal = /^0o[0-7]+$/i;
  1472. /** Used to detect unsigned integer values. */
  1473. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1474. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1475. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1476. /** Used to ensure capturing order of template delimiters. */
  1477. var reNoMatch = /($^)/;
  1478. /** Used to match unescaped characters in compiled string literals. */
  1479. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1480. /** Used to compose unicode character classes. */
  1481. var rsAstralRange = '\\ud800-\\udfff',
  1482. rsComboMarksRange = '\\u0300-\\u036f',
  1483. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1484. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1485. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1486. rsDingbatRange = '\\u2700-\\u27bf',
  1487. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1488. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1489. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1490. rsPunctuationRange = '\\u2000-\\u206f',
  1491. 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',
  1492. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1493. rsVarRange = '\\ufe0e\\ufe0f',
  1494. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1495. /** Used to compose unicode capture groups. */
  1496. var rsApos = "['\u2019]",
  1497. rsAstral = '[' + rsAstralRange + ']',
  1498. rsBreak = '[' + rsBreakRange + ']',
  1499. rsCombo = '[' + rsComboRange + ']',
  1500. rsDigits = '\\d+',
  1501. rsDingbat = '[' + rsDingbatRange + ']',
  1502. rsLower = '[' + rsLowerRange + ']',
  1503. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1504. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1505. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1506. rsNonAstral = '[^' + rsAstralRange + ']',
  1507. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1508. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1509. rsUpper = '[' + rsUpperRange + ']',
  1510. rsZWJ = '\\u200d';
  1511. /** Used to compose unicode regexes. */
  1512. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1513. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1514. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1515. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1516. reOptMod = rsModifier + '?',
  1517. rsOptVar = '[' + rsVarRange + ']?',
  1518. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1519. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1520. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1521. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1522. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1523. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1524. /** Used to match apostrophes. */
  1525. var reApos = RegExp(rsApos, 'g');
  1526. /**
  1527. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1528. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1529. */
  1530. var reComboMark = RegExp(rsCombo, 'g');
  1531. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1532. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1533. /** Used to match complex or compound words. */
  1534. var reUnicodeWord = RegExp([
  1535. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1536. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1537. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1538. rsUpper + '+' + rsOptContrUpper,
  1539. rsOrdUpper,
  1540. rsOrdLower,
  1541. rsDigits,
  1542. rsEmoji
  1543. ].join('|'), 'g');
  1544. /** 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/). */
  1545. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1546. /** Used to detect strings that need a more robust regexp to match words. */
  1547. 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 ]/;
  1548. /** Used to assign default `context` object properties. */
  1549. var contextProps = [
  1550. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1551. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1552. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1553. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1554. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1555. ];
  1556. /** Used to make template sourceURLs easier to identify. */
  1557. var templateCounter = -1;
  1558. /** Used to identify `toStringTag` values of typed arrays. */
  1559. var typedArrayTags = {};
  1560. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1561. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1562. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1563. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1564. typedArrayTags[uint32Tag] = true;
  1565. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1566. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1567. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1568. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1569. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1570. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1571. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1572. typedArrayTags[weakMapTag] = false;
  1573. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1574. var cloneableTags = {};
  1575. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1576. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1577. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1578. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1579. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1580. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1581. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1582. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1583. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1584. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1585. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1586. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1587. cloneableTags[weakMapTag] = false;
  1588. /** Used to map Latin Unicode letters to basic Latin letters. */
  1589. var deburredLetters = {
  1590. // Latin-1 Supplement block.
  1591. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1592. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1593. '\xc7': 'C', '\xe7': 'c',
  1594. '\xd0': 'D', '\xf0': 'd',
  1595. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1596. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1597. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1598. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1599. '\xd1': 'N', '\xf1': 'n',
  1600. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1601. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1602. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1603. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1604. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1605. '\xc6': 'Ae', '\xe6': 'ae',
  1606. '\xde': 'Th', '\xfe': 'th',
  1607. '\xdf': 'ss',
  1608. // Latin Extended-A block.
  1609. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1610. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1611. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1612. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1613. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1614. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1615. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1616. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1617. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1618. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1619. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1620. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1621. '\u0134': 'J', '\u0135': 'j',
  1622. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1623. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1624. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1625. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1626. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1627. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1628. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1629. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1630. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1631. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1632. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1633. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1634. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1635. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1636. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1637. '\u0174': 'W', '\u0175': 'w',
  1638. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1639. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1640. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1641. '\u0132': 'IJ', '\u0133': 'ij',
  1642. '\u0152': 'Oe', '\u0153': 'oe',
  1643. '\u0149': "'n", '\u017f': 's'
  1644. };
  1645. /** Used to map characters to HTML entities. */
  1646. var htmlEscapes = {
  1647. '&': '&amp;',
  1648. '<': '&lt;',
  1649. '>': '&gt;',
  1650. '"': '&quot;',
  1651. "'": '&#39;'
  1652. };
  1653. /** Used to map HTML entities to characters. */
  1654. var htmlUnescapes = {
  1655. '&amp;': '&',
  1656. '&lt;': '<',
  1657. '&gt;': '>',
  1658. '&quot;': '"',
  1659. '&#39;': "'"
  1660. };
  1661. /** Used to escape characters for inclusion in compiled string literals. */
  1662. var stringEscapes = {
  1663. '\\': '\\',
  1664. "'": "'",
  1665. '\n': 'n',
  1666. '\r': 'r',
  1667. '\u2028': 'u2028',
  1668. '\u2029': 'u2029'
  1669. };
  1670. /** Built-in method references without a dependency on `root`. */
  1671. var freeParseFloat = parseFloat,
  1672. freeParseInt = parseInt;
  1673. /** Detect free variable `global` from Node.js. */
  1674. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1675. /** Detect free variable `self`. */
  1676. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1677. /** Used as a reference to the global object. */
  1678. var root = freeGlobal || freeSelf || Function('return this')();
  1679. /** Detect free variable `exports`. */
  1680. var freeExports = true && exports && !exports.nodeType && exports;
  1681. /** Detect free variable `module`. */
  1682. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1683. /** Detect the popular CommonJS extension `module.exports`. */
  1684. var moduleExports = freeModule && freeModule.exports === freeExports;
  1685. /** Detect free variable `process` from Node.js. */
  1686. var freeProcess = moduleExports && freeGlobal.process;
  1687. /** Used to access faster Node.js helpers. */
  1688. var nodeUtil = (function() {
  1689. try {
  1690. // Use `util.types` for Node.js 10+.
  1691. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1692. if (types) {
  1693. return types;
  1694. }
  1695. // Legacy `process.binding('util')` for Node.js < 10.
  1696. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1697. } catch (e) {}
  1698. }());
  1699. /* Node.js helper references. */
  1700. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1701. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1702. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1703. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1704. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1705. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1706. /*--------------------------------------------------------------------------*/
  1707. /**
  1708. * A faster alternative to `Function#apply`, this function invokes `func`
  1709. * with the `this` binding of `thisArg` and the arguments of `args`.
  1710. *
  1711. * @private
  1712. * @param {Function} func The function to invoke.
  1713. * @param {*} thisArg The `this` binding of `func`.
  1714. * @param {Array} args The arguments to invoke `func` with.
  1715. * @returns {*} Returns the result of `func`.
  1716. */
  1717. function apply(func, thisArg, args) {
  1718. switch (args.length) {
  1719. case 0: return func.call(thisArg);
  1720. case 1: return func.call(thisArg, args[0]);
  1721. case 2: return func.call(thisArg, args[0], args[1]);
  1722. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1723. }
  1724. return func.apply(thisArg, args);
  1725. }
  1726. /**
  1727. * A specialized version of `baseAggregator` for arrays.
  1728. *
  1729. * @private
  1730. * @param {Array} [array] The array to iterate over.
  1731. * @param {Function} setter The function to set `accumulator` values.
  1732. * @param {Function} iteratee The iteratee to transform keys.
  1733. * @param {Object} accumulator The initial aggregated object.
  1734. * @returns {Function} Returns `accumulator`.
  1735. */
  1736. function arrayAggregator(array, setter, iteratee, accumulator) {
  1737. var index = -1,
  1738. length = array == null ? 0 : array.length;
  1739. while (++index < length) {
  1740. var value = array[index];
  1741. setter(accumulator, value, iteratee(value), array);
  1742. }
  1743. return accumulator;
  1744. }
  1745. /**
  1746. * A specialized version of `_.forEach` for arrays without support for
  1747. * iteratee shorthands.
  1748. *
  1749. * @private
  1750. * @param {Array} [array] The array to iterate over.
  1751. * @param {Function} iteratee The function invoked per iteration.
  1752. * @returns {Array} Returns `array`.
  1753. */
  1754. function arrayEach(array, iteratee) {
  1755. var index = -1,
  1756. length = array == null ? 0 : array.length;
  1757. while (++index < length) {
  1758. if (iteratee(array[index], index, array) === false) {
  1759. break;
  1760. }
  1761. }
  1762. return array;
  1763. }
  1764. /**
  1765. * A specialized version of `_.forEachRight` for arrays without support for
  1766. * iteratee shorthands.
  1767. *
  1768. * @private
  1769. * @param {Array} [array] The array to iterate over.
  1770. * @param {Function} iteratee The function invoked per iteration.
  1771. * @returns {Array} Returns `array`.
  1772. */
  1773. function arrayEachRight(array, iteratee) {
  1774. var length = array == null ? 0 : array.length;
  1775. while (length--) {
  1776. if (iteratee(array[length], length, array) === false) {
  1777. break;
  1778. }
  1779. }
  1780. return array;
  1781. }
  1782. /**
  1783. * A specialized version of `_.every` for arrays without support for
  1784. * iteratee shorthands.
  1785. *
  1786. * @private
  1787. * @param {Array} [array] The array to iterate over.
  1788. * @param {Function} predicate The function invoked per iteration.
  1789. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1790. * else `false`.
  1791. */
  1792. function arrayEvery(array, predicate) {
  1793. var index = -1,
  1794. length = array == null ? 0 : array.length;
  1795. while (++index < length) {
  1796. if (!predicate(array[index], index, array)) {
  1797. return false;
  1798. }
  1799. }
  1800. return true;
  1801. }
  1802. /**
  1803. * A specialized version of `_.filter` for arrays without support for
  1804. * iteratee shorthands.
  1805. *
  1806. * @private
  1807. * @param {Array} [array] The array to iterate over.
  1808. * @param {Function} predicate The function invoked per iteration.
  1809. * @returns {Array} Returns the new filtered array.
  1810. */
  1811. function arrayFilter(array, predicate) {
  1812. var index = -1,
  1813. length = array == null ? 0 : array.length,
  1814. resIndex = 0,
  1815. result = [];
  1816. while (++index < length) {
  1817. var value = array[index];
  1818. if (predicate(value, index, array)) {
  1819. result[resIndex++] = value;
  1820. }
  1821. }
  1822. return result;
  1823. }
  1824. /**
  1825. * A specialized version of `_.includes` for arrays without support for
  1826. * specifying an index to search from.
  1827. *
  1828. * @private
  1829. * @param {Array} [array] The array to inspect.
  1830. * @param {*} target The value to search for.
  1831. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1832. */
  1833. function arrayIncludes(array, value) {
  1834. var length = array == null ? 0 : array.length;
  1835. return !!length && baseIndexOf(array, value, 0) > -1;
  1836. }
  1837. /**
  1838. * This function is like `arrayIncludes` except that it accepts a comparator.
  1839. *
  1840. * @private
  1841. * @param {Array} [array] The array to inspect.
  1842. * @param {*} target The value to search for.
  1843. * @param {Function} comparator The comparator invoked per element.
  1844. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1845. */
  1846. function arrayIncludesWith(array, value, comparator) {
  1847. var index = -1,
  1848. length = array == null ? 0 : array.length;
  1849. while (++index < length) {
  1850. if (comparator(value, array[index])) {
  1851. return true;
  1852. }
  1853. }
  1854. return false;
  1855. }
  1856. /**
  1857. * A specialized version of `_.map` for arrays without support for iteratee
  1858. * shorthands.
  1859. *
  1860. * @private
  1861. * @param {Array} [array] The array to iterate over.
  1862. * @param {Function} iteratee The function invoked per iteration.
  1863. * @returns {Array} Returns the new mapped array.
  1864. */
  1865. function arrayMap(array, iteratee) {
  1866. var index = -1,
  1867. length = array == null ? 0 : array.length,
  1868. result = Array(length);
  1869. while (++index < length) {
  1870. result[index] = iteratee(array[index], index, array);
  1871. }
  1872. return result;
  1873. }
  1874. /**
  1875. * Appends the elements of `values` to `array`.
  1876. *
  1877. * @private
  1878. * @param {Array} array The array to modify.
  1879. * @param {Array} values The values to append.
  1880. * @returns {Array} Returns `array`.
  1881. */
  1882. function arrayPush(array, values) {
  1883. var index = -1,
  1884. length = values.length,
  1885. offset = array.length;
  1886. while (++index < length) {
  1887. array[offset + index] = values[index];
  1888. }
  1889. return array;
  1890. }
  1891. /**
  1892. * A specialized version of `_.reduce` for arrays without support for
  1893. * iteratee shorthands.
  1894. *
  1895. * @private
  1896. * @param {Array} [array] The array to iterate over.
  1897. * @param {Function} iteratee The function invoked per iteration.
  1898. * @param {*} [accumulator] The initial value.
  1899. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1900. * the initial value.
  1901. * @returns {*} Returns the accumulated value.
  1902. */
  1903. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1904. var index = -1,
  1905. length = array == null ? 0 : array.length;
  1906. if (initAccum && length) {
  1907. accumulator = array[++index];
  1908. }
  1909. while (++index < length) {
  1910. accumulator = iteratee(accumulator, array[index], index, array);
  1911. }
  1912. return accumulator;
  1913. }
  1914. /**
  1915. * A specialized version of `_.reduceRight` for arrays without support for
  1916. * iteratee shorthands.
  1917. *
  1918. * @private
  1919. * @param {Array} [array] The array to iterate over.
  1920. * @param {Function} iteratee The function invoked per iteration.
  1921. * @param {*} [accumulator] The initial value.
  1922. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1923. * the initial value.
  1924. * @returns {*} Returns the accumulated value.
  1925. */
  1926. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1927. var length = array == null ? 0 : array.length;
  1928. if (initAccum && length) {
  1929. accumulator = array[--length];
  1930. }
  1931. while (length--) {
  1932. accumulator = iteratee(accumulator, array[length], length, array);
  1933. }
  1934. return accumulator;
  1935. }
  1936. /**
  1937. * A specialized version of `_.some` for arrays without support for iteratee
  1938. * shorthands.
  1939. *
  1940. * @private
  1941. * @param {Array} [array] The array to iterate over.
  1942. * @param {Function} predicate The function invoked per iteration.
  1943. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1944. * else `false`.
  1945. */
  1946. function arraySome(array, predicate) {
  1947. var index = -1,
  1948. length = array == null ? 0 : array.length;
  1949. while (++index < length) {
  1950. if (predicate(array[index], index, array)) {
  1951. return true;
  1952. }
  1953. }
  1954. return false;
  1955. }
  1956. /**
  1957. * Gets the size of an ASCII `string`.
  1958. *
  1959. * @private
  1960. * @param {string} string The string inspect.
  1961. * @returns {number} Returns the string size.
  1962. */
  1963. var asciiSize = baseProperty('length');
  1964. /**
  1965. * Converts an ASCII `string` to an array.
  1966. *
  1967. * @private
  1968. * @param {string} string The string to convert.
  1969. * @returns {Array} Returns the converted array.
  1970. */
  1971. function asciiToArray(string) {
  1972. return string.split('');
  1973. }
  1974. /**
  1975. * Splits an ASCII `string` into an array of its words.
  1976. *
  1977. * @private
  1978. * @param {string} The string to inspect.
  1979. * @returns {Array} Returns the words of `string`.
  1980. */
  1981. function asciiWords(string) {
  1982. return string.match(reAsciiWord) || [];
  1983. }
  1984. /**
  1985. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1986. * without support for iteratee shorthands, which iterates over `collection`
  1987. * using `eachFunc`.
  1988. *
  1989. * @private
  1990. * @param {Array|Object} collection The collection to inspect.
  1991. * @param {Function} predicate The function invoked per iteration.
  1992. * @param {Function} eachFunc The function to iterate over `collection`.
  1993. * @returns {*} Returns the found element or its key, else `undefined`.
  1994. */
  1995. function baseFindKey(collection, predicate, eachFunc) {
  1996. var result;
  1997. eachFunc(collection, function(value, key, collection) {
  1998. if (predicate(value, key, collection)) {
  1999. result = key;
  2000. return false;
  2001. }
  2002. });
  2003. return result;
  2004. }
  2005. /**
  2006. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2007. * support for iteratee shorthands.
  2008. *
  2009. * @private
  2010. * @param {Array} array The array to inspect.
  2011. * @param {Function} predicate The function invoked per iteration.
  2012. * @param {number} fromIndex The index to search from.
  2013. * @param {boolean} [fromRight] Specify iterating from right to left.
  2014. * @returns {number} Returns the index of the matched value, else `-1`.
  2015. */
  2016. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2017. var length = array.length,
  2018. index = fromIndex + (fromRight ? 1 : -1);
  2019. while ((fromRight ? index-- : ++index < length)) {
  2020. if (predicate(array[index], index, array)) {
  2021. return index;
  2022. }
  2023. }
  2024. return -1;
  2025. }
  2026. /**
  2027. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2028. *
  2029. * @private
  2030. * @param {Array} array The array to inspect.
  2031. * @param {*} value The value to search for.
  2032. * @param {number} fromIndex The index to search from.
  2033. * @returns {number} Returns the index of the matched value, else `-1`.
  2034. */
  2035. function baseIndexOf(array, value, fromIndex) {
  2036. return value === value
  2037. ? strictIndexOf(array, value, fromIndex)
  2038. : baseFindIndex(array, baseIsNaN, fromIndex);
  2039. }
  2040. /**
  2041. * This function is like `baseIndexOf` except that it accepts a comparator.
  2042. *
  2043. * @private
  2044. * @param {Array} array The array to inspect.
  2045. * @param {*} value The value to search for.
  2046. * @param {number} fromIndex The index to search from.
  2047. * @param {Function} comparator The comparator invoked per element.
  2048. * @returns {number} Returns the index of the matched value, else `-1`.
  2049. */
  2050. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2051. var index = fromIndex - 1,
  2052. length = array.length;
  2053. while (++index < length) {
  2054. if (comparator(array[index], value)) {
  2055. return index;
  2056. }
  2057. }
  2058. return -1;
  2059. }
  2060. /**
  2061. * The base implementation of `_.isNaN` without support for number objects.
  2062. *
  2063. * @private
  2064. * @param {*} value The value to check.
  2065. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2066. */
  2067. function baseIsNaN(value) {
  2068. return value !== value;
  2069. }
  2070. /**
  2071. * The base implementation of `_.mean` and `_.meanBy` without support for
  2072. * iteratee shorthands.
  2073. *
  2074. * @private
  2075. * @param {Array} array The array to iterate over.
  2076. * @param {Function} iteratee The function invoked per iteration.
  2077. * @returns {number} Returns the mean.
  2078. */
  2079. function baseMean(array, iteratee) {
  2080. var length = array == null ? 0 : array.length;
  2081. return length ? (baseSum(array, iteratee) / length) : NAN;
  2082. }
  2083. /**
  2084. * The base implementation of `_.property` without support for deep paths.
  2085. *
  2086. * @private
  2087. * @param {string} key The key of the property to get.
  2088. * @returns {Function} Returns the new accessor function.
  2089. */
  2090. function baseProperty(key) {
  2091. return function(object) {
  2092. return object == null ? undefined : object[key];
  2093. };
  2094. }
  2095. /**
  2096. * The base implementation of `_.propertyOf` without support for deep paths.
  2097. *
  2098. * @private
  2099. * @param {Object} object The object to query.
  2100. * @returns {Function} Returns the new accessor function.
  2101. */
  2102. function basePropertyOf(object) {
  2103. return function(key) {
  2104. return object == null ? undefined : object[key];
  2105. };
  2106. }
  2107. /**
  2108. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2109. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2110. *
  2111. * @private
  2112. * @param {Array|Object} collection The collection to iterate over.
  2113. * @param {Function} iteratee The function invoked per iteration.
  2114. * @param {*} accumulator The initial value.
  2115. * @param {boolean} initAccum Specify using the first or last element of
  2116. * `collection` as the initial value.
  2117. * @param {Function} eachFunc The function to iterate over `collection`.
  2118. * @returns {*} Returns the accumulated value.
  2119. */
  2120. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2121. eachFunc(collection, function(value, index, collection) {
  2122. accumulator = initAccum
  2123. ? (initAccum = false, value)
  2124. : iteratee(accumulator, value, index, collection);
  2125. });
  2126. return accumulator;
  2127. }
  2128. /**
  2129. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2130. * sort order of `array` and replaces criteria objects with their corresponding
  2131. * values.
  2132. *
  2133. * @private
  2134. * @param {Array} array The array to sort.
  2135. * @param {Function} comparer The function to define sort order.
  2136. * @returns {Array} Returns `array`.
  2137. */
  2138. function baseSortBy(array, comparer) {
  2139. var length = array.length;
  2140. array.sort(comparer);
  2141. while (length--) {
  2142. array[length] = array[length].value;
  2143. }
  2144. return array;
  2145. }
  2146. /**
  2147. * The base implementation of `_.sum` and `_.sumBy` without support for
  2148. * iteratee shorthands.
  2149. *
  2150. * @private
  2151. * @param {Array} array The array to iterate over.
  2152. * @param {Function} iteratee The function invoked per iteration.
  2153. * @returns {number} Returns the sum.
  2154. */
  2155. function baseSum(array, iteratee) {
  2156. var result,
  2157. index = -1,
  2158. length = array.length;
  2159. while (++index < length) {
  2160. var current = iteratee(array[index]);
  2161. if (current !== undefined) {
  2162. result = result === undefined ? current : (result + current);
  2163. }
  2164. }
  2165. return result;
  2166. }
  2167. /**
  2168. * The base implementation of `_.times` without support for iteratee shorthands
  2169. * or max array length checks.
  2170. *
  2171. * @private
  2172. * @param {number} n The number of times to invoke `iteratee`.
  2173. * @param {Function} iteratee The function invoked per iteration.
  2174. * @returns {Array} Returns the array of results.
  2175. */
  2176. function baseTimes(n, iteratee) {
  2177. var index = -1,
  2178. result = Array(n);
  2179. while (++index < n) {
  2180. result[index] = iteratee(index);
  2181. }
  2182. return result;
  2183. }
  2184. /**
  2185. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2186. * of key-value pairs for `object` corresponding to the property names of `props`.
  2187. *
  2188. * @private
  2189. * @param {Object} object The object to query.
  2190. * @param {Array} props The property names to get values for.
  2191. * @returns {Object} Returns the key-value pairs.
  2192. */
  2193. function baseToPairs(object, props) {
  2194. return arrayMap(props, function(key) {
  2195. return [key, object[key]];
  2196. });
  2197. }
  2198. /**
  2199. * The base implementation of `_.trim`.
  2200. *
  2201. * @private
  2202. * @param {string} string The string to trim.
  2203. * @returns {string} Returns the trimmed string.
  2204. */
  2205. function baseTrim(string) {
  2206. return string
  2207. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2208. : string;
  2209. }
  2210. /**
  2211. * The base implementation of `_.unary` without support for storing metadata.
  2212. *
  2213. * @private
  2214. * @param {Function} func The function to cap arguments for.
  2215. * @returns {Function} Returns the new capped function.
  2216. */
  2217. function baseUnary(func) {
  2218. return function(value) {
  2219. return func(value);
  2220. };
  2221. }
  2222. /**
  2223. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2224. * array of `object` property values corresponding to the property names
  2225. * of `props`.
  2226. *
  2227. * @private
  2228. * @param {Object} object The object to query.
  2229. * @param {Array} props The property names to get values for.
  2230. * @returns {Object} Returns the array of property values.
  2231. */
  2232. function baseValues(object, props) {
  2233. return arrayMap(props, function(key) {
  2234. return object[key];
  2235. });
  2236. }
  2237. /**
  2238. * Checks if a `cache` value for `key` exists.
  2239. *
  2240. * @private
  2241. * @param {Object} cache The cache to query.
  2242. * @param {string} key The key of the entry to check.
  2243. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2244. */
  2245. function cacheHas(cache, key) {
  2246. return cache.has(key);
  2247. }
  2248. /**
  2249. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2250. * that is not found in the character symbols.
  2251. *
  2252. * @private
  2253. * @param {Array} strSymbols The string symbols to inspect.
  2254. * @param {Array} chrSymbols The character symbols to find.
  2255. * @returns {number} Returns the index of the first unmatched string symbol.
  2256. */
  2257. function charsStartIndex(strSymbols, chrSymbols) {
  2258. var index = -1,
  2259. length = strSymbols.length;
  2260. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2261. return index;
  2262. }
  2263. /**
  2264. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2265. * that is not found in the character symbols.
  2266. *
  2267. * @private
  2268. * @param {Array} strSymbols The string symbols to inspect.
  2269. * @param {Array} chrSymbols The character symbols to find.
  2270. * @returns {number} Returns the index of the last unmatched string symbol.
  2271. */
  2272. function charsEndIndex(strSymbols, chrSymbols) {
  2273. var index = strSymbols.length;
  2274. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2275. return index;
  2276. }
  2277. /**
  2278. * Gets the number of `placeholder` occurrences in `array`.
  2279. *
  2280. * @private
  2281. * @param {Array} array The array to inspect.
  2282. * @param {*} placeholder The placeholder to search for.
  2283. * @returns {number} Returns the placeholder count.
  2284. */
  2285. function countHolders(array, placeholder) {
  2286. var length = array.length,
  2287. result = 0;
  2288. while (length--) {
  2289. if (array[length] === placeholder) {
  2290. ++result;
  2291. }
  2292. }
  2293. return result;
  2294. }
  2295. /**
  2296. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2297. * letters to basic Latin letters.
  2298. *
  2299. * @private
  2300. * @param {string} letter The matched letter to deburr.
  2301. * @returns {string} Returns the deburred letter.
  2302. */
  2303. var deburrLetter = basePropertyOf(deburredLetters);
  2304. /**
  2305. * Used by `_.escape` to convert characters to HTML entities.
  2306. *
  2307. * @private
  2308. * @param {string} chr The matched character to escape.
  2309. * @returns {string} Returns the escaped character.
  2310. */
  2311. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2312. /**
  2313. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2314. *
  2315. * @private
  2316. * @param {string} chr The matched character to escape.
  2317. * @returns {string} Returns the escaped character.
  2318. */
  2319. function escapeStringChar(chr) {
  2320. return '\\' + stringEscapes[chr];
  2321. }
  2322. /**
  2323. * Gets the value at `key` of `object`.
  2324. *
  2325. * @private
  2326. * @param {Object} [object] The object to query.
  2327. * @param {string} key The key of the property to get.
  2328. * @returns {*} Returns the property value.
  2329. */
  2330. function getValue(object, key) {
  2331. return object == null ? undefined : object[key];
  2332. }
  2333. /**
  2334. * Checks if `string` contains Unicode symbols.
  2335. *
  2336. * @private
  2337. * @param {string} string The string to inspect.
  2338. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2339. */
  2340. function hasUnicode(string) {
  2341. return reHasUnicode.test(string);
  2342. }
  2343. /**
  2344. * Checks if `string` contains a word composed of Unicode symbols.
  2345. *
  2346. * @private
  2347. * @param {string} string The string to inspect.
  2348. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2349. */
  2350. function hasUnicodeWord(string) {
  2351. return reHasUnicodeWord.test(string);
  2352. }
  2353. /**
  2354. * Converts `iterator` to an array.
  2355. *
  2356. * @private
  2357. * @param {Object} iterator The iterator to convert.
  2358. * @returns {Array} Returns the converted array.
  2359. */
  2360. function iteratorToArray(iterator) {
  2361. var data,
  2362. result = [];
  2363. while (!(data = iterator.next()).done) {
  2364. result.push(data.value);
  2365. }
  2366. return result;
  2367. }
  2368. /**
  2369. * Converts `map` to its key-value pairs.
  2370. *
  2371. * @private
  2372. * @param {Object} map The map to convert.
  2373. * @returns {Array} Returns the key-value pairs.
  2374. */
  2375. function mapToArray(map) {
  2376. var index = -1,
  2377. result = Array(map.size);
  2378. map.forEach(function(value, key) {
  2379. result[++index] = [key, value];
  2380. });
  2381. return result;
  2382. }
  2383. /**
  2384. * Creates a unary function that invokes `func` with its argument transformed.
  2385. *
  2386. * @private
  2387. * @param {Function} func The function to wrap.
  2388. * @param {Function} transform The argument transform.
  2389. * @returns {Function} Returns the new function.
  2390. */
  2391. function overArg(func, transform) {
  2392. return function(arg) {
  2393. return func(transform(arg));
  2394. };
  2395. }
  2396. /**
  2397. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2398. * and returns an array of their indexes.
  2399. *
  2400. * @private
  2401. * @param {Array} array The array to modify.
  2402. * @param {*} placeholder The placeholder to replace.
  2403. * @returns {Array} Returns the new array of placeholder indexes.
  2404. */
  2405. function replaceHolders(array, placeholder) {
  2406. var index = -1,
  2407. length = array.length,
  2408. resIndex = 0,
  2409. result = [];
  2410. while (++index < length) {
  2411. var value = array[index];
  2412. if (value === placeholder || value === PLACEHOLDER) {
  2413. array[index] = PLACEHOLDER;
  2414. result[resIndex++] = index;
  2415. }
  2416. }
  2417. return result;
  2418. }
  2419. /**
  2420. * Converts `set` to an array of its values.
  2421. *
  2422. * @private
  2423. * @param {Object} set The set to convert.
  2424. * @returns {Array} Returns the values.
  2425. */
  2426. function setToArray(set) {
  2427. var index = -1,
  2428. result = Array(set.size);
  2429. set.forEach(function(value) {
  2430. result[++index] = value;
  2431. });
  2432. return result;
  2433. }
  2434. /**
  2435. * Converts `set` to its value-value pairs.
  2436. *
  2437. * @private
  2438. * @param {Object} set The set to convert.
  2439. * @returns {Array} Returns the value-value pairs.
  2440. */
  2441. function setToPairs(set) {
  2442. var index = -1,
  2443. result = Array(set.size);
  2444. set.forEach(function(value) {
  2445. result[++index] = [value, value];
  2446. });
  2447. return result;
  2448. }
  2449. /**
  2450. * A specialized version of `_.indexOf` which performs strict equality
  2451. * comparisons of values, i.e. `===`.
  2452. *
  2453. * @private
  2454. * @param {Array} array The array to inspect.
  2455. * @param {*} value The value to search for.
  2456. * @param {number} fromIndex The index to search from.
  2457. * @returns {number} Returns the index of the matched value, else `-1`.
  2458. */
  2459. function strictIndexOf(array, value, fromIndex) {
  2460. var index = fromIndex - 1,
  2461. length = array.length;
  2462. while (++index < length) {
  2463. if (array[index] === value) {
  2464. return index;
  2465. }
  2466. }
  2467. return -1;
  2468. }
  2469. /**
  2470. * A specialized version of `_.lastIndexOf` which performs strict equality
  2471. * comparisons of values, i.e. `===`.
  2472. *
  2473. * @private
  2474. * @param {Array} array The array to inspect.
  2475. * @param {*} value The value to search for.
  2476. * @param {number} fromIndex The index to search from.
  2477. * @returns {number} Returns the index of the matched value, else `-1`.
  2478. */
  2479. function strictLastIndexOf(array, value, fromIndex) {
  2480. var index = fromIndex + 1;
  2481. while (index--) {
  2482. if (array[index] === value) {
  2483. return index;
  2484. }
  2485. }
  2486. return index;
  2487. }
  2488. /**
  2489. * Gets the number of symbols in `string`.
  2490. *
  2491. * @private
  2492. * @param {string} string The string to inspect.
  2493. * @returns {number} Returns the string size.
  2494. */
  2495. function stringSize(string) {
  2496. return hasUnicode(string)
  2497. ? unicodeSize(string)
  2498. : asciiSize(string);
  2499. }
  2500. /**
  2501. * Converts `string` to an array.
  2502. *
  2503. * @private
  2504. * @param {string} string The string to convert.
  2505. * @returns {Array} Returns the converted array.
  2506. */
  2507. function stringToArray(string) {
  2508. return hasUnicode(string)
  2509. ? unicodeToArray(string)
  2510. : asciiToArray(string);
  2511. }
  2512. /**
  2513. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2514. * character of `string`.
  2515. *
  2516. * @private
  2517. * @param {string} string The string to inspect.
  2518. * @returns {number} Returns the index of the last non-whitespace character.
  2519. */
  2520. function trimmedEndIndex(string) {
  2521. var index = string.length;
  2522. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2523. return index;
  2524. }
  2525. /**
  2526. * Used by `_.unescape` to convert HTML entities to characters.
  2527. *
  2528. * @private
  2529. * @param {string} chr The matched character to unescape.
  2530. * @returns {string} Returns the unescaped character.
  2531. */
  2532. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2533. /**
  2534. * Gets the size of a Unicode `string`.
  2535. *
  2536. * @private
  2537. * @param {string} string The string inspect.
  2538. * @returns {number} Returns the string size.
  2539. */
  2540. function unicodeSize(string) {
  2541. var result = reUnicode.lastIndex = 0;
  2542. while (reUnicode.test(string)) {
  2543. ++result;
  2544. }
  2545. return result;
  2546. }
  2547. /**
  2548. * Converts a Unicode `string` to an array.
  2549. *
  2550. * @private
  2551. * @param {string} string The string to convert.
  2552. * @returns {Array} Returns the converted array.
  2553. */
  2554. function unicodeToArray(string) {
  2555. return string.match(reUnicode) || [];
  2556. }
  2557. /**
  2558. * Splits a Unicode `string` into an array of its words.
  2559. *
  2560. * @private
  2561. * @param {string} The string to inspect.
  2562. * @returns {Array} Returns the words of `string`.
  2563. */
  2564. function unicodeWords(string) {
  2565. return string.match(reUnicodeWord) || [];
  2566. }
  2567. /*--------------------------------------------------------------------------*/
  2568. /**
  2569. * Create a new pristine `lodash` function using the `context` object.
  2570. *
  2571. * @static
  2572. * @memberOf _
  2573. * @since 1.1.0
  2574. * @category Util
  2575. * @param {Object} [context=root] The context object.
  2576. * @returns {Function} Returns a new `lodash` function.
  2577. * @example
  2578. *
  2579. * _.mixin({ 'foo': _.constant('foo') });
  2580. *
  2581. * var lodash = _.runInContext();
  2582. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2583. *
  2584. * _.isFunction(_.foo);
  2585. * // => true
  2586. * _.isFunction(_.bar);
  2587. * // => false
  2588. *
  2589. * lodash.isFunction(lodash.foo);
  2590. * // => false
  2591. * lodash.isFunction(lodash.bar);
  2592. * // => true
  2593. *
  2594. * // Create a suped-up `defer` in Node.js.
  2595. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2596. */
  2597. var runInContext = (function runInContext(context) {
  2598. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2599. /** Built-in constructor references. */
  2600. var Array = context.Array,
  2601. Date = context.Date,
  2602. Error = context.Error,
  2603. Function = context.Function,
  2604. Math = context.Math,
  2605. Object = context.Object,
  2606. RegExp = context.RegExp,
  2607. String = context.String,
  2608. TypeError = context.TypeError;
  2609. /** Used for built-in method references. */
  2610. var arrayProto = Array.prototype,
  2611. funcProto = Function.prototype,
  2612. objectProto = Object.prototype;
  2613. /** Used to detect overreaching core-js shims. */
  2614. var coreJsData = context['__core-js_shared__'];
  2615. /** Used to resolve the decompiled source of functions. */
  2616. var funcToString = funcProto.toString;
  2617. /** Used to check objects for own properties. */
  2618. var hasOwnProperty = objectProto.hasOwnProperty;
  2619. /** Used to generate unique IDs. */
  2620. var idCounter = 0;
  2621. /** Used to detect methods masquerading as native. */
  2622. var maskSrcKey = (function() {
  2623. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2624. return uid ? ('Symbol(src)_1.' + uid) : '';
  2625. }());
  2626. /**
  2627. * Used to resolve the
  2628. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2629. * of values.
  2630. */
  2631. var nativeObjectToString = objectProto.toString;
  2632. /** Used to infer the `Object` constructor. */
  2633. var objectCtorString = funcToString.call(Object);
  2634. /** Used to restore the original `_` reference in `_.noConflict`. */
  2635. var oldDash = root._;
  2636. /** Used to detect if a method is native. */
  2637. var reIsNative = RegExp('^' +
  2638. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2639. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2640. );
  2641. /** Built-in value references. */
  2642. var Buffer = moduleExports ? context.Buffer : undefined,
  2643. Symbol = context.Symbol,
  2644. Uint8Array = context.Uint8Array,
  2645. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2646. getPrototype = overArg(Object.getPrototypeOf, Object),
  2647. objectCreate = Object.create,
  2648. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2649. splice = arrayProto.splice,
  2650. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2651. symIterator = Symbol ? Symbol.iterator : undefined,
  2652. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2653. var defineProperty = (function() {
  2654. try {
  2655. var func = getNative(Object, 'defineProperty');
  2656. func({}, '', {});
  2657. return func;
  2658. } catch (e) {}
  2659. }());
  2660. /** Mocked built-ins. */
  2661. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2662. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2663. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2664. /* Built-in method references for those with the same name as other `lodash` methods. */
  2665. var nativeCeil = Math.ceil,
  2666. nativeFloor = Math.floor,
  2667. nativeGetSymbols = Object.getOwnPropertySymbols,
  2668. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2669. nativeIsFinite = context.isFinite,
  2670. nativeJoin = arrayProto.join,
  2671. nativeKeys = overArg(Object.keys, Object),
  2672. nativeMax = Math.max,
  2673. nativeMin = Math.min,
  2674. nativeNow = Date.now,
  2675. nativeParseInt = context.parseInt,
  2676. nativeRandom = Math.random,
  2677. nativeReverse = arrayProto.reverse;
  2678. /* Built-in method references that are verified to be native. */
  2679. var DataView = getNative(context, 'DataView'),
  2680. Map = getNative(context, 'Map'),
  2681. Promise = getNative(context, 'Promise'),
  2682. Set = getNative(context, 'Set'),
  2683. WeakMap = getNative(context, 'WeakMap'),
  2684. nativeCreate = getNative(Object, 'create');
  2685. /** Used to store function metadata. */
  2686. var metaMap = WeakMap && new WeakMap;
  2687. /** Used to lookup unminified function names. */
  2688. var realNames = {};
  2689. /** Used to detect maps, sets, and weakmaps. */
  2690. var dataViewCtorString = toSource(DataView),
  2691. mapCtorString = toSource(Map),
  2692. promiseCtorString = toSource(Promise),
  2693. setCtorString = toSource(Set),
  2694. weakMapCtorString = toSource(WeakMap);
  2695. /** Used to convert symbols to primitives and strings. */
  2696. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2697. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2698. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2699. /*------------------------------------------------------------------------*/
  2700. /**
  2701. * Creates a `lodash` object which wraps `value` to enable implicit method
  2702. * chain sequences. Methods that operate on and return arrays, collections,
  2703. * and functions can be chained together. Methods that retrieve a single value
  2704. * or may return a primitive value will automatically end the chain sequence
  2705. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2706. * with `_#value`.
  2707. *
  2708. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2709. * enabled using `_.chain`.
  2710. *
  2711. * The execution of chained methods is lazy, that is, it's deferred until
  2712. * `_#value` is implicitly or explicitly called.
  2713. *
  2714. * Lazy evaluation allows several methods to support shortcut fusion.
  2715. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2716. * the creation of intermediate arrays and can greatly reduce the number of
  2717. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2718. * fusion if the section is applied to an array and iteratees accept only
  2719. * one argument. The heuristic for whether a section qualifies for shortcut
  2720. * fusion is subject to change.
  2721. *
  2722. * Chaining is supported in custom builds as long as the `_#value` method is
  2723. * directly or indirectly included in the build.
  2724. *
  2725. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2726. *
  2727. * The wrapper `Array` methods are:
  2728. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2729. *
  2730. * The wrapper `String` methods are:
  2731. * `replace` and `split`
  2732. *
  2733. * The wrapper methods that support shortcut fusion are:
  2734. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2735. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2736. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2737. *
  2738. * The chainable wrapper methods are:
  2739. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2740. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2741. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2742. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2743. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2744. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2745. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2746. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2747. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2748. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2749. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2750. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2751. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2752. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2753. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2754. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2755. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2756. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2757. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2758. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2759. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2760. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2761. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2762. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2763. *
  2764. * The wrapper methods that are **not** chainable by default are:
  2765. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2766. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2767. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2768. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2769. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2770. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2771. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2772. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2773. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2774. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2775. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2776. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2777. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2778. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2779. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2780. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2781. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2782. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2783. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2784. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2785. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2786. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2787. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2788. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2789. * `upperFirst`, `value`, and `words`
  2790. *
  2791. * @name _
  2792. * @constructor
  2793. * @category Seq
  2794. * @param {*} value The value to wrap in a `lodash` instance.
  2795. * @returns {Object} Returns the new `lodash` wrapper instance.
  2796. * @example
  2797. *
  2798. * function square(n) {
  2799. * return n * n;
  2800. * }
  2801. *
  2802. * var wrapped = _([1, 2, 3]);
  2803. *
  2804. * // Returns an unwrapped value.
  2805. * wrapped.reduce(_.add);
  2806. * // => 6
  2807. *
  2808. * // Returns a wrapped value.
  2809. * var squares = wrapped.map(square);
  2810. *
  2811. * _.isArray(squares);
  2812. * // => false
  2813. *
  2814. * _.isArray(squares.value());
  2815. * // => true
  2816. */
  2817. function lodash(value) {
  2818. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2819. if (value instanceof LodashWrapper) {
  2820. return value;
  2821. }
  2822. if (hasOwnProperty.call(value, '__wrapped__')) {
  2823. return wrapperClone(value);
  2824. }
  2825. }
  2826. return new LodashWrapper(value);
  2827. }
  2828. /**
  2829. * The base implementation of `_.create` without support for assigning
  2830. * properties to the created object.
  2831. *
  2832. * @private
  2833. * @param {Object} proto The object to inherit from.
  2834. * @returns {Object} Returns the new object.
  2835. */
  2836. var baseCreate = (function() {
  2837. function object() {}
  2838. return function(proto) {
  2839. if (!isObject(proto)) {
  2840. return {};
  2841. }
  2842. if (objectCreate) {
  2843. return objectCreate(proto);
  2844. }
  2845. object.prototype = proto;
  2846. var result = new object;
  2847. object.prototype = undefined;
  2848. return result;
  2849. };
  2850. }());
  2851. /**
  2852. * The function whose prototype chain sequence wrappers inherit from.
  2853. *
  2854. * @private
  2855. */
  2856. function baseLodash() {
  2857. // No operation performed.
  2858. }
  2859. /**
  2860. * The base constructor for creating `lodash` wrapper objects.
  2861. *
  2862. * @private
  2863. * @param {*} value The value to wrap.
  2864. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2865. */
  2866. function LodashWrapper(value, chainAll) {
  2867. this.__wrapped__ = value;
  2868. this.__actions__ = [];
  2869. this.__chain__ = !!chainAll;
  2870. this.__index__ = 0;
  2871. this.__values__ = undefined;
  2872. }
  2873. /**
  2874. * By default, the template delimiters used by lodash are like those in
  2875. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2876. * following template settings to use alternative delimiters.
  2877. *
  2878. * @static
  2879. * @memberOf _
  2880. * @type {Object}
  2881. */
  2882. lodash.templateSettings = {
  2883. /**
  2884. * Used to detect `data` property values to be HTML-escaped.
  2885. *
  2886. * @memberOf _.templateSettings
  2887. * @type {RegExp}
  2888. */
  2889. 'escape': reEscape,
  2890. /**
  2891. * Used to detect code to be evaluated.
  2892. *
  2893. * @memberOf _.templateSettings
  2894. * @type {RegExp}
  2895. */
  2896. 'evaluate': reEvaluate,
  2897. /**
  2898. * Used to detect `data` property values to inject.
  2899. *
  2900. * @memberOf _.templateSettings
  2901. * @type {RegExp}
  2902. */
  2903. 'interpolate': reInterpolate,
  2904. /**
  2905. * Used to reference the data object in the template text.
  2906. *
  2907. * @memberOf _.templateSettings
  2908. * @type {string}
  2909. */
  2910. 'variable': '',
  2911. /**
  2912. * Used to import variables into the compiled template.
  2913. *
  2914. * @memberOf _.templateSettings
  2915. * @type {Object}
  2916. */
  2917. 'imports': {
  2918. /**
  2919. * A reference to the `lodash` function.
  2920. *
  2921. * @memberOf _.templateSettings.imports
  2922. * @type {Function}
  2923. */
  2924. '_': lodash
  2925. }
  2926. };
  2927. // Ensure wrappers are instances of `baseLodash`.
  2928. lodash.prototype = baseLodash.prototype;
  2929. lodash.prototype.constructor = lodash;
  2930. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2931. LodashWrapper.prototype.constructor = LodashWrapper;
  2932. /*------------------------------------------------------------------------*/
  2933. /**
  2934. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2935. *
  2936. * @private
  2937. * @constructor
  2938. * @param {*} value The value to wrap.
  2939. */
  2940. function LazyWrapper(value) {
  2941. this.__wrapped__ = value;
  2942. this.__actions__ = [];
  2943. this.__dir__ = 1;
  2944. this.__filtered__ = false;
  2945. this.__iteratees__ = [];
  2946. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2947. this.__views__ = [];
  2948. }
  2949. /**
  2950. * Creates a clone of the lazy wrapper object.
  2951. *
  2952. * @private
  2953. * @name clone
  2954. * @memberOf LazyWrapper
  2955. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2956. */
  2957. function lazyClone() {
  2958. var result = new LazyWrapper(this.__wrapped__);
  2959. result.__actions__ = copyArray(this.__actions__);
  2960. result.__dir__ = this.__dir__;
  2961. result.__filtered__ = this.__filtered__;
  2962. result.__iteratees__ = copyArray(this.__iteratees__);
  2963. result.__takeCount__ = this.__takeCount__;
  2964. result.__views__ = copyArray(this.__views__);
  2965. return result;
  2966. }
  2967. /**
  2968. * Reverses the direction of lazy iteration.
  2969. *
  2970. * @private
  2971. * @name reverse
  2972. * @memberOf LazyWrapper
  2973. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2974. */
  2975. function lazyReverse() {
  2976. if (this.__filtered__) {
  2977. var result = new LazyWrapper(this);
  2978. result.__dir__ = -1;
  2979. result.__filtered__ = true;
  2980. } else {
  2981. result = this.clone();
  2982. result.__dir__ *= -1;
  2983. }
  2984. return result;
  2985. }
  2986. /**
  2987. * Extracts the unwrapped value from its lazy wrapper.
  2988. *
  2989. * @private
  2990. * @name value
  2991. * @memberOf LazyWrapper
  2992. * @returns {*} Returns the unwrapped value.
  2993. */
  2994. function lazyValue() {
  2995. var array = this.__wrapped__.value(),
  2996. dir = this.__dir__,
  2997. isArr = isArray(array),
  2998. isRight = dir < 0,
  2999. arrLength = isArr ? array.length : 0,
  3000. view = getView(0, arrLength, this.__views__),
  3001. start = view.start,
  3002. end = view.end,
  3003. length = end - start,
  3004. index = isRight ? end : (start - 1),
  3005. iteratees = this.__iteratees__,
  3006. iterLength = iteratees.length,
  3007. resIndex = 0,
  3008. takeCount = nativeMin(length, this.__takeCount__);
  3009. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3010. return baseWrapperValue(array, this.__actions__);
  3011. }
  3012. var result = [];
  3013. outer:
  3014. while (length-- && resIndex < takeCount) {
  3015. index += dir;
  3016. var iterIndex = -1,
  3017. value = array[index];
  3018. while (++iterIndex < iterLength) {
  3019. var data = iteratees[iterIndex],
  3020. iteratee = data.iteratee,
  3021. type = data.type,
  3022. computed = iteratee(value);
  3023. if (type == LAZY_MAP_FLAG) {
  3024. value = computed;
  3025. } else if (!computed) {
  3026. if (type == LAZY_FILTER_FLAG) {
  3027. continue outer;
  3028. } else {
  3029. break outer;
  3030. }
  3031. }
  3032. }
  3033. result[resIndex++] = value;
  3034. }
  3035. return result;
  3036. }
  3037. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3038. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3039. LazyWrapper.prototype.constructor = LazyWrapper;
  3040. /*------------------------------------------------------------------------*/
  3041. /**
  3042. * Creates a hash object.
  3043. *
  3044. * @private
  3045. * @constructor
  3046. * @param {Array} [entries] The key-value pairs to cache.
  3047. */
  3048. function Hash(entries) {
  3049. var index = -1,
  3050. length = entries == null ? 0 : entries.length;
  3051. this.clear();
  3052. while (++index < length) {
  3053. var entry = entries[index];
  3054. this.set(entry[0], entry[1]);
  3055. }
  3056. }
  3057. /**
  3058. * Removes all key-value entries from the hash.
  3059. *
  3060. * @private
  3061. * @name clear
  3062. * @memberOf Hash
  3063. */
  3064. function hashClear() {
  3065. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3066. this.size = 0;
  3067. }
  3068. /**
  3069. * Removes `key` and its value from the hash.
  3070. *
  3071. * @private
  3072. * @name delete
  3073. * @memberOf Hash
  3074. * @param {Object} hash The hash to modify.
  3075. * @param {string} key The key of the value to remove.
  3076. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3077. */
  3078. function hashDelete(key) {
  3079. var result = this.has(key) && delete this.__data__[key];
  3080. this.size -= result ? 1 : 0;
  3081. return result;
  3082. }
  3083. /**
  3084. * Gets the hash value for `key`.
  3085. *
  3086. * @private
  3087. * @name get
  3088. * @memberOf Hash
  3089. * @param {string} key The key of the value to get.
  3090. * @returns {*} Returns the entry value.
  3091. */
  3092. function hashGet(key) {
  3093. var data = this.__data__;
  3094. if (nativeCreate) {
  3095. var result = data[key];
  3096. return result === HASH_UNDEFINED ? undefined : result;
  3097. }
  3098. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3099. }
  3100. /**
  3101. * Checks if a hash value for `key` exists.
  3102. *
  3103. * @private
  3104. * @name has
  3105. * @memberOf Hash
  3106. * @param {string} key The key of the entry to check.
  3107. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3108. */
  3109. function hashHas(key) {
  3110. var data = this.__data__;
  3111. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3112. }
  3113. /**
  3114. * Sets the hash `key` to `value`.
  3115. *
  3116. * @private
  3117. * @name set
  3118. * @memberOf Hash
  3119. * @param {string} key The key of the value to set.
  3120. * @param {*} value The value to set.
  3121. * @returns {Object} Returns the hash instance.
  3122. */
  3123. function hashSet(key, value) {
  3124. var data = this.__data__;
  3125. this.size += this.has(key) ? 0 : 1;
  3126. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3127. return this;
  3128. }
  3129. // Add methods to `Hash`.
  3130. Hash.prototype.clear = hashClear;
  3131. Hash.prototype['delete'] = hashDelete;
  3132. Hash.prototype.get = hashGet;
  3133. Hash.prototype.has = hashHas;
  3134. Hash.prototype.set = hashSet;
  3135. /*------------------------------------------------------------------------*/
  3136. /**
  3137. * Creates an list cache object.
  3138. *
  3139. * @private
  3140. * @constructor
  3141. * @param {Array} [entries] The key-value pairs to cache.
  3142. */
  3143. function ListCache(entries) {
  3144. var index = -1,
  3145. length = entries == null ? 0 : entries.length;
  3146. this.clear();
  3147. while (++index < length) {
  3148. var entry = entries[index];
  3149. this.set(entry[0], entry[1]);
  3150. }
  3151. }
  3152. /**
  3153. * Removes all key-value entries from the list cache.
  3154. *
  3155. * @private
  3156. * @name clear
  3157. * @memberOf ListCache
  3158. */
  3159. function listCacheClear() {
  3160. this.__data__ = [];
  3161. this.size = 0;
  3162. }
  3163. /**
  3164. * Removes `key` and its value from the list cache.
  3165. *
  3166. * @private
  3167. * @name delete
  3168. * @memberOf ListCache
  3169. * @param {string} key The key of the value to remove.
  3170. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3171. */
  3172. function listCacheDelete(key) {
  3173. var data = this.__data__,
  3174. index = assocIndexOf(data, key);
  3175. if (index < 0) {
  3176. return false;
  3177. }
  3178. var lastIndex = data.length - 1;
  3179. if (index == lastIndex) {
  3180. data.pop();
  3181. } else {
  3182. splice.call(data, index, 1);
  3183. }
  3184. --this.size;
  3185. return true;
  3186. }
  3187. /**
  3188. * Gets the list cache value for `key`.
  3189. *
  3190. * @private
  3191. * @name get
  3192. * @memberOf ListCache
  3193. * @param {string} key The key of the value to get.
  3194. * @returns {*} Returns the entry value.
  3195. */
  3196. function listCacheGet(key) {
  3197. var data = this.__data__,
  3198. index = assocIndexOf(data, key);
  3199. return index < 0 ? undefined : data[index][1];
  3200. }
  3201. /**
  3202. * Checks if a list cache value for `key` exists.
  3203. *
  3204. * @private
  3205. * @name has
  3206. * @memberOf ListCache
  3207. * @param {string} key The key of the entry to check.
  3208. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3209. */
  3210. function listCacheHas(key) {
  3211. return assocIndexOf(this.__data__, key) > -1;
  3212. }
  3213. /**
  3214. * Sets the list cache `key` to `value`.
  3215. *
  3216. * @private
  3217. * @name set
  3218. * @memberOf ListCache
  3219. * @param {string} key The key of the value to set.
  3220. * @param {*} value The value to set.
  3221. * @returns {Object} Returns the list cache instance.
  3222. */
  3223. function listCacheSet(key, value) {
  3224. var data = this.__data__,
  3225. index = assocIndexOf(data, key);
  3226. if (index < 0) {
  3227. ++this.size;
  3228. data.push([key, value]);
  3229. } else {
  3230. data[index][1] = value;
  3231. }
  3232. return this;
  3233. }
  3234. // Add methods to `ListCache`.
  3235. ListCache.prototype.clear = listCacheClear;
  3236. ListCache.prototype['delete'] = listCacheDelete;
  3237. ListCache.prototype.get = listCacheGet;
  3238. ListCache.prototype.has = listCacheHas;
  3239. ListCache.prototype.set = listCacheSet;
  3240. /*------------------------------------------------------------------------*/
  3241. /**
  3242. * Creates a map cache object to store key-value pairs.
  3243. *
  3244. * @private
  3245. * @constructor
  3246. * @param {Array} [entries] The key-value pairs to cache.
  3247. */
  3248. function MapCache(entries) {
  3249. var index = -1,
  3250. length = entries == null ? 0 : entries.length;
  3251. this.clear();
  3252. while (++index < length) {
  3253. var entry = entries[index];
  3254. this.set(entry[0], entry[1]);
  3255. }
  3256. }
  3257. /**
  3258. * Removes all key-value entries from the map.
  3259. *
  3260. * @private
  3261. * @name clear
  3262. * @memberOf MapCache
  3263. */
  3264. function mapCacheClear() {
  3265. this.size = 0;
  3266. this.__data__ = {
  3267. 'hash': new Hash,
  3268. 'map': new (Map || ListCache),
  3269. 'string': new Hash
  3270. };
  3271. }
  3272. /**
  3273. * Removes `key` and its value from the map.
  3274. *
  3275. * @private
  3276. * @name delete
  3277. * @memberOf MapCache
  3278. * @param {string} key The key of the value to remove.
  3279. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3280. */
  3281. function mapCacheDelete(key) {
  3282. var result = getMapData(this, key)['delete'](key);
  3283. this.size -= result ? 1 : 0;
  3284. return result;
  3285. }
  3286. /**
  3287. * Gets the map value for `key`.
  3288. *
  3289. * @private
  3290. * @name get
  3291. * @memberOf MapCache
  3292. * @param {string} key The key of the value to get.
  3293. * @returns {*} Returns the entry value.
  3294. */
  3295. function mapCacheGet(key) {
  3296. return getMapData(this, key).get(key);
  3297. }
  3298. /**
  3299. * Checks if a map value for `key` exists.
  3300. *
  3301. * @private
  3302. * @name has
  3303. * @memberOf MapCache
  3304. * @param {string} key The key of the entry to check.
  3305. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3306. */
  3307. function mapCacheHas(key) {
  3308. return getMapData(this, key).has(key);
  3309. }
  3310. /**
  3311. * Sets the map `key` to `value`.
  3312. *
  3313. * @private
  3314. * @name set
  3315. * @memberOf MapCache
  3316. * @param {string} key The key of the value to set.
  3317. * @param {*} value The value to set.
  3318. * @returns {Object} Returns the map cache instance.
  3319. */
  3320. function mapCacheSet(key, value) {
  3321. var data = getMapData(this, key),
  3322. size = data.size;
  3323. data.set(key, value);
  3324. this.size += data.size == size ? 0 : 1;
  3325. return this;
  3326. }
  3327. // Add methods to `MapCache`.
  3328. MapCache.prototype.clear = mapCacheClear;
  3329. MapCache.prototype['delete'] = mapCacheDelete;
  3330. MapCache.prototype.get = mapCacheGet;
  3331. MapCache.prototype.has = mapCacheHas;
  3332. MapCache.prototype.set = mapCacheSet;
  3333. /*------------------------------------------------------------------------*/
  3334. /**
  3335. *
  3336. * Creates an array cache object to store unique values.
  3337. *
  3338. * @private
  3339. * @constructor
  3340. * @param {Array} [values] The values to cache.
  3341. */
  3342. function SetCache(values) {
  3343. var index = -1,
  3344. length = values == null ? 0 : values.length;
  3345. this.__data__ = new MapCache;
  3346. while (++index < length) {
  3347. this.add(values[index]);
  3348. }
  3349. }
  3350. /**
  3351. * Adds `value` to the array cache.
  3352. *
  3353. * @private
  3354. * @name add
  3355. * @memberOf SetCache
  3356. * @alias push
  3357. * @param {*} value The value to cache.
  3358. * @returns {Object} Returns the cache instance.
  3359. */
  3360. function setCacheAdd(value) {
  3361. this.__data__.set(value, HASH_UNDEFINED);
  3362. return this;
  3363. }
  3364. /**
  3365. * Checks if `value` is in the array cache.
  3366. *
  3367. * @private
  3368. * @name has
  3369. * @memberOf SetCache
  3370. * @param {*} value The value to search for.
  3371. * @returns {number} Returns `true` if `value` is found, else `false`.
  3372. */
  3373. function setCacheHas(value) {
  3374. return this.__data__.has(value);
  3375. }
  3376. // Add methods to `SetCache`.
  3377. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3378. SetCache.prototype.has = setCacheHas;
  3379. /*------------------------------------------------------------------------*/
  3380. /**
  3381. * Creates a stack cache object to store key-value pairs.
  3382. *
  3383. * @private
  3384. * @constructor
  3385. * @param {Array} [entries] The key-value pairs to cache.
  3386. */
  3387. function Stack(entries) {
  3388. var data = this.__data__ = new ListCache(entries);
  3389. this.size = data.size;
  3390. }
  3391. /**
  3392. * Removes all key-value entries from the stack.
  3393. *
  3394. * @private
  3395. * @name clear
  3396. * @memberOf Stack
  3397. */
  3398. function stackClear() {
  3399. this.__data__ = new ListCache;
  3400. this.size = 0;
  3401. }
  3402. /**
  3403. * Removes `key` and its value from the stack.
  3404. *
  3405. * @private
  3406. * @name delete
  3407. * @memberOf Stack
  3408. * @param {string} key The key of the value to remove.
  3409. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3410. */
  3411. function stackDelete(key) {
  3412. var data = this.__data__,
  3413. result = data['delete'](key);
  3414. this.size = data.size;
  3415. return result;
  3416. }
  3417. /**
  3418. * Gets the stack value for `key`.
  3419. *
  3420. * @private
  3421. * @name get
  3422. * @memberOf Stack
  3423. * @param {string} key The key of the value to get.
  3424. * @returns {*} Returns the entry value.
  3425. */
  3426. function stackGet(key) {
  3427. return this.__data__.get(key);
  3428. }
  3429. /**
  3430. * Checks if a stack value for `key` exists.
  3431. *
  3432. * @private
  3433. * @name has
  3434. * @memberOf Stack
  3435. * @param {string} key The key of the entry to check.
  3436. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3437. */
  3438. function stackHas(key) {
  3439. return this.__data__.has(key);
  3440. }
  3441. /**
  3442. * Sets the stack `key` to `value`.
  3443. *
  3444. * @private
  3445. * @name set
  3446. * @memberOf Stack
  3447. * @param {string} key The key of the value to set.
  3448. * @param {*} value The value to set.
  3449. * @returns {Object} Returns the stack cache instance.
  3450. */
  3451. function stackSet(key, value) {
  3452. var data = this.__data__;
  3453. if (data instanceof ListCache) {
  3454. var pairs = data.__data__;
  3455. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3456. pairs.push([key, value]);
  3457. this.size = ++data.size;
  3458. return this;
  3459. }
  3460. data = this.__data__ = new MapCache(pairs);
  3461. }
  3462. data.set(key, value);
  3463. this.size = data.size;
  3464. return this;
  3465. }
  3466. // Add methods to `Stack`.
  3467. Stack.prototype.clear = stackClear;
  3468. Stack.prototype['delete'] = stackDelete;
  3469. Stack.prototype.get = stackGet;
  3470. Stack.prototype.has = stackHas;
  3471. Stack.prototype.set = stackSet;
  3472. /*------------------------------------------------------------------------*/
  3473. /**
  3474. * Creates an array of the enumerable property names of the array-like `value`.
  3475. *
  3476. * @private
  3477. * @param {*} value The value to query.
  3478. * @param {boolean} inherited Specify returning inherited property names.
  3479. * @returns {Array} Returns the array of property names.
  3480. */
  3481. function arrayLikeKeys(value, inherited) {
  3482. var isArr = isArray(value),
  3483. isArg = !isArr && isArguments(value),
  3484. isBuff = !isArr && !isArg && isBuffer(value),
  3485. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3486. skipIndexes = isArr || isArg || isBuff || isType,
  3487. result = skipIndexes ? baseTimes(value.length, String) : [],
  3488. length = result.length;
  3489. for (var key in value) {
  3490. if ((inherited || hasOwnProperty.call(value, key)) &&
  3491. !(skipIndexes && (
  3492. // Safari 9 has enumerable `arguments.length` in strict mode.
  3493. key == 'length' ||
  3494. // Node.js 0.10 has enumerable non-index properties on buffers.
  3495. (isBuff && (key == 'offset' || key == 'parent')) ||
  3496. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3497. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3498. // Skip index properties.
  3499. isIndex(key, length)
  3500. ))) {
  3501. result.push(key);
  3502. }
  3503. }
  3504. return result;
  3505. }
  3506. /**
  3507. * A specialized version of `_.sample` for arrays.
  3508. *
  3509. * @private
  3510. * @param {Array} array The array to sample.
  3511. * @returns {*} Returns the random element.
  3512. */
  3513. function arraySample(array) {
  3514. var length = array.length;
  3515. return length ? array[baseRandom(0, length - 1)] : undefined;
  3516. }
  3517. /**
  3518. * A specialized version of `_.sampleSize` for arrays.
  3519. *
  3520. * @private
  3521. * @param {Array} array The array to sample.
  3522. * @param {number} n The number of elements to sample.
  3523. * @returns {Array} Returns the random elements.
  3524. */
  3525. function arraySampleSize(array, n) {
  3526. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3527. }
  3528. /**
  3529. * A specialized version of `_.shuffle` for arrays.
  3530. *
  3531. * @private
  3532. * @param {Array} array The array to shuffle.
  3533. * @returns {Array} Returns the new shuffled array.
  3534. */
  3535. function arrayShuffle(array) {
  3536. return shuffleSelf(copyArray(array));
  3537. }
  3538. /**
  3539. * This function is like `assignValue` except that it doesn't assign
  3540. * `undefined` values.
  3541. *
  3542. * @private
  3543. * @param {Object} object The object to modify.
  3544. * @param {string} key The key of the property to assign.
  3545. * @param {*} value The value to assign.
  3546. */
  3547. function assignMergeValue(object, key, value) {
  3548. if ((value !== undefined && !eq(object[key], value)) ||
  3549. (value === undefined && !(key in object))) {
  3550. baseAssignValue(object, key, value);
  3551. }
  3552. }
  3553. /**
  3554. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3555. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3556. * for equality comparisons.
  3557. *
  3558. * @private
  3559. * @param {Object} object The object to modify.
  3560. * @param {string} key The key of the property to assign.
  3561. * @param {*} value The value to assign.
  3562. */
  3563. function assignValue(object, key, value) {
  3564. var objValue = object[key];
  3565. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3566. (value === undefined && !(key in object))) {
  3567. baseAssignValue(object, key, value);
  3568. }
  3569. }
  3570. /**
  3571. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3572. *
  3573. * @private
  3574. * @param {Array} array The array to inspect.
  3575. * @param {*} key The key to search for.
  3576. * @returns {number} Returns the index of the matched value, else `-1`.
  3577. */
  3578. function assocIndexOf(array, key) {
  3579. var length = array.length;
  3580. while (length--) {
  3581. if (eq(array[length][0], key)) {
  3582. return length;
  3583. }
  3584. }
  3585. return -1;
  3586. }
  3587. /**
  3588. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3589. * by `iteratee` and values set by `setter`.
  3590. *
  3591. * @private
  3592. * @param {Array|Object} collection The collection to iterate over.
  3593. * @param {Function} setter The function to set `accumulator` values.
  3594. * @param {Function} iteratee The iteratee to transform keys.
  3595. * @param {Object} accumulator The initial aggregated object.
  3596. * @returns {Function} Returns `accumulator`.
  3597. */
  3598. function baseAggregator(collection, setter, iteratee, accumulator) {
  3599. baseEach(collection, function(value, key, collection) {
  3600. setter(accumulator, value, iteratee(value), collection);
  3601. });
  3602. return accumulator;
  3603. }
  3604. /**
  3605. * The base implementation of `_.assign` without support for multiple sources
  3606. * or `customizer` functions.
  3607. *
  3608. * @private
  3609. * @param {Object} object The destination object.
  3610. * @param {Object} source The source object.
  3611. * @returns {Object} Returns `object`.
  3612. */
  3613. function baseAssign(object, source) {
  3614. return object && copyObject(source, keys(source), object);
  3615. }
  3616. /**
  3617. * The base implementation of `_.assignIn` without support for multiple sources
  3618. * or `customizer` functions.
  3619. *
  3620. * @private
  3621. * @param {Object} object The destination object.
  3622. * @param {Object} source The source object.
  3623. * @returns {Object} Returns `object`.
  3624. */
  3625. function baseAssignIn(object, source) {
  3626. return object && copyObject(source, keysIn(source), object);
  3627. }
  3628. /**
  3629. * The base implementation of `assignValue` and `assignMergeValue` without
  3630. * value checks.
  3631. *
  3632. * @private
  3633. * @param {Object} object The object to modify.
  3634. * @param {string} key The key of the property to assign.
  3635. * @param {*} value The value to assign.
  3636. */
  3637. function baseAssignValue(object, key, value) {
  3638. if (key == '__proto__' && defineProperty) {
  3639. defineProperty(object, key, {
  3640. 'configurable': true,
  3641. 'enumerable': true,
  3642. 'value': value,
  3643. 'writable': true
  3644. });
  3645. } else {
  3646. object[key] = value;
  3647. }
  3648. }
  3649. /**
  3650. * The base implementation of `_.at` without support for individual paths.
  3651. *
  3652. * @private
  3653. * @param {Object} object The object to iterate over.
  3654. * @param {string[]} paths The property paths to pick.
  3655. * @returns {Array} Returns the picked elements.
  3656. */
  3657. function baseAt(object, paths) {
  3658. var index = -1,
  3659. length = paths.length,
  3660. result = Array(length),
  3661. skip = object == null;
  3662. while (++index < length) {
  3663. result[index] = skip ? undefined : get(object, paths[index]);
  3664. }
  3665. return result;
  3666. }
  3667. /**
  3668. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3669. *
  3670. * @private
  3671. * @param {number} number The number to clamp.
  3672. * @param {number} [lower] The lower bound.
  3673. * @param {number} upper The upper bound.
  3674. * @returns {number} Returns the clamped number.
  3675. */
  3676. function baseClamp(number, lower, upper) {
  3677. if (number === number) {
  3678. if (upper !== undefined) {
  3679. number = number <= upper ? number : upper;
  3680. }
  3681. if (lower !== undefined) {
  3682. number = number >= lower ? number : lower;
  3683. }
  3684. }
  3685. return number;
  3686. }
  3687. /**
  3688. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3689. * traversed objects.
  3690. *
  3691. * @private
  3692. * @param {*} value The value to clone.
  3693. * @param {boolean} bitmask The bitmask flags.
  3694. * 1 - Deep clone
  3695. * 2 - Flatten inherited properties
  3696. * 4 - Clone symbols
  3697. * @param {Function} [customizer] The function to customize cloning.
  3698. * @param {string} [key] The key of `value`.
  3699. * @param {Object} [object] The parent object of `value`.
  3700. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3701. * @returns {*} Returns the cloned value.
  3702. */
  3703. function baseClone(value, bitmask, customizer, key, object, stack) {
  3704. var result,
  3705. isDeep = bitmask & CLONE_DEEP_FLAG,
  3706. isFlat = bitmask & CLONE_FLAT_FLAG,
  3707. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3708. if (customizer) {
  3709. result = object ? customizer(value, key, object, stack) : customizer(value);
  3710. }
  3711. if (result !== undefined) {
  3712. return result;
  3713. }
  3714. if (!isObject(value)) {
  3715. return value;
  3716. }
  3717. var isArr = isArray(value);
  3718. if (isArr) {
  3719. result = initCloneArray(value);
  3720. if (!isDeep) {
  3721. return copyArray(value, result);
  3722. }
  3723. } else {
  3724. var tag = getTag(value),
  3725. isFunc = tag == funcTag || tag == genTag;
  3726. if (isBuffer(value)) {
  3727. return cloneBuffer(value, isDeep);
  3728. }
  3729. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3730. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3731. if (!isDeep) {
  3732. return isFlat
  3733. ? copySymbolsIn(value, baseAssignIn(result, value))
  3734. : copySymbols(value, baseAssign(result, value));
  3735. }
  3736. } else {
  3737. if (!cloneableTags[tag]) {
  3738. return object ? value : {};
  3739. }
  3740. result = initCloneByTag(value, tag, isDeep);
  3741. }
  3742. }
  3743. // Check for circular references and return its corresponding clone.
  3744. stack || (stack = new Stack);
  3745. var stacked = stack.get(value);
  3746. if (stacked) {
  3747. return stacked;
  3748. }
  3749. stack.set(value, result);
  3750. if (isSet(value)) {
  3751. value.forEach(function(subValue) {
  3752. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3753. });
  3754. } else if (isMap(value)) {
  3755. value.forEach(function(subValue, key) {
  3756. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3757. });
  3758. }
  3759. var keysFunc = isFull
  3760. ? (isFlat ? getAllKeysIn : getAllKeys)
  3761. : (isFlat ? keysIn : keys);
  3762. var props = isArr ? undefined : keysFunc(value);
  3763. arrayEach(props || value, function(subValue, key) {
  3764. if (props) {
  3765. key = subValue;
  3766. subValue = value[key];
  3767. }
  3768. // Recursively populate clone (susceptible to call stack limits).
  3769. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3770. });
  3771. return result;
  3772. }
  3773. /**
  3774. * The base implementation of `_.conforms` which doesn't clone `source`.
  3775. *
  3776. * @private
  3777. * @param {Object} source The object of property predicates to conform to.
  3778. * @returns {Function} Returns the new spec function.
  3779. */
  3780. function baseConforms(source) {
  3781. var props = keys(source);
  3782. return function(object) {
  3783. return baseConformsTo(object, source, props);
  3784. };
  3785. }
  3786. /**
  3787. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3788. *
  3789. * @private
  3790. * @param {Object} object The object to inspect.
  3791. * @param {Object} source The object of property predicates to conform to.
  3792. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3793. */
  3794. function baseConformsTo(object, source, props) {
  3795. var length = props.length;
  3796. if (object == null) {
  3797. return !length;
  3798. }
  3799. object = Object(object);
  3800. while (length--) {
  3801. var key = props[length],
  3802. predicate = source[key],
  3803. value = object[key];
  3804. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3805. return false;
  3806. }
  3807. }
  3808. return true;
  3809. }
  3810. /**
  3811. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3812. * to provide to `func`.
  3813. *
  3814. * @private
  3815. * @param {Function} func The function to delay.
  3816. * @param {number} wait The number of milliseconds to delay invocation.
  3817. * @param {Array} args The arguments to provide to `func`.
  3818. * @returns {number|Object} Returns the timer id or timeout object.
  3819. */
  3820. function baseDelay(func, wait, args) {
  3821. if (typeof func != 'function') {
  3822. throw new TypeError(FUNC_ERROR_TEXT);
  3823. }
  3824. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3825. }
  3826. /**
  3827. * The base implementation of methods like `_.difference` without support
  3828. * for excluding multiple arrays or iteratee shorthands.
  3829. *
  3830. * @private
  3831. * @param {Array} array The array to inspect.
  3832. * @param {Array} values The values to exclude.
  3833. * @param {Function} [iteratee] The iteratee invoked per element.
  3834. * @param {Function} [comparator] The comparator invoked per element.
  3835. * @returns {Array} Returns the new array of filtered values.
  3836. */
  3837. function baseDifference(array, values, iteratee, comparator) {
  3838. var index = -1,
  3839. includes = arrayIncludes,
  3840. isCommon = true,
  3841. length = array.length,
  3842. result = [],
  3843. valuesLength = values.length;
  3844. if (!length) {
  3845. return result;
  3846. }
  3847. if (iteratee) {
  3848. values = arrayMap(values, baseUnary(iteratee));
  3849. }
  3850. if (comparator) {
  3851. includes = arrayIncludesWith;
  3852. isCommon = false;
  3853. }
  3854. else if (values.length >= LARGE_ARRAY_SIZE) {
  3855. includes = cacheHas;
  3856. isCommon = false;
  3857. values = new SetCache(values);
  3858. }
  3859. outer:
  3860. while (++index < length) {
  3861. var value = array[index],
  3862. computed = iteratee == null ? value : iteratee(value);
  3863. value = (comparator || value !== 0) ? value : 0;
  3864. if (isCommon && computed === computed) {
  3865. var valuesIndex = valuesLength;
  3866. while (valuesIndex--) {
  3867. if (values[valuesIndex] === computed) {
  3868. continue outer;
  3869. }
  3870. }
  3871. result.push(value);
  3872. }
  3873. else if (!includes(values, computed, comparator)) {
  3874. result.push(value);
  3875. }
  3876. }
  3877. return result;
  3878. }
  3879. /**
  3880. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3881. *
  3882. * @private
  3883. * @param {Array|Object} collection The collection to iterate over.
  3884. * @param {Function} iteratee The function invoked per iteration.
  3885. * @returns {Array|Object} Returns `collection`.
  3886. */
  3887. var baseEach = createBaseEach(baseForOwn);
  3888. /**
  3889. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3890. *
  3891. * @private
  3892. * @param {Array|Object} collection The collection to iterate over.
  3893. * @param {Function} iteratee The function invoked per iteration.
  3894. * @returns {Array|Object} Returns `collection`.
  3895. */
  3896. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3897. /**
  3898. * The base implementation of `_.every` without support for iteratee shorthands.
  3899. *
  3900. * @private
  3901. * @param {Array|Object} collection The collection to iterate over.
  3902. * @param {Function} predicate The function invoked per iteration.
  3903. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3904. * else `false`
  3905. */
  3906. function baseEvery(collection, predicate) {
  3907. var result = true;
  3908. baseEach(collection, function(value, index, collection) {
  3909. result = !!predicate(value, index, collection);
  3910. return result;
  3911. });
  3912. return result;
  3913. }
  3914. /**
  3915. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3916. * `comparator` to determine the extremum value.
  3917. *
  3918. * @private
  3919. * @param {Array} array The array to iterate over.
  3920. * @param {Function} iteratee The iteratee invoked per iteration.
  3921. * @param {Function} comparator The comparator used to compare values.
  3922. * @returns {*} Returns the extremum value.
  3923. */
  3924. function baseExtremum(array, iteratee, comparator) {
  3925. var index = -1,
  3926. length = array.length;
  3927. while (++index < length) {
  3928. var value = array[index],
  3929. current = iteratee(value);
  3930. if (current != null && (computed === undefined
  3931. ? (current === current && !isSymbol(current))
  3932. : comparator(current, computed)
  3933. )) {
  3934. var computed = current,
  3935. result = value;
  3936. }
  3937. }
  3938. return result;
  3939. }
  3940. /**
  3941. * The base implementation of `_.fill` without an iteratee call guard.
  3942. *
  3943. * @private
  3944. * @param {Array} array The array to fill.
  3945. * @param {*} value The value to fill `array` with.
  3946. * @param {number} [start=0] The start position.
  3947. * @param {number} [end=array.length] The end position.
  3948. * @returns {Array} Returns `array`.
  3949. */
  3950. function baseFill(array, value, start, end) {
  3951. var length = array.length;
  3952. start = toInteger(start);
  3953. if (start < 0) {
  3954. start = -start > length ? 0 : (length + start);
  3955. }
  3956. end = (end === undefined || end > length) ? length : toInteger(end);
  3957. if (end < 0) {
  3958. end += length;
  3959. }
  3960. end = start > end ? 0 : toLength(end);
  3961. while (start < end) {
  3962. array[start++] = value;
  3963. }
  3964. return array;
  3965. }
  3966. /**
  3967. * The base implementation of `_.filter` without support for iteratee shorthands.
  3968. *
  3969. * @private
  3970. * @param {Array|Object} collection The collection to iterate over.
  3971. * @param {Function} predicate The function invoked per iteration.
  3972. * @returns {Array} Returns the new filtered array.
  3973. */
  3974. function baseFilter(collection, predicate) {
  3975. var result = [];
  3976. baseEach(collection, function(value, index, collection) {
  3977. if (predicate(value, index, collection)) {
  3978. result.push(value);
  3979. }
  3980. });
  3981. return result;
  3982. }
  3983. /**
  3984. * The base implementation of `_.flatten` with support for restricting flattening.
  3985. *
  3986. * @private
  3987. * @param {Array} array The array to flatten.
  3988. * @param {number} depth The maximum recursion depth.
  3989. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3990. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3991. * @param {Array} [result=[]] The initial result value.
  3992. * @returns {Array} Returns the new flattened array.
  3993. */
  3994. function baseFlatten(array, depth, predicate, isStrict, result) {
  3995. var index = -1,
  3996. length = array.length;
  3997. predicate || (predicate = isFlattenable);
  3998. result || (result = []);
  3999. while (++index < length) {
  4000. var value = array[index];
  4001. if (depth > 0 && predicate(value)) {
  4002. if (depth > 1) {
  4003. // Recursively flatten arrays (susceptible to call stack limits).
  4004. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4005. } else {
  4006. arrayPush(result, value);
  4007. }
  4008. } else if (!isStrict) {
  4009. result[result.length] = value;
  4010. }
  4011. }
  4012. return result;
  4013. }
  4014. /**
  4015. * The base implementation of `baseForOwn` which iterates over `object`
  4016. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4017. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4018. *
  4019. * @private
  4020. * @param {Object} object The object to iterate over.
  4021. * @param {Function} iteratee The function invoked per iteration.
  4022. * @param {Function} keysFunc The function to get the keys of `object`.
  4023. * @returns {Object} Returns `object`.
  4024. */
  4025. var baseFor = createBaseFor();
  4026. /**
  4027. * This function is like `baseFor` except that it iterates over properties
  4028. * in the opposite order.
  4029. *
  4030. * @private
  4031. * @param {Object} object The object to iterate over.
  4032. * @param {Function} iteratee The function invoked per iteration.
  4033. * @param {Function} keysFunc The function to get the keys of `object`.
  4034. * @returns {Object} Returns `object`.
  4035. */
  4036. var baseForRight = createBaseFor(true);
  4037. /**
  4038. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4039. *
  4040. * @private
  4041. * @param {Object} object The object to iterate over.
  4042. * @param {Function} iteratee The function invoked per iteration.
  4043. * @returns {Object} Returns `object`.
  4044. */
  4045. function baseForOwn(object, iteratee) {
  4046. return object && baseFor(object, iteratee, keys);
  4047. }
  4048. /**
  4049. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4050. *
  4051. * @private
  4052. * @param {Object} object The object to iterate over.
  4053. * @param {Function} iteratee The function invoked per iteration.
  4054. * @returns {Object} Returns `object`.
  4055. */
  4056. function baseForOwnRight(object, iteratee) {
  4057. return object && baseForRight(object, iteratee, keys);
  4058. }
  4059. /**
  4060. * The base implementation of `_.functions` which creates an array of
  4061. * `object` function property names filtered from `props`.
  4062. *
  4063. * @private
  4064. * @param {Object} object The object to inspect.
  4065. * @param {Array} props The property names to filter.
  4066. * @returns {Array} Returns the function names.
  4067. */
  4068. function baseFunctions(object, props) {
  4069. return arrayFilter(props, function(key) {
  4070. return isFunction(object[key]);
  4071. });
  4072. }
  4073. /**
  4074. * The base implementation of `_.get` without support for default values.
  4075. *
  4076. * @private
  4077. * @param {Object} object The object to query.
  4078. * @param {Array|string} path The path of the property to get.
  4079. * @returns {*} Returns the resolved value.
  4080. */
  4081. function baseGet(object, path) {
  4082. path = castPath(path, object);
  4083. var index = 0,
  4084. length = path.length;
  4085. while (object != null && index < length) {
  4086. object = object[toKey(path[index++])];
  4087. }
  4088. return (index && index == length) ? object : undefined;
  4089. }
  4090. /**
  4091. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4092. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4093. * symbols of `object`.
  4094. *
  4095. * @private
  4096. * @param {Object} object The object to query.
  4097. * @param {Function} keysFunc The function to get the keys of `object`.
  4098. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4099. * @returns {Array} Returns the array of property names and symbols.
  4100. */
  4101. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4102. var result = keysFunc(object);
  4103. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4104. }
  4105. /**
  4106. * The base implementation of `getTag` without fallbacks for buggy environments.
  4107. *
  4108. * @private
  4109. * @param {*} value The value to query.
  4110. * @returns {string} Returns the `toStringTag`.
  4111. */
  4112. function baseGetTag(value) {
  4113. if (value == null) {
  4114. return value === undefined ? undefinedTag : nullTag;
  4115. }
  4116. return (symToStringTag && symToStringTag in Object(value))
  4117. ? getRawTag(value)
  4118. : objectToString(value);
  4119. }
  4120. /**
  4121. * The base implementation of `_.gt` which doesn't coerce arguments.
  4122. *
  4123. * @private
  4124. * @param {*} value The value to compare.
  4125. * @param {*} other The other value to compare.
  4126. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4127. * else `false`.
  4128. */
  4129. function baseGt(value, other) {
  4130. return value > other;
  4131. }
  4132. /**
  4133. * The base implementation of `_.has` without support for deep paths.
  4134. *
  4135. * @private
  4136. * @param {Object} [object] The object to query.
  4137. * @param {Array|string} key The key to check.
  4138. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4139. */
  4140. function baseHas(object, key) {
  4141. return object != null && hasOwnProperty.call(object, key);
  4142. }
  4143. /**
  4144. * The base implementation of `_.hasIn` without support for deep paths.
  4145. *
  4146. * @private
  4147. * @param {Object} [object] The object to query.
  4148. * @param {Array|string} key The key to check.
  4149. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4150. */
  4151. function baseHasIn(object, key) {
  4152. return object != null && key in Object(object);
  4153. }
  4154. /**
  4155. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4156. *
  4157. * @private
  4158. * @param {number} number The number to check.
  4159. * @param {number} start The start of the range.
  4160. * @param {number} end The end of the range.
  4161. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4162. */
  4163. function baseInRange(number, start, end) {
  4164. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4165. }
  4166. /**
  4167. * The base implementation of methods like `_.intersection`, without support
  4168. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4169. *
  4170. * @private
  4171. * @param {Array} arrays The arrays to inspect.
  4172. * @param {Function} [iteratee] The iteratee invoked per element.
  4173. * @param {Function} [comparator] The comparator invoked per element.
  4174. * @returns {Array} Returns the new array of shared values.
  4175. */
  4176. function baseIntersection(arrays, iteratee, comparator) {
  4177. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4178. length = arrays[0].length,
  4179. othLength = arrays.length,
  4180. othIndex = othLength,
  4181. caches = Array(othLength),
  4182. maxLength = Infinity,
  4183. result = [];
  4184. while (othIndex--) {
  4185. var array = arrays[othIndex];
  4186. if (othIndex && iteratee) {
  4187. array = arrayMap(array, baseUnary(iteratee));
  4188. }
  4189. maxLength = nativeMin(array.length, maxLength);
  4190. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4191. ? new SetCache(othIndex && array)
  4192. : undefined;
  4193. }
  4194. array = arrays[0];
  4195. var index = -1,
  4196. seen = caches[0];
  4197. outer:
  4198. while (++index < length && result.length < maxLength) {
  4199. var value = array[index],
  4200. computed = iteratee ? iteratee(value) : value;
  4201. value = (comparator || value !== 0) ? value : 0;
  4202. if (!(seen
  4203. ? cacheHas(seen, computed)
  4204. : includes(result, computed, comparator)
  4205. )) {
  4206. othIndex = othLength;
  4207. while (--othIndex) {
  4208. var cache = caches[othIndex];
  4209. if (!(cache
  4210. ? cacheHas(cache, computed)
  4211. : includes(arrays[othIndex], computed, comparator))
  4212. ) {
  4213. continue outer;
  4214. }
  4215. }
  4216. if (seen) {
  4217. seen.push(computed);
  4218. }
  4219. result.push(value);
  4220. }
  4221. }
  4222. return result;
  4223. }
  4224. /**
  4225. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4226. * `object` with values transformed by `iteratee` and set by `setter`.
  4227. *
  4228. * @private
  4229. * @param {Object} object The object to iterate over.
  4230. * @param {Function} setter The function to set `accumulator` values.
  4231. * @param {Function} iteratee The iteratee to transform values.
  4232. * @param {Object} accumulator The initial inverted object.
  4233. * @returns {Function} Returns `accumulator`.
  4234. */
  4235. function baseInverter(object, setter, iteratee, accumulator) {
  4236. baseForOwn(object, function(value, key, object) {
  4237. setter(accumulator, iteratee(value), key, object);
  4238. });
  4239. return accumulator;
  4240. }
  4241. /**
  4242. * The base implementation of `_.invoke` without support for individual
  4243. * method arguments.
  4244. *
  4245. * @private
  4246. * @param {Object} object The object to query.
  4247. * @param {Array|string} path The path of the method to invoke.
  4248. * @param {Array} args The arguments to invoke the method with.
  4249. * @returns {*} Returns the result of the invoked method.
  4250. */
  4251. function baseInvoke(object, path, args) {
  4252. path = castPath(path, object);
  4253. object = parent(object, path);
  4254. var func = object == null ? object : object[toKey(last(path))];
  4255. return func == null ? undefined : apply(func, object, args);
  4256. }
  4257. /**
  4258. * The base implementation of `_.isArguments`.
  4259. *
  4260. * @private
  4261. * @param {*} value The value to check.
  4262. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4263. */
  4264. function baseIsArguments(value) {
  4265. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4266. }
  4267. /**
  4268. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4269. *
  4270. * @private
  4271. * @param {*} value The value to check.
  4272. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4273. */
  4274. function baseIsArrayBuffer(value) {
  4275. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4276. }
  4277. /**
  4278. * The base implementation of `_.isDate` without Node.js optimizations.
  4279. *
  4280. * @private
  4281. * @param {*} value The value to check.
  4282. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4283. */
  4284. function baseIsDate(value) {
  4285. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4286. }
  4287. /**
  4288. * The base implementation of `_.isEqual` which supports partial comparisons
  4289. * and tracks traversed objects.
  4290. *
  4291. * @private
  4292. * @param {*} value The value to compare.
  4293. * @param {*} other The other value to compare.
  4294. * @param {boolean} bitmask The bitmask flags.
  4295. * 1 - Unordered comparison
  4296. * 2 - Partial comparison
  4297. * @param {Function} [customizer] The function to customize comparisons.
  4298. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4299. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4300. */
  4301. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4302. if (value === other) {
  4303. return true;
  4304. }
  4305. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4306. return value !== value && other !== other;
  4307. }
  4308. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4309. }
  4310. /**
  4311. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4312. * deep comparisons and tracks traversed objects enabling objects with circular
  4313. * references to be compared.
  4314. *
  4315. * @private
  4316. * @param {Object} object The object to compare.
  4317. * @param {Object} other The other object to compare.
  4318. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4319. * @param {Function} customizer The function to customize comparisons.
  4320. * @param {Function} equalFunc The function to determine equivalents of values.
  4321. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4322. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4323. */
  4324. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4325. var objIsArr = isArray(object),
  4326. othIsArr = isArray(other),
  4327. objTag = objIsArr ? arrayTag : getTag(object),
  4328. othTag = othIsArr ? arrayTag : getTag(other);
  4329. objTag = objTag == argsTag ? objectTag : objTag;
  4330. othTag = othTag == argsTag ? objectTag : othTag;
  4331. var objIsObj = objTag == objectTag,
  4332. othIsObj = othTag == objectTag,
  4333. isSameTag = objTag == othTag;
  4334. if (isSameTag && isBuffer(object)) {
  4335. if (!isBuffer(other)) {
  4336. return false;
  4337. }
  4338. objIsArr = true;
  4339. objIsObj = false;
  4340. }
  4341. if (isSameTag && !objIsObj) {
  4342. stack || (stack = new Stack);
  4343. return (objIsArr || isTypedArray(object))
  4344. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4345. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4346. }
  4347. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4348. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4349. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4350. if (objIsWrapped || othIsWrapped) {
  4351. var objUnwrapped = objIsWrapped ? object.value() : object,
  4352. othUnwrapped = othIsWrapped ? other.value() : other;
  4353. stack || (stack = new Stack);
  4354. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4355. }
  4356. }
  4357. if (!isSameTag) {
  4358. return false;
  4359. }
  4360. stack || (stack = new Stack);
  4361. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4362. }
  4363. /**
  4364. * The base implementation of `_.isMap` without Node.js optimizations.
  4365. *
  4366. * @private
  4367. * @param {*} value The value to check.
  4368. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4369. */
  4370. function baseIsMap(value) {
  4371. return isObjectLike(value) && getTag(value) == mapTag;
  4372. }
  4373. /**
  4374. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4375. *
  4376. * @private
  4377. * @param {Object} object The object to inspect.
  4378. * @param {Object} source The object of property values to match.
  4379. * @param {Array} matchData The property names, values, and compare flags to match.
  4380. * @param {Function} [customizer] The function to customize comparisons.
  4381. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4382. */
  4383. function baseIsMatch(object, source, matchData, customizer) {
  4384. var index = matchData.length,
  4385. length = index,
  4386. noCustomizer = !customizer;
  4387. if (object == null) {
  4388. return !length;
  4389. }
  4390. object = Object(object);
  4391. while (index--) {
  4392. var data = matchData[index];
  4393. if ((noCustomizer && data[2])
  4394. ? data[1] !== object[data[0]]
  4395. : !(data[0] in object)
  4396. ) {
  4397. return false;
  4398. }
  4399. }
  4400. while (++index < length) {
  4401. data = matchData[index];
  4402. var key = data[0],
  4403. objValue = object[key],
  4404. srcValue = data[1];
  4405. if (noCustomizer && data[2]) {
  4406. if (objValue === undefined && !(key in object)) {
  4407. return false;
  4408. }
  4409. } else {
  4410. var stack = new Stack;
  4411. if (customizer) {
  4412. var result = customizer(objValue, srcValue, key, object, source, stack);
  4413. }
  4414. if (!(result === undefined
  4415. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4416. : result
  4417. )) {
  4418. return false;
  4419. }
  4420. }
  4421. }
  4422. return true;
  4423. }
  4424. /**
  4425. * The base implementation of `_.isNative` without bad shim checks.
  4426. *
  4427. * @private
  4428. * @param {*} value The value to check.
  4429. * @returns {boolean} Returns `true` if `value` is a native function,
  4430. * else `false`.
  4431. */
  4432. function baseIsNative(value) {
  4433. if (!isObject(value) || isMasked(value)) {
  4434. return false;
  4435. }
  4436. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4437. return pattern.test(toSource(value));
  4438. }
  4439. /**
  4440. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4441. *
  4442. * @private
  4443. * @param {*} value The value to check.
  4444. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4445. */
  4446. function baseIsRegExp(value) {
  4447. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4448. }
  4449. /**
  4450. * The base implementation of `_.isSet` without Node.js optimizations.
  4451. *
  4452. * @private
  4453. * @param {*} value The value to check.
  4454. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4455. */
  4456. function baseIsSet(value) {
  4457. return isObjectLike(value) && getTag(value) == setTag;
  4458. }
  4459. /**
  4460. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4461. *
  4462. * @private
  4463. * @param {*} value The value to check.
  4464. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4465. */
  4466. function baseIsTypedArray(value) {
  4467. return isObjectLike(value) &&
  4468. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4469. }
  4470. /**
  4471. * The base implementation of `_.iteratee`.
  4472. *
  4473. * @private
  4474. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4475. * @returns {Function} Returns the iteratee.
  4476. */
  4477. function baseIteratee(value) {
  4478. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4479. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4480. if (typeof value == 'function') {
  4481. return value;
  4482. }
  4483. if (value == null) {
  4484. return identity;
  4485. }
  4486. if (typeof value == 'object') {
  4487. return isArray(value)
  4488. ? baseMatchesProperty(value[0], value[1])
  4489. : baseMatches(value);
  4490. }
  4491. return property(value);
  4492. }
  4493. /**
  4494. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4495. *
  4496. * @private
  4497. * @param {Object} object The object to query.
  4498. * @returns {Array} Returns the array of property names.
  4499. */
  4500. function baseKeys(object) {
  4501. if (!isPrototype(object)) {
  4502. return nativeKeys(object);
  4503. }
  4504. var result = [];
  4505. for (var key in Object(object)) {
  4506. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4507. result.push(key);
  4508. }
  4509. }
  4510. return result;
  4511. }
  4512. /**
  4513. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4514. *
  4515. * @private
  4516. * @param {Object} object The object to query.
  4517. * @returns {Array} Returns the array of property names.
  4518. */
  4519. function baseKeysIn(object) {
  4520. if (!isObject(object)) {
  4521. return nativeKeysIn(object);
  4522. }
  4523. var isProto = isPrototype(object),
  4524. result = [];
  4525. for (var key in object) {
  4526. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4527. result.push(key);
  4528. }
  4529. }
  4530. return result;
  4531. }
  4532. /**
  4533. * The base implementation of `_.lt` which doesn't coerce arguments.
  4534. *
  4535. * @private
  4536. * @param {*} value The value to compare.
  4537. * @param {*} other The other value to compare.
  4538. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4539. * else `false`.
  4540. */
  4541. function baseLt(value, other) {
  4542. return value < other;
  4543. }
  4544. /**
  4545. * The base implementation of `_.map` without support for iteratee shorthands.
  4546. *
  4547. * @private
  4548. * @param {Array|Object} collection The collection to iterate over.
  4549. * @param {Function} iteratee The function invoked per iteration.
  4550. * @returns {Array} Returns the new mapped array.
  4551. */
  4552. function baseMap(collection, iteratee) {
  4553. var index = -1,
  4554. result = isArrayLike(collection) ? Array(collection.length) : [];
  4555. baseEach(collection, function(value, key, collection) {
  4556. result[++index] = iteratee(value, key, collection);
  4557. });
  4558. return result;
  4559. }
  4560. /**
  4561. * The base implementation of `_.matches` which doesn't clone `source`.
  4562. *
  4563. * @private
  4564. * @param {Object} source The object of property values to match.
  4565. * @returns {Function} Returns the new spec function.
  4566. */
  4567. function baseMatches(source) {
  4568. var matchData = getMatchData(source);
  4569. if (matchData.length == 1 && matchData[0][2]) {
  4570. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4571. }
  4572. return function(object) {
  4573. return object === source || baseIsMatch(object, source, matchData);
  4574. };
  4575. }
  4576. /**
  4577. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4578. *
  4579. * @private
  4580. * @param {string} path The path of the property to get.
  4581. * @param {*} srcValue The value to match.
  4582. * @returns {Function} Returns the new spec function.
  4583. */
  4584. function baseMatchesProperty(path, srcValue) {
  4585. if (isKey(path) && isStrictComparable(srcValue)) {
  4586. return matchesStrictComparable(toKey(path), srcValue);
  4587. }
  4588. return function(object) {
  4589. var objValue = get(object, path);
  4590. return (objValue === undefined && objValue === srcValue)
  4591. ? hasIn(object, path)
  4592. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4593. };
  4594. }
  4595. /**
  4596. * The base implementation of `_.merge` without support for multiple sources.
  4597. *
  4598. * @private
  4599. * @param {Object} object The destination object.
  4600. * @param {Object} source The source object.
  4601. * @param {number} srcIndex The index of `source`.
  4602. * @param {Function} [customizer] The function to customize merged values.
  4603. * @param {Object} [stack] Tracks traversed source values and their merged
  4604. * counterparts.
  4605. */
  4606. function baseMerge(object, source, srcIndex, customizer, stack) {
  4607. if (object === source) {
  4608. return;
  4609. }
  4610. baseFor(source, function(srcValue, key) {
  4611. stack || (stack = new Stack);
  4612. if (isObject(srcValue)) {
  4613. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4614. }
  4615. else {
  4616. var newValue = customizer
  4617. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4618. : undefined;
  4619. if (newValue === undefined) {
  4620. newValue = srcValue;
  4621. }
  4622. assignMergeValue(object, key, newValue);
  4623. }
  4624. }, keysIn);
  4625. }
  4626. /**
  4627. * A specialized version of `baseMerge` for arrays and objects which performs
  4628. * deep merges and tracks traversed objects enabling objects with circular
  4629. * references to be merged.
  4630. *
  4631. * @private
  4632. * @param {Object} object The destination object.
  4633. * @param {Object} source The source object.
  4634. * @param {string} key The key of the value to merge.
  4635. * @param {number} srcIndex The index of `source`.
  4636. * @param {Function} mergeFunc The function to merge values.
  4637. * @param {Function} [customizer] The function to customize assigned values.
  4638. * @param {Object} [stack] Tracks traversed source values and their merged
  4639. * counterparts.
  4640. */
  4641. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4642. var objValue = safeGet(object, key),
  4643. srcValue = safeGet(source, key),
  4644. stacked = stack.get(srcValue);
  4645. if (stacked) {
  4646. assignMergeValue(object, key, stacked);
  4647. return;
  4648. }
  4649. var newValue = customizer
  4650. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4651. : undefined;
  4652. var isCommon = newValue === undefined;
  4653. if (isCommon) {
  4654. var isArr = isArray(srcValue),
  4655. isBuff = !isArr && isBuffer(srcValue),
  4656. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4657. newValue = srcValue;
  4658. if (isArr || isBuff || isTyped) {
  4659. if (isArray(objValue)) {
  4660. newValue = objValue;
  4661. }
  4662. else if (isArrayLikeObject(objValue)) {
  4663. newValue = copyArray(objValue);
  4664. }
  4665. else if (isBuff) {
  4666. isCommon = false;
  4667. newValue = cloneBuffer(srcValue, true);
  4668. }
  4669. else if (isTyped) {
  4670. isCommon = false;
  4671. newValue = cloneTypedArray(srcValue, true);
  4672. }
  4673. else {
  4674. newValue = [];
  4675. }
  4676. }
  4677. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4678. newValue = objValue;
  4679. if (isArguments(objValue)) {
  4680. newValue = toPlainObject(objValue);
  4681. }
  4682. else if (!isObject(objValue) || isFunction(objValue)) {
  4683. newValue = initCloneObject(srcValue);
  4684. }
  4685. }
  4686. else {
  4687. isCommon = false;
  4688. }
  4689. }
  4690. if (isCommon) {
  4691. // Recursively merge objects and arrays (susceptible to call stack limits).
  4692. stack.set(srcValue, newValue);
  4693. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4694. stack['delete'](srcValue);
  4695. }
  4696. assignMergeValue(object, key, newValue);
  4697. }
  4698. /**
  4699. * The base implementation of `_.nth` which doesn't coerce arguments.
  4700. *
  4701. * @private
  4702. * @param {Array} array The array to query.
  4703. * @param {number} n The index of the element to return.
  4704. * @returns {*} Returns the nth element of `array`.
  4705. */
  4706. function baseNth(array, n) {
  4707. var length = array.length;
  4708. if (!length) {
  4709. return;
  4710. }
  4711. n += n < 0 ? length : 0;
  4712. return isIndex(n, length) ? array[n] : undefined;
  4713. }
  4714. /**
  4715. * The base implementation of `_.orderBy` without param guards.
  4716. *
  4717. * @private
  4718. * @param {Array|Object} collection The collection to iterate over.
  4719. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4720. * @param {string[]} orders The sort orders of `iteratees`.
  4721. * @returns {Array} Returns the new sorted array.
  4722. */
  4723. function baseOrderBy(collection, iteratees, orders) {
  4724. if (iteratees.length) {
  4725. iteratees = arrayMap(iteratees, function(iteratee) {
  4726. if (isArray(iteratee)) {
  4727. return function(value) {
  4728. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4729. }
  4730. }
  4731. return iteratee;
  4732. });
  4733. } else {
  4734. iteratees = [identity];
  4735. }
  4736. var index = -1;
  4737. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4738. var result = baseMap(collection, function(value, key, collection) {
  4739. var criteria = arrayMap(iteratees, function(iteratee) {
  4740. return iteratee(value);
  4741. });
  4742. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4743. });
  4744. return baseSortBy(result, function(object, other) {
  4745. return compareMultiple(object, other, orders);
  4746. });
  4747. }
  4748. /**
  4749. * The base implementation of `_.pick` without support for individual
  4750. * property identifiers.
  4751. *
  4752. * @private
  4753. * @param {Object} object The source object.
  4754. * @param {string[]} paths The property paths to pick.
  4755. * @returns {Object} Returns the new object.
  4756. */
  4757. function basePick(object, paths) {
  4758. return basePickBy(object, paths, function(value, path) {
  4759. return hasIn(object, path);
  4760. });
  4761. }
  4762. /**
  4763. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4764. *
  4765. * @private
  4766. * @param {Object} object The source object.
  4767. * @param {string[]} paths The property paths to pick.
  4768. * @param {Function} predicate The function invoked per property.
  4769. * @returns {Object} Returns the new object.
  4770. */
  4771. function basePickBy(object, paths, predicate) {
  4772. var index = -1,
  4773. length = paths.length,
  4774. result = {};
  4775. while (++index < length) {
  4776. var path = paths[index],
  4777. value = baseGet(object, path);
  4778. if (predicate(value, path)) {
  4779. baseSet(result, castPath(path, object), value);
  4780. }
  4781. }
  4782. return result;
  4783. }
  4784. /**
  4785. * A specialized version of `baseProperty` which supports deep paths.
  4786. *
  4787. * @private
  4788. * @param {Array|string} path The path of the property to get.
  4789. * @returns {Function} Returns the new accessor function.
  4790. */
  4791. function basePropertyDeep(path) {
  4792. return function(object) {
  4793. return baseGet(object, path);
  4794. };
  4795. }
  4796. /**
  4797. * The base implementation of `_.pullAllBy` without support for iteratee
  4798. * shorthands.
  4799. *
  4800. * @private
  4801. * @param {Array} array The array to modify.
  4802. * @param {Array} values The values to remove.
  4803. * @param {Function} [iteratee] The iteratee invoked per element.
  4804. * @param {Function} [comparator] The comparator invoked per element.
  4805. * @returns {Array} Returns `array`.
  4806. */
  4807. function basePullAll(array, values, iteratee, comparator) {
  4808. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4809. index = -1,
  4810. length = values.length,
  4811. seen = array;
  4812. if (array === values) {
  4813. values = copyArray(values);
  4814. }
  4815. if (iteratee) {
  4816. seen = arrayMap(array, baseUnary(iteratee));
  4817. }
  4818. while (++index < length) {
  4819. var fromIndex = 0,
  4820. value = values[index],
  4821. computed = iteratee ? iteratee(value) : value;
  4822. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4823. if (seen !== array) {
  4824. splice.call(seen, fromIndex, 1);
  4825. }
  4826. splice.call(array, fromIndex, 1);
  4827. }
  4828. }
  4829. return array;
  4830. }
  4831. /**
  4832. * The base implementation of `_.pullAt` without support for individual
  4833. * indexes or capturing the removed elements.
  4834. *
  4835. * @private
  4836. * @param {Array} array The array to modify.
  4837. * @param {number[]} indexes The indexes of elements to remove.
  4838. * @returns {Array} Returns `array`.
  4839. */
  4840. function basePullAt(array, indexes) {
  4841. var length = array ? indexes.length : 0,
  4842. lastIndex = length - 1;
  4843. while (length--) {
  4844. var index = indexes[length];
  4845. if (length == lastIndex || index !== previous) {
  4846. var previous = index;
  4847. if (isIndex(index)) {
  4848. splice.call(array, index, 1);
  4849. } else {
  4850. baseUnset(array, index);
  4851. }
  4852. }
  4853. }
  4854. return array;
  4855. }
  4856. /**
  4857. * The base implementation of `_.random` without support for returning
  4858. * floating-point numbers.
  4859. *
  4860. * @private
  4861. * @param {number} lower The lower bound.
  4862. * @param {number} upper The upper bound.
  4863. * @returns {number} Returns the random number.
  4864. */
  4865. function baseRandom(lower, upper) {
  4866. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4867. }
  4868. /**
  4869. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4870. * coerce arguments.
  4871. *
  4872. * @private
  4873. * @param {number} start The start of the range.
  4874. * @param {number} end The end of the range.
  4875. * @param {number} step The value to increment or decrement by.
  4876. * @param {boolean} [fromRight] Specify iterating from right to left.
  4877. * @returns {Array} Returns the range of numbers.
  4878. */
  4879. function baseRange(start, end, step, fromRight) {
  4880. var index = -1,
  4881. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4882. result = Array(length);
  4883. while (length--) {
  4884. result[fromRight ? length : ++index] = start;
  4885. start += step;
  4886. }
  4887. return result;
  4888. }
  4889. /**
  4890. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4891. *
  4892. * @private
  4893. * @param {string} string The string to repeat.
  4894. * @param {number} n The number of times to repeat the string.
  4895. * @returns {string} Returns the repeated string.
  4896. */
  4897. function baseRepeat(string, n) {
  4898. var result = '';
  4899. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4900. return result;
  4901. }
  4902. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4903. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4904. do {
  4905. if (n % 2) {
  4906. result += string;
  4907. }
  4908. n = nativeFloor(n / 2);
  4909. if (n) {
  4910. string += string;
  4911. }
  4912. } while (n);
  4913. return result;
  4914. }
  4915. /**
  4916. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4917. *
  4918. * @private
  4919. * @param {Function} func The function to apply a rest parameter to.
  4920. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4921. * @returns {Function} Returns the new function.
  4922. */
  4923. function baseRest(func, start) {
  4924. return setToString(overRest(func, start, identity), func + '');
  4925. }
  4926. /**
  4927. * The base implementation of `_.sample`.
  4928. *
  4929. * @private
  4930. * @param {Array|Object} collection The collection to sample.
  4931. * @returns {*} Returns the random element.
  4932. */
  4933. function baseSample(collection) {
  4934. return arraySample(values(collection));
  4935. }
  4936. /**
  4937. * The base implementation of `_.sampleSize` without param guards.
  4938. *
  4939. * @private
  4940. * @param {Array|Object} collection The collection to sample.
  4941. * @param {number} n The number of elements to sample.
  4942. * @returns {Array} Returns the random elements.
  4943. */
  4944. function baseSampleSize(collection, n) {
  4945. var array = values(collection);
  4946. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4947. }
  4948. /**
  4949. * The base implementation of `_.set`.
  4950. *
  4951. * @private
  4952. * @param {Object} object The object to modify.
  4953. * @param {Array|string} path The path of the property to set.
  4954. * @param {*} value The value to set.
  4955. * @param {Function} [customizer] The function to customize path creation.
  4956. * @returns {Object} Returns `object`.
  4957. */
  4958. function baseSet(object, path, value, customizer) {
  4959. if (!isObject(object)) {
  4960. return object;
  4961. }
  4962. path = castPath(path, object);
  4963. var index = -1,
  4964. length = path.length,
  4965. lastIndex = length - 1,
  4966. nested = object;
  4967. while (nested != null && ++index < length) {
  4968. var key = toKey(path[index]),
  4969. newValue = value;
  4970. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4971. return object;
  4972. }
  4973. if (index != lastIndex) {
  4974. var objValue = nested[key];
  4975. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4976. if (newValue === undefined) {
  4977. newValue = isObject(objValue)
  4978. ? objValue
  4979. : (isIndex(path[index + 1]) ? [] : {});
  4980. }
  4981. }
  4982. assignValue(nested, key, newValue);
  4983. nested = nested[key];
  4984. }
  4985. return object;
  4986. }
  4987. /**
  4988. * The base implementation of `setData` without support for hot loop shorting.
  4989. *
  4990. * @private
  4991. * @param {Function} func The function to associate metadata with.
  4992. * @param {*} data The metadata.
  4993. * @returns {Function} Returns `func`.
  4994. */
  4995. var baseSetData = !metaMap ? identity : function(func, data) {
  4996. metaMap.set(func, data);
  4997. return func;
  4998. };
  4999. /**
  5000. * The base implementation of `setToString` without support for hot loop shorting.
  5001. *
  5002. * @private
  5003. * @param {Function} func The function to modify.
  5004. * @param {Function} string The `toString` result.
  5005. * @returns {Function} Returns `func`.
  5006. */
  5007. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5008. return defineProperty(func, 'toString', {
  5009. 'configurable': true,
  5010. 'enumerable': false,
  5011. 'value': constant(string),
  5012. 'writable': true
  5013. });
  5014. };
  5015. /**
  5016. * The base implementation of `_.shuffle`.
  5017. *
  5018. * @private
  5019. * @param {Array|Object} collection The collection to shuffle.
  5020. * @returns {Array} Returns the new shuffled array.
  5021. */
  5022. function baseShuffle(collection) {
  5023. return shuffleSelf(values(collection));
  5024. }
  5025. /**
  5026. * The base implementation of `_.slice` without an iteratee call guard.
  5027. *
  5028. * @private
  5029. * @param {Array} array The array to slice.
  5030. * @param {number} [start=0] The start position.
  5031. * @param {number} [end=array.length] The end position.
  5032. * @returns {Array} Returns the slice of `array`.
  5033. */
  5034. function baseSlice(array, start, end) {
  5035. var index = -1,
  5036. length = array.length;
  5037. if (start < 0) {
  5038. start = -start > length ? 0 : (length + start);
  5039. }
  5040. end = end > length ? length : end;
  5041. if (end < 0) {
  5042. end += length;
  5043. }
  5044. length = start > end ? 0 : ((end - start) >>> 0);
  5045. start >>>= 0;
  5046. var result = Array(length);
  5047. while (++index < length) {
  5048. result[index] = array[index + start];
  5049. }
  5050. return result;
  5051. }
  5052. /**
  5053. * The base implementation of `_.some` without support for iteratee shorthands.
  5054. *
  5055. * @private
  5056. * @param {Array|Object} collection The collection to iterate over.
  5057. * @param {Function} predicate The function invoked per iteration.
  5058. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5059. * else `false`.
  5060. */
  5061. function baseSome(collection, predicate) {
  5062. var result;
  5063. baseEach(collection, function(value, index, collection) {
  5064. result = predicate(value, index, collection);
  5065. return !result;
  5066. });
  5067. return !!result;
  5068. }
  5069. /**
  5070. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5071. * performs a binary search of `array` to determine the index at which `value`
  5072. * should be inserted into `array` in order to maintain its sort order.
  5073. *
  5074. * @private
  5075. * @param {Array} array The sorted array to inspect.
  5076. * @param {*} value The value to evaluate.
  5077. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5078. * @returns {number} Returns the index at which `value` should be inserted
  5079. * into `array`.
  5080. */
  5081. function baseSortedIndex(array, value, retHighest) {
  5082. var low = 0,
  5083. high = array == null ? low : array.length;
  5084. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5085. while (low < high) {
  5086. var mid = (low + high) >>> 1,
  5087. computed = array[mid];
  5088. if (computed !== null && !isSymbol(computed) &&
  5089. (retHighest ? (computed <= value) : (computed < value))) {
  5090. low = mid + 1;
  5091. } else {
  5092. high = mid;
  5093. }
  5094. }
  5095. return high;
  5096. }
  5097. return baseSortedIndexBy(array, value, identity, retHighest);
  5098. }
  5099. /**
  5100. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5101. * which invokes `iteratee` for `value` and each element of `array` to compute
  5102. * their sort ranking. The iteratee is invoked with one argument; (value).
  5103. *
  5104. * @private
  5105. * @param {Array} array The sorted array to inspect.
  5106. * @param {*} value The value to evaluate.
  5107. * @param {Function} iteratee The iteratee invoked per element.
  5108. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5109. * @returns {number} Returns the index at which `value` should be inserted
  5110. * into `array`.
  5111. */
  5112. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5113. var low = 0,
  5114. high = array == null ? 0 : array.length;
  5115. if (high === 0) {
  5116. return 0;
  5117. }
  5118. value = iteratee(value);
  5119. var valIsNaN = value !== value,
  5120. valIsNull = value === null,
  5121. valIsSymbol = isSymbol(value),
  5122. valIsUndefined = value === undefined;
  5123. while (low < high) {
  5124. var mid = nativeFloor((low + high) / 2),
  5125. computed = iteratee(array[mid]),
  5126. othIsDefined = computed !== undefined,
  5127. othIsNull = computed === null,
  5128. othIsReflexive = computed === computed,
  5129. othIsSymbol = isSymbol(computed);
  5130. if (valIsNaN) {
  5131. var setLow = retHighest || othIsReflexive;
  5132. } else if (valIsUndefined) {
  5133. setLow = othIsReflexive && (retHighest || othIsDefined);
  5134. } else if (valIsNull) {
  5135. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5136. } else if (valIsSymbol) {
  5137. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5138. } else if (othIsNull || othIsSymbol) {
  5139. setLow = false;
  5140. } else {
  5141. setLow = retHighest ? (computed <= value) : (computed < value);
  5142. }
  5143. if (setLow) {
  5144. low = mid + 1;
  5145. } else {
  5146. high = mid;
  5147. }
  5148. }
  5149. return nativeMin(high, MAX_ARRAY_INDEX);
  5150. }
  5151. /**
  5152. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5153. * support for iteratee shorthands.
  5154. *
  5155. * @private
  5156. * @param {Array} array The array to inspect.
  5157. * @param {Function} [iteratee] The iteratee invoked per element.
  5158. * @returns {Array} Returns the new duplicate free array.
  5159. */
  5160. function baseSortedUniq(array, iteratee) {
  5161. var index = -1,
  5162. length = array.length,
  5163. resIndex = 0,
  5164. result = [];
  5165. while (++index < length) {
  5166. var value = array[index],
  5167. computed = iteratee ? iteratee(value) : value;
  5168. if (!index || !eq(computed, seen)) {
  5169. var seen = computed;
  5170. result[resIndex++] = value === 0 ? 0 : value;
  5171. }
  5172. }
  5173. return result;
  5174. }
  5175. /**
  5176. * The base implementation of `_.toNumber` which doesn't ensure correct
  5177. * conversions of binary, hexadecimal, or octal string values.
  5178. *
  5179. * @private
  5180. * @param {*} value The value to process.
  5181. * @returns {number} Returns the number.
  5182. */
  5183. function baseToNumber(value) {
  5184. if (typeof value == 'number') {
  5185. return value;
  5186. }
  5187. if (isSymbol(value)) {
  5188. return NAN;
  5189. }
  5190. return +value;
  5191. }
  5192. /**
  5193. * The base implementation of `_.toString` which doesn't convert nullish
  5194. * values to empty strings.
  5195. *
  5196. * @private
  5197. * @param {*} value The value to process.
  5198. * @returns {string} Returns the string.
  5199. */
  5200. function baseToString(value) {
  5201. // Exit early for strings to avoid a performance hit in some environments.
  5202. if (typeof value == 'string') {
  5203. return value;
  5204. }
  5205. if (isArray(value)) {
  5206. // Recursively convert values (susceptible to call stack limits).
  5207. return arrayMap(value, baseToString) + '';
  5208. }
  5209. if (isSymbol(value)) {
  5210. return symbolToString ? symbolToString.call(value) : '';
  5211. }
  5212. var result = (value + '');
  5213. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5214. }
  5215. /**
  5216. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5217. *
  5218. * @private
  5219. * @param {Array} array The array to inspect.
  5220. * @param {Function} [iteratee] The iteratee invoked per element.
  5221. * @param {Function} [comparator] The comparator invoked per element.
  5222. * @returns {Array} Returns the new duplicate free array.
  5223. */
  5224. function baseUniq(array, iteratee, comparator) {
  5225. var index = -1,
  5226. includes = arrayIncludes,
  5227. length = array.length,
  5228. isCommon = true,
  5229. result = [],
  5230. seen = result;
  5231. if (comparator) {
  5232. isCommon = false;
  5233. includes = arrayIncludesWith;
  5234. }
  5235. else if (length >= LARGE_ARRAY_SIZE) {
  5236. var set = iteratee ? null : createSet(array);
  5237. if (set) {
  5238. return setToArray(set);
  5239. }
  5240. isCommon = false;
  5241. includes = cacheHas;
  5242. seen = new SetCache;
  5243. }
  5244. else {
  5245. seen = iteratee ? [] : result;
  5246. }
  5247. outer:
  5248. while (++index < length) {
  5249. var value = array[index],
  5250. computed = iteratee ? iteratee(value) : value;
  5251. value = (comparator || value !== 0) ? value : 0;
  5252. if (isCommon && computed === computed) {
  5253. var seenIndex = seen.length;
  5254. while (seenIndex--) {
  5255. if (seen[seenIndex] === computed) {
  5256. continue outer;
  5257. }
  5258. }
  5259. if (iteratee) {
  5260. seen.push(computed);
  5261. }
  5262. result.push(value);
  5263. }
  5264. else if (!includes(seen, computed, comparator)) {
  5265. if (seen !== result) {
  5266. seen.push(computed);
  5267. }
  5268. result.push(value);
  5269. }
  5270. }
  5271. return result;
  5272. }
  5273. /**
  5274. * The base implementation of `_.unset`.
  5275. *
  5276. * @private
  5277. * @param {Object} object The object to modify.
  5278. * @param {Array|string} path The property path to unset.
  5279. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5280. */
  5281. function baseUnset(object, path) {
  5282. path = castPath(path, object);
  5283. object = parent(object, path);
  5284. return object == null || delete object[toKey(last(path))];
  5285. }
  5286. /**
  5287. * The base implementation of `_.update`.
  5288. *
  5289. * @private
  5290. * @param {Object} object The object to modify.
  5291. * @param {Array|string} path The path of the property to update.
  5292. * @param {Function} updater The function to produce the updated value.
  5293. * @param {Function} [customizer] The function to customize path creation.
  5294. * @returns {Object} Returns `object`.
  5295. */
  5296. function baseUpdate(object, path, updater, customizer) {
  5297. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5298. }
  5299. /**
  5300. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5301. * without support for iteratee shorthands.
  5302. *
  5303. * @private
  5304. * @param {Array} array The array to query.
  5305. * @param {Function} predicate The function invoked per iteration.
  5306. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5307. * @param {boolean} [fromRight] Specify iterating from right to left.
  5308. * @returns {Array} Returns the slice of `array`.
  5309. */
  5310. function baseWhile(array, predicate, isDrop, fromRight) {
  5311. var length = array.length,
  5312. index = fromRight ? length : -1;
  5313. while ((fromRight ? index-- : ++index < length) &&
  5314. predicate(array[index], index, array)) {}
  5315. return isDrop
  5316. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5317. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5318. }
  5319. /**
  5320. * The base implementation of `wrapperValue` which returns the result of
  5321. * performing a sequence of actions on the unwrapped `value`, where each
  5322. * successive action is supplied the return value of the previous.
  5323. *
  5324. * @private
  5325. * @param {*} value The unwrapped value.
  5326. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5327. * @returns {*} Returns the resolved value.
  5328. */
  5329. function baseWrapperValue(value, actions) {
  5330. var result = value;
  5331. if (result instanceof LazyWrapper) {
  5332. result = result.value();
  5333. }
  5334. return arrayReduce(actions, function(result, action) {
  5335. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5336. }, result);
  5337. }
  5338. /**
  5339. * The base implementation of methods like `_.xor`, without support for
  5340. * iteratee shorthands, that accepts an array of arrays to inspect.
  5341. *
  5342. * @private
  5343. * @param {Array} arrays The arrays to inspect.
  5344. * @param {Function} [iteratee] The iteratee invoked per element.
  5345. * @param {Function} [comparator] The comparator invoked per element.
  5346. * @returns {Array} Returns the new array of values.
  5347. */
  5348. function baseXor(arrays, iteratee, comparator) {
  5349. var length = arrays.length;
  5350. if (length < 2) {
  5351. return length ? baseUniq(arrays[0]) : [];
  5352. }
  5353. var index = -1,
  5354. result = Array(length);
  5355. while (++index < length) {
  5356. var array = arrays[index],
  5357. othIndex = -1;
  5358. while (++othIndex < length) {
  5359. if (othIndex != index) {
  5360. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5361. }
  5362. }
  5363. }
  5364. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5365. }
  5366. /**
  5367. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5368. *
  5369. * @private
  5370. * @param {Array} props The property identifiers.
  5371. * @param {Array} values The property values.
  5372. * @param {Function} assignFunc The function to assign values.
  5373. * @returns {Object} Returns the new object.
  5374. */
  5375. function baseZipObject(props, values, assignFunc) {
  5376. var index = -1,
  5377. length = props.length,
  5378. valsLength = values.length,
  5379. result = {};
  5380. while (++index < length) {
  5381. var value = index < valsLength ? values[index] : undefined;
  5382. assignFunc(result, props[index], value);
  5383. }
  5384. return result;
  5385. }
  5386. /**
  5387. * Casts `value` to an empty array if it's not an array like object.
  5388. *
  5389. * @private
  5390. * @param {*} value The value to inspect.
  5391. * @returns {Array|Object} Returns the cast array-like object.
  5392. */
  5393. function castArrayLikeObject(value) {
  5394. return isArrayLikeObject(value) ? value : [];
  5395. }
  5396. /**
  5397. * Casts `value` to `identity` if it's not a function.
  5398. *
  5399. * @private
  5400. * @param {*} value The value to inspect.
  5401. * @returns {Function} Returns cast function.
  5402. */
  5403. function castFunction(value) {
  5404. return typeof value == 'function' ? value : identity;
  5405. }
  5406. /**
  5407. * Casts `value` to a path array if it's not one.
  5408. *
  5409. * @private
  5410. * @param {*} value The value to inspect.
  5411. * @param {Object} [object] The object to query keys on.
  5412. * @returns {Array} Returns the cast property path array.
  5413. */
  5414. function castPath(value, object) {
  5415. if (isArray(value)) {
  5416. return value;
  5417. }
  5418. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5419. }
  5420. /**
  5421. * A `baseRest` alias which can be replaced with `identity` by module
  5422. * replacement plugins.
  5423. *
  5424. * @private
  5425. * @type {Function}
  5426. * @param {Function} func The function to apply a rest parameter to.
  5427. * @returns {Function} Returns the new function.
  5428. */
  5429. var castRest = baseRest;
  5430. /**
  5431. * Casts `array` to a slice if it's needed.
  5432. *
  5433. * @private
  5434. * @param {Array} array The array to inspect.
  5435. * @param {number} start The start position.
  5436. * @param {number} [end=array.length] The end position.
  5437. * @returns {Array} Returns the cast slice.
  5438. */
  5439. function castSlice(array, start, end) {
  5440. var length = array.length;
  5441. end = end === undefined ? length : end;
  5442. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5443. }
  5444. /**
  5445. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5446. *
  5447. * @private
  5448. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5449. */
  5450. var clearTimeout = ctxClearTimeout || function(id) {
  5451. return root.clearTimeout(id);
  5452. };
  5453. /**
  5454. * Creates a clone of `buffer`.
  5455. *
  5456. * @private
  5457. * @param {Buffer} buffer The buffer to clone.
  5458. * @param {boolean} [isDeep] Specify a deep clone.
  5459. * @returns {Buffer} Returns the cloned buffer.
  5460. */
  5461. function cloneBuffer(buffer, isDeep) {
  5462. if (isDeep) {
  5463. return buffer.slice();
  5464. }
  5465. var length = buffer.length,
  5466. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5467. buffer.copy(result);
  5468. return result;
  5469. }
  5470. /**
  5471. * Creates a clone of `arrayBuffer`.
  5472. *
  5473. * @private
  5474. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5475. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5476. */
  5477. function cloneArrayBuffer(arrayBuffer) {
  5478. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5479. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5480. return result;
  5481. }
  5482. /**
  5483. * Creates a clone of `dataView`.
  5484. *
  5485. * @private
  5486. * @param {Object} dataView The data view to clone.
  5487. * @param {boolean} [isDeep] Specify a deep clone.
  5488. * @returns {Object} Returns the cloned data view.
  5489. */
  5490. function cloneDataView(dataView, isDeep) {
  5491. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5492. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5493. }
  5494. /**
  5495. * Creates a clone of `regexp`.
  5496. *
  5497. * @private
  5498. * @param {Object} regexp The regexp to clone.
  5499. * @returns {Object} Returns the cloned regexp.
  5500. */
  5501. function cloneRegExp(regexp) {
  5502. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5503. result.lastIndex = regexp.lastIndex;
  5504. return result;
  5505. }
  5506. /**
  5507. * Creates a clone of the `symbol` object.
  5508. *
  5509. * @private
  5510. * @param {Object} symbol The symbol object to clone.
  5511. * @returns {Object} Returns the cloned symbol object.
  5512. */
  5513. function cloneSymbol(symbol) {
  5514. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5515. }
  5516. /**
  5517. * Creates a clone of `typedArray`.
  5518. *
  5519. * @private
  5520. * @param {Object} typedArray The typed array to clone.
  5521. * @param {boolean} [isDeep] Specify a deep clone.
  5522. * @returns {Object} Returns the cloned typed array.
  5523. */
  5524. function cloneTypedArray(typedArray, isDeep) {
  5525. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5526. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5527. }
  5528. /**
  5529. * Compares values to sort them in ascending order.
  5530. *
  5531. * @private
  5532. * @param {*} value The value to compare.
  5533. * @param {*} other The other value to compare.
  5534. * @returns {number} Returns the sort order indicator for `value`.
  5535. */
  5536. function compareAscending(value, other) {
  5537. if (value !== other) {
  5538. var valIsDefined = value !== undefined,
  5539. valIsNull = value === null,
  5540. valIsReflexive = value === value,
  5541. valIsSymbol = isSymbol(value);
  5542. var othIsDefined = other !== undefined,
  5543. othIsNull = other === null,
  5544. othIsReflexive = other === other,
  5545. othIsSymbol = isSymbol(other);
  5546. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5547. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5548. (valIsNull && othIsDefined && othIsReflexive) ||
  5549. (!valIsDefined && othIsReflexive) ||
  5550. !valIsReflexive) {
  5551. return 1;
  5552. }
  5553. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5554. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5555. (othIsNull && valIsDefined && valIsReflexive) ||
  5556. (!othIsDefined && valIsReflexive) ||
  5557. !othIsReflexive) {
  5558. return -1;
  5559. }
  5560. }
  5561. return 0;
  5562. }
  5563. /**
  5564. * Used by `_.orderBy` to compare multiple properties of a value to another
  5565. * and stable sort them.
  5566. *
  5567. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5568. * specify an order of "desc" for descending or "asc" for ascending sort order
  5569. * of corresponding values.
  5570. *
  5571. * @private
  5572. * @param {Object} object The object to compare.
  5573. * @param {Object} other The other object to compare.
  5574. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5575. * @returns {number} Returns the sort order indicator for `object`.
  5576. */
  5577. function compareMultiple(object, other, orders) {
  5578. var index = -1,
  5579. objCriteria = object.criteria,
  5580. othCriteria = other.criteria,
  5581. length = objCriteria.length,
  5582. ordersLength = orders.length;
  5583. while (++index < length) {
  5584. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5585. if (result) {
  5586. if (index >= ordersLength) {
  5587. return result;
  5588. }
  5589. var order = orders[index];
  5590. return result * (order == 'desc' ? -1 : 1);
  5591. }
  5592. }
  5593. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5594. // that causes it, under certain circumstances, to provide the same value for
  5595. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5596. // for more details.
  5597. //
  5598. // This also ensures a stable sort in V8 and other engines.
  5599. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5600. return object.index - other.index;
  5601. }
  5602. /**
  5603. * Creates an array that is the composition of partially applied arguments,
  5604. * placeholders, and provided arguments into a single array of arguments.
  5605. *
  5606. * @private
  5607. * @param {Array} args The provided arguments.
  5608. * @param {Array} partials The arguments to prepend to those provided.
  5609. * @param {Array} holders The `partials` placeholder indexes.
  5610. * @params {boolean} [isCurried] Specify composing for a curried function.
  5611. * @returns {Array} Returns the new array of composed arguments.
  5612. */
  5613. function composeArgs(args, partials, holders, isCurried) {
  5614. var argsIndex = -1,
  5615. argsLength = args.length,
  5616. holdersLength = holders.length,
  5617. leftIndex = -1,
  5618. leftLength = partials.length,
  5619. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5620. result = Array(leftLength + rangeLength),
  5621. isUncurried = !isCurried;
  5622. while (++leftIndex < leftLength) {
  5623. result[leftIndex] = partials[leftIndex];
  5624. }
  5625. while (++argsIndex < holdersLength) {
  5626. if (isUncurried || argsIndex < argsLength) {
  5627. result[holders[argsIndex]] = args[argsIndex];
  5628. }
  5629. }
  5630. while (rangeLength--) {
  5631. result[leftIndex++] = args[argsIndex++];
  5632. }
  5633. return result;
  5634. }
  5635. /**
  5636. * This function is like `composeArgs` except that the arguments composition
  5637. * is tailored for `_.partialRight`.
  5638. *
  5639. * @private
  5640. * @param {Array} args The provided arguments.
  5641. * @param {Array} partials The arguments to append to those provided.
  5642. * @param {Array} holders The `partials` placeholder indexes.
  5643. * @params {boolean} [isCurried] Specify composing for a curried function.
  5644. * @returns {Array} Returns the new array of composed arguments.
  5645. */
  5646. function composeArgsRight(args, partials, holders, isCurried) {
  5647. var argsIndex = -1,
  5648. argsLength = args.length,
  5649. holdersIndex = -1,
  5650. holdersLength = holders.length,
  5651. rightIndex = -1,
  5652. rightLength = partials.length,
  5653. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5654. result = Array(rangeLength + rightLength),
  5655. isUncurried = !isCurried;
  5656. while (++argsIndex < rangeLength) {
  5657. result[argsIndex] = args[argsIndex];
  5658. }
  5659. var offset = argsIndex;
  5660. while (++rightIndex < rightLength) {
  5661. result[offset + rightIndex] = partials[rightIndex];
  5662. }
  5663. while (++holdersIndex < holdersLength) {
  5664. if (isUncurried || argsIndex < argsLength) {
  5665. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5666. }
  5667. }
  5668. return result;
  5669. }
  5670. /**
  5671. * Copies the values of `source` to `array`.
  5672. *
  5673. * @private
  5674. * @param {Array} source The array to copy values from.
  5675. * @param {Array} [array=[]] The array to copy values to.
  5676. * @returns {Array} Returns `array`.
  5677. */
  5678. function copyArray(source, array) {
  5679. var index = -1,
  5680. length = source.length;
  5681. array || (array = Array(length));
  5682. while (++index < length) {
  5683. array[index] = source[index];
  5684. }
  5685. return array;
  5686. }
  5687. /**
  5688. * Copies properties of `source` to `object`.
  5689. *
  5690. * @private
  5691. * @param {Object} source The object to copy properties from.
  5692. * @param {Array} props The property identifiers to copy.
  5693. * @param {Object} [object={}] The object to copy properties to.
  5694. * @param {Function} [customizer] The function to customize copied values.
  5695. * @returns {Object} Returns `object`.
  5696. */
  5697. function copyObject(source, props, object, customizer) {
  5698. var isNew = !object;
  5699. object || (object = {});
  5700. var index = -1,
  5701. length = props.length;
  5702. while (++index < length) {
  5703. var key = props[index];
  5704. var newValue = customizer
  5705. ? customizer(object[key], source[key], key, object, source)
  5706. : undefined;
  5707. if (newValue === undefined) {
  5708. newValue = source[key];
  5709. }
  5710. if (isNew) {
  5711. baseAssignValue(object, key, newValue);
  5712. } else {
  5713. assignValue(object, key, newValue);
  5714. }
  5715. }
  5716. return object;
  5717. }
  5718. /**
  5719. * Copies own symbols of `source` to `object`.
  5720. *
  5721. * @private
  5722. * @param {Object} source The object to copy symbols from.
  5723. * @param {Object} [object={}] The object to copy symbols to.
  5724. * @returns {Object} Returns `object`.
  5725. */
  5726. function copySymbols(source, object) {
  5727. return copyObject(source, getSymbols(source), object);
  5728. }
  5729. /**
  5730. * Copies own and inherited symbols of `source` to `object`.
  5731. *
  5732. * @private
  5733. * @param {Object} source The object to copy symbols from.
  5734. * @param {Object} [object={}] The object to copy symbols to.
  5735. * @returns {Object} Returns `object`.
  5736. */
  5737. function copySymbolsIn(source, object) {
  5738. return copyObject(source, getSymbolsIn(source), object);
  5739. }
  5740. /**
  5741. * Creates a function like `_.groupBy`.
  5742. *
  5743. * @private
  5744. * @param {Function} setter The function to set accumulator values.
  5745. * @param {Function} [initializer] The accumulator object initializer.
  5746. * @returns {Function} Returns the new aggregator function.
  5747. */
  5748. function createAggregator(setter, initializer) {
  5749. return function(collection, iteratee) {
  5750. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5751. accumulator = initializer ? initializer() : {};
  5752. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5753. };
  5754. }
  5755. /**
  5756. * Creates a function like `_.assign`.
  5757. *
  5758. * @private
  5759. * @param {Function} assigner The function to assign values.
  5760. * @returns {Function} Returns the new assigner function.
  5761. */
  5762. function createAssigner(assigner) {
  5763. return baseRest(function(object, sources) {
  5764. var index = -1,
  5765. length = sources.length,
  5766. customizer = length > 1 ? sources[length - 1] : undefined,
  5767. guard = length > 2 ? sources[2] : undefined;
  5768. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5769. ? (length--, customizer)
  5770. : undefined;
  5771. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5772. customizer = length < 3 ? undefined : customizer;
  5773. length = 1;
  5774. }
  5775. object = Object(object);
  5776. while (++index < length) {
  5777. var source = sources[index];
  5778. if (source) {
  5779. assigner(object, source, index, customizer);
  5780. }
  5781. }
  5782. return object;
  5783. });
  5784. }
  5785. /**
  5786. * Creates a `baseEach` or `baseEachRight` function.
  5787. *
  5788. * @private
  5789. * @param {Function} eachFunc The function to iterate over a collection.
  5790. * @param {boolean} [fromRight] Specify iterating from right to left.
  5791. * @returns {Function} Returns the new base function.
  5792. */
  5793. function createBaseEach(eachFunc, fromRight) {
  5794. return function(collection, iteratee) {
  5795. if (collection == null) {
  5796. return collection;
  5797. }
  5798. if (!isArrayLike(collection)) {
  5799. return eachFunc(collection, iteratee);
  5800. }
  5801. var length = collection.length,
  5802. index = fromRight ? length : -1,
  5803. iterable = Object(collection);
  5804. while ((fromRight ? index-- : ++index < length)) {
  5805. if (iteratee(iterable[index], index, iterable) === false) {
  5806. break;
  5807. }
  5808. }
  5809. return collection;
  5810. };
  5811. }
  5812. /**
  5813. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5814. *
  5815. * @private
  5816. * @param {boolean} [fromRight] Specify iterating from right to left.
  5817. * @returns {Function} Returns the new base function.
  5818. */
  5819. function createBaseFor(fromRight) {
  5820. return function(object, iteratee, keysFunc) {
  5821. var index = -1,
  5822. iterable = Object(object),
  5823. props = keysFunc(object),
  5824. length = props.length;
  5825. while (length--) {
  5826. var key = props[fromRight ? length : ++index];
  5827. if (iteratee(iterable[key], key, iterable) === false) {
  5828. break;
  5829. }
  5830. }
  5831. return object;
  5832. };
  5833. }
  5834. /**
  5835. * Creates a function that wraps `func` to invoke it with the optional `this`
  5836. * binding of `thisArg`.
  5837. *
  5838. * @private
  5839. * @param {Function} func The function to wrap.
  5840. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5841. * @param {*} [thisArg] The `this` binding of `func`.
  5842. * @returns {Function} Returns the new wrapped function.
  5843. */
  5844. function createBind(func, bitmask, thisArg) {
  5845. var isBind = bitmask & WRAP_BIND_FLAG,
  5846. Ctor = createCtor(func);
  5847. function wrapper() {
  5848. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5849. return fn.apply(isBind ? thisArg : this, arguments);
  5850. }
  5851. return wrapper;
  5852. }
  5853. /**
  5854. * Creates a function like `_.lowerFirst`.
  5855. *
  5856. * @private
  5857. * @param {string} methodName The name of the `String` case method to use.
  5858. * @returns {Function} Returns the new case function.
  5859. */
  5860. function createCaseFirst(methodName) {
  5861. return function(string) {
  5862. string = toString(string);
  5863. var strSymbols = hasUnicode(string)
  5864. ? stringToArray(string)
  5865. : undefined;
  5866. var chr = strSymbols
  5867. ? strSymbols[0]
  5868. : string.charAt(0);
  5869. var trailing = strSymbols
  5870. ? castSlice(strSymbols, 1).join('')
  5871. : string.slice(1);
  5872. return chr[methodName]() + trailing;
  5873. };
  5874. }
  5875. /**
  5876. * Creates a function like `_.camelCase`.
  5877. *
  5878. * @private
  5879. * @param {Function} callback The function to combine each word.
  5880. * @returns {Function} Returns the new compounder function.
  5881. */
  5882. function createCompounder(callback) {
  5883. return function(string) {
  5884. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5885. };
  5886. }
  5887. /**
  5888. * Creates a function that produces an instance of `Ctor` regardless of
  5889. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5890. *
  5891. * @private
  5892. * @param {Function} Ctor The constructor to wrap.
  5893. * @returns {Function} Returns the new wrapped function.
  5894. */
  5895. function createCtor(Ctor) {
  5896. return function() {
  5897. // Use a `switch` statement to work with class constructors. See
  5898. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5899. // for more details.
  5900. var args = arguments;
  5901. switch (args.length) {
  5902. case 0: return new Ctor;
  5903. case 1: return new Ctor(args[0]);
  5904. case 2: return new Ctor(args[0], args[1]);
  5905. case 3: return new Ctor(args[0], args[1], args[2]);
  5906. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5907. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5908. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5909. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5910. }
  5911. var thisBinding = baseCreate(Ctor.prototype),
  5912. result = Ctor.apply(thisBinding, args);
  5913. // Mimic the constructor's `return` behavior.
  5914. // See https://es5.github.io/#x13.2.2 for more details.
  5915. return isObject(result) ? result : thisBinding;
  5916. };
  5917. }
  5918. /**
  5919. * Creates a function that wraps `func` to enable currying.
  5920. *
  5921. * @private
  5922. * @param {Function} func The function to wrap.
  5923. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5924. * @param {number} arity The arity of `func`.
  5925. * @returns {Function} Returns the new wrapped function.
  5926. */
  5927. function createCurry(func, bitmask, arity) {
  5928. var Ctor = createCtor(func);
  5929. function wrapper() {
  5930. var length = arguments.length,
  5931. args = Array(length),
  5932. index = length,
  5933. placeholder = getHolder(wrapper);
  5934. while (index--) {
  5935. args[index] = arguments[index];
  5936. }
  5937. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5938. ? []
  5939. : replaceHolders(args, placeholder);
  5940. length -= holders.length;
  5941. if (length < arity) {
  5942. return createRecurry(
  5943. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5944. args, holders, undefined, undefined, arity - length);
  5945. }
  5946. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5947. return apply(fn, this, args);
  5948. }
  5949. return wrapper;
  5950. }
  5951. /**
  5952. * Creates a `_.find` or `_.findLast` function.
  5953. *
  5954. * @private
  5955. * @param {Function} findIndexFunc The function to find the collection index.
  5956. * @returns {Function} Returns the new find function.
  5957. */
  5958. function createFind(findIndexFunc) {
  5959. return function(collection, predicate, fromIndex) {
  5960. var iterable = Object(collection);
  5961. if (!isArrayLike(collection)) {
  5962. var iteratee = getIteratee(predicate, 3);
  5963. collection = keys(collection);
  5964. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5965. }
  5966. var index = findIndexFunc(collection, predicate, fromIndex);
  5967. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5968. };
  5969. }
  5970. /**
  5971. * Creates a `_.flow` or `_.flowRight` function.
  5972. *
  5973. * @private
  5974. * @param {boolean} [fromRight] Specify iterating from right to left.
  5975. * @returns {Function} Returns the new flow function.
  5976. */
  5977. function createFlow(fromRight) {
  5978. return flatRest(function(funcs) {
  5979. var length = funcs.length,
  5980. index = length,
  5981. prereq = LodashWrapper.prototype.thru;
  5982. if (fromRight) {
  5983. funcs.reverse();
  5984. }
  5985. while (index--) {
  5986. var func = funcs[index];
  5987. if (typeof func != 'function') {
  5988. throw new TypeError(FUNC_ERROR_TEXT);
  5989. }
  5990. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5991. var wrapper = new LodashWrapper([], true);
  5992. }
  5993. }
  5994. index = wrapper ? index : length;
  5995. while (++index < length) {
  5996. func = funcs[index];
  5997. var funcName = getFuncName(func),
  5998. data = funcName == 'wrapper' ? getData(func) : undefined;
  5999. if (data && isLaziable(data[0]) &&
  6000. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6001. !data[4].length && data[9] == 1
  6002. ) {
  6003. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6004. } else {
  6005. wrapper = (func.length == 1 && isLaziable(func))
  6006. ? wrapper[funcName]()
  6007. : wrapper.thru(func);
  6008. }
  6009. }
  6010. return function() {
  6011. var args = arguments,
  6012. value = args[0];
  6013. if (wrapper && args.length == 1 && isArray(value)) {
  6014. return wrapper.plant(value).value();
  6015. }
  6016. var index = 0,
  6017. result = length ? funcs[index].apply(this, args) : value;
  6018. while (++index < length) {
  6019. result = funcs[index].call(this, result);
  6020. }
  6021. return result;
  6022. };
  6023. });
  6024. }
  6025. /**
  6026. * Creates a function that wraps `func` to invoke it with optional `this`
  6027. * binding of `thisArg`, partial application, and currying.
  6028. *
  6029. * @private
  6030. * @param {Function|string} func The function or method name to wrap.
  6031. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6032. * @param {*} [thisArg] The `this` binding of `func`.
  6033. * @param {Array} [partials] The arguments to prepend to those provided to
  6034. * the new function.
  6035. * @param {Array} [holders] The `partials` placeholder indexes.
  6036. * @param {Array} [partialsRight] The arguments to append to those provided
  6037. * to the new function.
  6038. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6039. * @param {Array} [argPos] The argument positions of the new function.
  6040. * @param {number} [ary] The arity cap of `func`.
  6041. * @param {number} [arity] The arity of `func`.
  6042. * @returns {Function} Returns the new wrapped function.
  6043. */
  6044. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6045. var isAry = bitmask & WRAP_ARY_FLAG,
  6046. isBind = bitmask & WRAP_BIND_FLAG,
  6047. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6048. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6049. isFlip = bitmask & WRAP_FLIP_FLAG,
  6050. Ctor = isBindKey ? undefined : createCtor(func);
  6051. function wrapper() {
  6052. var length = arguments.length,
  6053. args = Array(length),
  6054. index = length;
  6055. while (index--) {
  6056. args[index] = arguments[index];
  6057. }
  6058. if (isCurried) {
  6059. var placeholder = getHolder(wrapper),
  6060. holdersCount = countHolders(args, placeholder);
  6061. }
  6062. if (partials) {
  6063. args = composeArgs(args, partials, holders, isCurried);
  6064. }
  6065. if (partialsRight) {
  6066. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6067. }
  6068. length -= holdersCount;
  6069. if (isCurried && length < arity) {
  6070. var newHolders = replaceHolders(args, placeholder);
  6071. return createRecurry(
  6072. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6073. args, newHolders, argPos, ary, arity - length
  6074. );
  6075. }
  6076. var thisBinding = isBind ? thisArg : this,
  6077. fn = isBindKey ? thisBinding[func] : func;
  6078. length = args.length;
  6079. if (argPos) {
  6080. args = reorder(args, argPos);
  6081. } else if (isFlip && length > 1) {
  6082. args.reverse();
  6083. }
  6084. if (isAry && ary < length) {
  6085. args.length = ary;
  6086. }
  6087. if (this && this !== root && this instanceof wrapper) {
  6088. fn = Ctor || createCtor(fn);
  6089. }
  6090. return fn.apply(thisBinding, args);
  6091. }
  6092. return wrapper;
  6093. }
  6094. /**
  6095. * Creates a function like `_.invertBy`.
  6096. *
  6097. * @private
  6098. * @param {Function} setter The function to set accumulator values.
  6099. * @param {Function} toIteratee The function to resolve iteratees.
  6100. * @returns {Function} Returns the new inverter function.
  6101. */
  6102. function createInverter(setter, toIteratee) {
  6103. return function(object, iteratee) {
  6104. return baseInverter(object, setter, toIteratee(iteratee), {});
  6105. };
  6106. }
  6107. /**
  6108. * Creates a function that performs a mathematical operation on two values.
  6109. *
  6110. * @private
  6111. * @param {Function} operator The function to perform the operation.
  6112. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6113. * @returns {Function} Returns the new mathematical operation function.
  6114. */
  6115. function createMathOperation(operator, defaultValue) {
  6116. return function(value, other) {
  6117. var result;
  6118. if (value === undefined && other === undefined) {
  6119. return defaultValue;
  6120. }
  6121. if (value !== undefined) {
  6122. result = value;
  6123. }
  6124. if (other !== undefined) {
  6125. if (result === undefined) {
  6126. return other;
  6127. }
  6128. if (typeof value == 'string' || typeof other == 'string') {
  6129. value = baseToString(value);
  6130. other = baseToString(other);
  6131. } else {
  6132. value = baseToNumber(value);
  6133. other = baseToNumber(other);
  6134. }
  6135. result = operator(value, other);
  6136. }
  6137. return result;
  6138. };
  6139. }
  6140. /**
  6141. * Creates a function like `_.over`.
  6142. *
  6143. * @private
  6144. * @param {Function} arrayFunc The function to iterate over iteratees.
  6145. * @returns {Function} Returns the new over function.
  6146. */
  6147. function createOver(arrayFunc) {
  6148. return flatRest(function(iteratees) {
  6149. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6150. return baseRest(function(args) {
  6151. var thisArg = this;
  6152. return arrayFunc(iteratees, function(iteratee) {
  6153. return apply(iteratee, thisArg, args);
  6154. });
  6155. });
  6156. });
  6157. }
  6158. /**
  6159. * Creates the padding for `string` based on `length`. The `chars` string
  6160. * is truncated if the number of characters exceeds `length`.
  6161. *
  6162. * @private
  6163. * @param {number} length The padding length.
  6164. * @param {string} [chars=' '] The string used as padding.
  6165. * @returns {string} Returns the padding for `string`.
  6166. */
  6167. function createPadding(length, chars) {
  6168. chars = chars === undefined ? ' ' : baseToString(chars);
  6169. var charsLength = chars.length;
  6170. if (charsLength < 2) {
  6171. return charsLength ? baseRepeat(chars, length) : chars;
  6172. }
  6173. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6174. return hasUnicode(chars)
  6175. ? castSlice(stringToArray(result), 0, length).join('')
  6176. : result.slice(0, length);
  6177. }
  6178. /**
  6179. * Creates a function that wraps `func` to invoke it with the `this` binding
  6180. * of `thisArg` and `partials` prepended to the arguments it receives.
  6181. *
  6182. * @private
  6183. * @param {Function} func The function to wrap.
  6184. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6185. * @param {*} thisArg The `this` binding of `func`.
  6186. * @param {Array} partials The arguments to prepend to those provided to
  6187. * the new function.
  6188. * @returns {Function} Returns the new wrapped function.
  6189. */
  6190. function createPartial(func, bitmask, thisArg, partials) {
  6191. var isBind = bitmask & WRAP_BIND_FLAG,
  6192. Ctor = createCtor(func);
  6193. function wrapper() {
  6194. var argsIndex = -1,
  6195. argsLength = arguments.length,
  6196. leftIndex = -1,
  6197. leftLength = partials.length,
  6198. args = Array(leftLength + argsLength),
  6199. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6200. while (++leftIndex < leftLength) {
  6201. args[leftIndex] = partials[leftIndex];
  6202. }
  6203. while (argsLength--) {
  6204. args[leftIndex++] = arguments[++argsIndex];
  6205. }
  6206. return apply(fn, isBind ? thisArg : this, args);
  6207. }
  6208. return wrapper;
  6209. }
  6210. /**
  6211. * Creates a `_.range` or `_.rangeRight` function.
  6212. *
  6213. * @private
  6214. * @param {boolean} [fromRight] Specify iterating from right to left.
  6215. * @returns {Function} Returns the new range function.
  6216. */
  6217. function createRange(fromRight) {
  6218. return function(start, end, step) {
  6219. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6220. end = step = undefined;
  6221. }
  6222. // Ensure the sign of `-0` is preserved.
  6223. start = toFinite(start);
  6224. if (end === undefined) {
  6225. end = start;
  6226. start = 0;
  6227. } else {
  6228. end = toFinite(end);
  6229. }
  6230. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6231. return baseRange(start, end, step, fromRight);
  6232. };
  6233. }
  6234. /**
  6235. * Creates a function that performs a relational operation on two values.
  6236. *
  6237. * @private
  6238. * @param {Function} operator The function to perform the operation.
  6239. * @returns {Function} Returns the new relational operation function.
  6240. */
  6241. function createRelationalOperation(operator) {
  6242. return function(value, other) {
  6243. if (!(typeof value == 'string' && typeof other == 'string')) {
  6244. value = toNumber(value);
  6245. other = toNumber(other);
  6246. }
  6247. return operator(value, other);
  6248. };
  6249. }
  6250. /**
  6251. * Creates a function that wraps `func` to continue currying.
  6252. *
  6253. * @private
  6254. * @param {Function} func The function to wrap.
  6255. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6256. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6257. * @param {*} placeholder The placeholder value.
  6258. * @param {*} [thisArg] The `this` binding of `func`.
  6259. * @param {Array} [partials] The arguments to prepend to those provided to
  6260. * the new function.
  6261. * @param {Array} [holders] The `partials` placeholder indexes.
  6262. * @param {Array} [argPos] The argument positions of the new function.
  6263. * @param {number} [ary] The arity cap of `func`.
  6264. * @param {number} [arity] The arity of `func`.
  6265. * @returns {Function} Returns the new wrapped function.
  6266. */
  6267. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6268. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6269. newHolders = isCurry ? holders : undefined,
  6270. newHoldersRight = isCurry ? undefined : holders,
  6271. newPartials = isCurry ? partials : undefined,
  6272. newPartialsRight = isCurry ? undefined : partials;
  6273. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6274. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6275. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6276. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6277. }
  6278. var newData = [
  6279. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6280. newHoldersRight, argPos, ary, arity
  6281. ];
  6282. var result = wrapFunc.apply(undefined, newData);
  6283. if (isLaziable(func)) {
  6284. setData(result, newData);
  6285. }
  6286. result.placeholder = placeholder;
  6287. return setWrapToString(result, func, bitmask);
  6288. }
  6289. /**
  6290. * Creates a function like `_.round`.
  6291. *
  6292. * @private
  6293. * @param {string} methodName The name of the `Math` method to use when rounding.
  6294. * @returns {Function} Returns the new round function.
  6295. */
  6296. function createRound(methodName) {
  6297. var func = Math[methodName];
  6298. return function(number, precision) {
  6299. number = toNumber(number);
  6300. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6301. if (precision && nativeIsFinite(number)) {
  6302. // Shift with exponential notation to avoid floating-point issues.
  6303. // See [MDN](https://mdn.io/round#Examples) for more details.
  6304. var pair = (toString(number) + 'e').split('e'),
  6305. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6306. pair = (toString(value) + 'e').split('e');
  6307. return +(pair[0] + 'e' + (+pair[1] - precision));
  6308. }
  6309. return func(number);
  6310. };
  6311. }
  6312. /**
  6313. * Creates a set object of `values`.
  6314. *
  6315. * @private
  6316. * @param {Array} values The values to add to the set.
  6317. * @returns {Object} Returns the new set.
  6318. */
  6319. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6320. return new Set(values);
  6321. };
  6322. /**
  6323. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6324. *
  6325. * @private
  6326. * @param {Function} keysFunc The function to get the keys of a given object.
  6327. * @returns {Function} Returns the new pairs function.
  6328. */
  6329. function createToPairs(keysFunc) {
  6330. return function(object) {
  6331. var tag = getTag(object);
  6332. if (tag == mapTag) {
  6333. return mapToArray(object);
  6334. }
  6335. if (tag == setTag) {
  6336. return setToPairs(object);
  6337. }
  6338. return baseToPairs(object, keysFunc(object));
  6339. };
  6340. }
  6341. /**
  6342. * Creates a function that either curries or invokes `func` with optional
  6343. * `this` binding and partially applied arguments.
  6344. *
  6345. * @private
  6346. * @param {Function|string} func The function or method name to wrap.
  6347. * @param {number} bitmask The bitmask flags.
  6348. * 1 - `_.bind`
  6349. * 2 - `_.bindKey`
  6350. * 4 - `_.curry` or `_.curryRight` of a bound function
  6351. * 8 - `_.curry`
  6352. * 16 - `_.curryRight`
  6353. * 32 - `_.partial`
  6354. * 64 - `_.partialRight`
  6355. * 128 - `_.rearg`
  6356. * 256 - `_.ary`
  6357. * 512 - `_.flip`
  6358. * @param {*} [thisArg] The `this` binding of `func`.
  6359. * @param {Array} [partials] The arguments to be partially applied.
  6360. * @param {Array} [holders] The `partials` placeholder indexes.
  6361. * @param {Array} [argPos] The argument positions of the new function.
  6362. * @param {number} [ary] The arity cap of `func`.
  6363. * @param {number} [arity] The arity of `func`.
  6364. * @returns {Function} Returns the new wrapped function.
  6365. */
  6366. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6367. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6368. if (!isBindKey && typeof func != 'function') {
  6369. throw new TypeError(FUNC_ERROR_TEXT);
  6370. }
  6371. var length = partials ? partials.length : 0;
  6372. if (!length) {
  6373. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6374. partials = holders = undefined;
  6375. }
  6376. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6377. arity = arity === undefined ? arity : toInteger(arity);
  6378. length -= holders ? holders.length : 0;
  6379. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6380. var partialsRight = partials,
  6381. holdersRight = holders;
  6382. partials = holders = undefined;
  6383. }
  6384. var data = isBindKey ? undefined : getData(func);
  6385. var newData = [
  6386. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6387. argPos, ary, arity
  6388. ];
  6389. if (data) {
  6390. mergeData(newData, data);
  6391. }
  6392. func = newData[0];
  6393. bitmask = newData[1];
  6394. thisArg = newData[2];
  6395. partials = newData[3];
  6396. holders = newData[4];
  6397. arity = newData[9] = newData[9] === undefined
  6398. ? (isBindKey ? 0 : func.length)
  6399. : nativeMax(newData[9] - length, 0);
  6400. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6401. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6402. }
  6403. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6404. var result = createBind(func, bitmask, thisArg);
  6405. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6406. result = createCurry(func, bitmask, arity);
  6407. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6408. result = createPartial(func, bitmask, thisArg, partials);
  6409. } else {
  6410. result = createHybrid.apply(undefined, newData);
  6411. }
  6412. var setter = data ? baseSetData : setData;
  6413. return setWrapToString(setter(result, newData), func, bitmask);
  6414. }
  6415. /**
  6416. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6417. * of source objects to the destination object for all destination properties
  6418. * that resolve to `undefined`.
  6419. *
  6420. * @private
  6421. * @param {*} objValue The destination value.
  6422. * @param {*} srcValue The source value.
  6423. * @param {string} key The key of the property to assign.
  6424. * @param {Object} object The parent object of `objValue`.
  6425. * @returns {*} Returns the value to assign.
  6426. */
  6427. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6428. if (objValue === undefined ||
  6429. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6430. return srcValue;
  6431. }
  6432. return objValue;
  6433. }
  6434. /**
  6435. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6436. * objects into destination objects that are passed thru.
  6437. *
  6438. * @private
  6439. * @param {*} objValue The destination value.
  6440. * @param {*} srcValue The source value.
  6441. * @param {string} key The key of the property to merge.
  6442. * @param {Object} object The parent object of `objValue`.
  6443. * @param {Object} source The parent object of `srcValue`.
  6444. * @param {Object} [stack] Tracks traversed source values and their merged
  6445. * counterparts.
  6446. * @returns {*} Returns the value to assign.
  6447. */
  6448. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6449. if (isObject(objValue) && isObject(srcValue)) {
  6450. // Recursively merge objects and arrays (susceptible to call stack limits).
  6451. stack.set(srcValue, objValue);
  6452. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6453. stack['delete'](srcValue);
  6454. }
  6455. return objValue;
  6456. }
  6457. /**
  6458. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6459. * objects.
  6460. *
  6461. * @private
  6462. * @param {*} value The value to inspect.
  6463. * @param {string} key The key of the property to inspect.
  6464. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6465. */
  6466. function customOmitClone(value) {
  6467. return isPlainObject(value) ? undefined : value;
  6468. }
  6469. /**
  6470. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6471. * partial deep comparisons.
  6472. *
  6473. * @private
  6474. * @param {Array} array The array to compare.
  6475. * @param {Array} other The other array to compare.
  6476. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6477. * @param {Function} customizer The function to customize comparisons.
  6478. * @param {Function} equalFunc The function to determine equivalents of values.
  6479. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6480. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6481. */
  6482. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6483. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6484. arrLength = array.length,
  6485. othLength = other.length;
  6486. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6487. return false;
  6488. }
  6489. // Check that cyclic values are equal.
  6490. var arrStacked = stack.get(array);
  6491. var othStacked = stack.get(other);
  6492. if (arrStacked && othStacked) {
  6493. return arrStacked == other && othStacked == array;
  6494. }
  6495. var index = -1,
  6496. result = true,
  6497. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6498. stack.set(array, other);
  6499. stack.set(other, array);
  6500. // Ignore non-index properties.
  6501. while (++index < arrLength) {
  6502. var arrValue = array[index],
  6503. othValue = other[index];
  6504. if (customizer) {
  6505. var compared = isPartial
  6506. ? customizer(othValue, arrValue, index, other, array, stack)
  6507. : customizer(arrValue, othValue, index, array, other, stack);
  6508. }
  6509. if (compared !== undefined) {
  6510. if (compared) {
  6511. continue;
  6512. }
  6513. result = false;
  6514. break;
  6515. }
  6516. // Recursively compare arrays (susceptible to call stack limits).
  6517. if (seen) {
  6518. if (!arraySome(other, function(othValue, othIndex) {
  6519. if (!cacheHas(seen, othIndex) &&
  6520. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6521. return seen.push(othIndex);
  6522. }
  6523. })) {
  6524. result = false;
  6525. break;
  6526. }
  6527. } else if (!(
  6528. arrValue === othValue ||
  6529. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6530. )) {
  6531. result = false;
  6532. break;
  6533. }
  6534. }
  6535. stack['delete'](array);
  6536. stack['delete'](other);
  6537. return result;
  6538. }
  6539. /**
  6540. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6541. * the same `toStringTag`.
  6542. *
  6543. * **Note:** This function only supports comparing values with tags of
  6544. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6545. *
  6546. * @private
  6547. * @param {Object} object The object to compare.
  6548. * @param {Object} other The other object to compare.
  6549. * @param {string} tag The `toStringTag` of the objects to compare.
  6550. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6551. * @param {Function} customizer The function to customize comparisons.
  6552. * @param {Function} equalFunc The function to determine equivalents of values.
  6553. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6554. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6555. */
  6556. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6557. switch (tag) {
  6558. case dataViewTag:
  6559. if ((object.byteLength != other.byteLength) ||
  6560. (object.byteOffset != other.byteOffset)) {
  6561. return false;
  6562. }
  6563. object = object.buffer;
  6564. other = other.buffer;
  6565. case arrayBufferTag:
  6566. if ((object.byteLength != other.byteLength) ||
  6567. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6568. return false;
  6569. }
  6570. return true;
  6571. case boolTag:
  6572. case dateTag:
  6573. case numberTag:
  6574. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6575. // Invalid dates are coerced to `NaN`.
  6576. return eq(+object, +other);
  6577. case errorTag:
  6578. return object.name == other.name && object.message == other.message;
  6579. case regexpTag:
  6580. case stringTag:
  6581. // Coerce regexes to strings and treat strings, primitives and objects,
  6582. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6583. // for more details.
  6584. return object == (other + '');
  6585. case mapTag:
  6586. var convert = mapToArray;
  6587. case setTag:
  6588. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6589. convert || (convert = setToArray);
  6590. if (object.size != other.size && !isPartial) {
  6591. return false;
  6592. }
  6593. // Assume cyclic values are equal.
  6594. var stacked = stack.get(object);
  6595. if (stacked) {
  6596. return stacked == other;
  6597. }
  6598. bitmask |= COMPARE_UNORDERED_FLAG;
  6599. // Recursively compare objects (susceptible to call stack limits).
  6600. stack.set(object, other);
  6601. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6602. stack['delete'](object);
  6603. return result;
  6604. case symbolTag:
  6605. if (symbolValueOf) {
  6606. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6607. }
  6608. }
  6609. return false;
  6610. }
  6611. /**
  6612. * A specialized version of `baseIsEqualDeep` for objects with support for
  6613. * partial deep comparisons.
  6614. *
  6615. * @private
  6616. * @param {Object} object The object to compare.
  6617. * @param {Object} other The other object to compare.
  6618. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6619. * @param {Function} customizer The function to customize comparisons.
  6620. * @param {Function} equalFunc The function to determine equivalents of values.
  6621. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6622. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6623. */
  6624. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6625. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6626. objProps = getAllKeys(object),
  6627. objLength = objProps.length,
  6628. othProps = getAllKeys(other),
  6629. othLength = othProps.length;
  6630. if (objLength != othLength && !isPartial) {
  6631. return false;
  6632. }
  6633. var index = objLength;
  6634. while (index--) {
  6635. var key = objProps[index];
  6636. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6637. return false;
  6638. }
  6639. }
  6640. // Check that cyclic values are equal.
  6641. var objStacked = stack.get(object);
  6642. var othStacked = stack.get(other);
  6643. if (objStacked && othStacked) {
  6644. return objStacked == other && othStacked == object;
  6645. }
  6646. var result = true;
  6647. stack.set(object, other);
  6648. stack.set(other, object);
  6649. var skipCtor = isPartial;
  6650. while (++index < objLength) {
  6651. key = objProps[index];
  6652. var objValue = object[key],
  6653. othValue = other[key];
  6654. if (customizer) {
  6655. var compared = isPartial
  6656. ? customizer(othValue, objValue, key, other, object, stack)
  6657. : customizer(objValue, othValue, key, object, other, stack);
  6658. }
  6659. // Recursively compare objects (susceptible to call stack limits).
  6660. if (!(compared === undefined
  6661. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6662. : compared
  6663. )) {
  6664. result = false;
  6665. break;
  6666. }
  6667. skipCtor || (skipCtor = key == 'constructor');
  6668. }
  6669. if (result && !skipCtor) {
  6670. var objCtor = object.constructor,
  6671. othCtor = other.constructor;
  6672. // Non `Object` object instances with different constructors are not equal.
  6673. if (objCtor != othCtor &&
  6674. ('constructor' in object && 'constructor' in other) &&
  6675. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6676. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6677. result = false;
  6678. }
  6679. }
  6680. stack['delete'](object);
  6681. stack['delete'](other);
  6682. return result;
  6683. }
  6684. /**
  6685. * A specialized version of `baseRest` which flattens the rest array.
  6686. *
  6687. * @private
  6688. * @param {Function} func The function to apply a rest parameter to.
  6689. * @returns {Function} Returns the new function.
  6690. */
  6691. function flatRest(func) {
  6692. return setToString(overRest(func, undefined, flatten), func + '');
  6693. }
  6694. /**
  6695. * Creates an array of own enumerable property names and symbols of `object`.
  6696. *
  6697. * @private
  6698. * @param {Object} object The object to query.
  6699. * @returns {Array} Returns the array of property names and symbols.
  6700. */
  6701. function getAllKeys(object) {
  6702. return baseGetAllKeys(object, keys, getSymbols);
  6703. }
  6704. /**
  6705. * Creates an array of own and inherited enumerable property names and
  6706. * symbols of `object`.
  6707. *
  6708. * @private
  6709. * @param {Object} object The object to query.
  6710. * @returns {Array} Returns the array of property names and symbols.
  6711. */
  6712. function getAllKeysIn(object) {
  6713. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6714. }
  6715. /**
  6716. * Gets metadata for `func`.
  6717. *
  6718. * @private
  6719. * @param {Function} func The function to query.
  6720. * @returns {*} Returns the metadata for `func`.
  6721. */
  6722. var getData = !metaMap ? noop : function(func) {
  6723. return metaMap.get(func);
  6724. };
  6725. /**
  6726. * Gets the name of `func`.
  6727. *
  6728. * @private
  6729. * @param {Function} func The function to query.
  6730. * @returns {string} Returns the function name.
  6731. */
  6732. function getFuncName(func) {
  6733. var result = (func.name + ''),
  6734. array = realNames[result],
  6735. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6736. while (length--) {
  6737. var data = array[length],
  6738. otherFunc = data.func;
  6739. if (otherFunc == null || otherFunc == func) {
  6740. return data.name;
  6741. }
  6742. }
  6743. return result;
  6744. }
  6745. /**
  6746. * Gets the argument placeholder value for `func`.
  6747. *
  6748. * @private
  6749. * @param {Function} func The function to inspect.
  6750. * @returns {*} Returns the placeholder value.
  6751. */
  6752. function getHolder(func) {
  6753. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6754. return object.placeholder;
  6755. }
  6756. /**
  6757. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6758. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6759. * If arguments are provided, the chosen function is invoked with them and
  6760. * its result is returned.
  6761. *
  6762. * @private
  6763. * @param {*} [value] The value to convert to an iteratee.
  6764. * @param {number} [arity] The arity of the created iteratee.
  6765. * @returns {Function} Returns the chosen function or its result.
  6766. */
  6767. function getIteratee() {
  6768. var result = lodash.iteratee || iteratee;
  6769. result = result === iteratee ? baseIteratee : result;
  6770. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6771. }
  6772. /**
  6773. * Gets the data for `map`.
  6774. *
  6775. * @private
  6776. * @param {Object} map The map to query.
  6777. * @param {string} key The reference key.
  6778. * @returns {*} Returns the map data.
  6779. */
  6780. function getMapData(map, key) {
  6781. var data = map.__data__;
  6782. return isKeyable(key)
  6783. ? data[typeof key == 'string' ? 'string' : 'hash']
  6784. : data.map;
  6785. }
  6786. /**
  6787. * Gets the property names, values, and compare flags of `object`.
  6788. *
  6789. * @private
  6790. * @param {Object} object The object to query.
  6791. * @returns {Array} Returns the match data of `object`.
  6792. */
  6793. function getMatchData(object) {
  6794. var result = keys(object),
  6795. length = result.length;
  6796. while (length--) {
  6797. var key = result[length],
  6798. value = object[key];
  6799. result[length] = [key, value, isStrictComparable(value)];
  6800. }
  6801. return result;
  6802. }
  6803. /**
  6804. * Gets the native function at `key` of `object`.
  6805. *
  6806. * @private
  6807. * @param {Object} object The object to query.
  6808. * @param {string} key The key of the method to get.
  6809. * @returns {*} Returns the function if it's native, else `undefined`.
  6810. */
  6811. function getNative(object, key) {
  6812. var value = getValue(object, key);
  6813. return baseIsNative(value) ? value : undefined;
  6814. }
  6815. /**
  6816. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6817. *
  6818. * @private
  6819. * @param {*} value The value to query.
  6820. * @returns {string} Returns the raw `toStringTag`.
  6821. */
  6822. function getRawTag(value) {
  6823. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6824. tag = value[symToStringTag];
  6825. try {
  6826. value[symToStringTag] = undefined;
  6827. var unmasked = true;
  6828. } catch (e) {}
  6829. var result = nativeObjectToString.call(value);
  6830. if (unmasked) {
  6831. if (isOwn) {
  6832. value[symToStringTag] = tag;
  6833. } else {
  6834. delete value[symToStringTag];
  6835. }
  6836. }
  6837. return result;
  6838. }
  6839. /**
  6840. * Creates an array of the own enumerable symbols of `object`.
  6841. *
  6842. * @private
  6843. * @param {Object} object The object to query.
  6844. * @returns {Array} Returns the array of symbols.
  6845. */
  6846. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6847. if (object == null) {
  6848. return [];
  6849. }
  6850. object = Object(object);
  6851. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6852. return propertyIsEnumerable.call(object, symbol);
  6853. });
  6854. };
  6855. /**
  6856. * Creates an array of the own and inherited enumerable symbols of `object`.
  6857. *
  6858. * @private
  6859. * @param {Object} object The object to query.
  6860. * @returns {Array} Returns the array of symbols.
  6861. */
  6862. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6863. var result = [];
  6864. while (object) {
  6865. arrayPush(result, getSymbols(object));
  6866. object = getPrototype(object);
  6867. }
  6868. return result;
  6869. };
  6870. /**
  6871. * Gets the `toStringTag` of `value`.
  6872. *
  6873. * @private
  6874. * @param {*} value The value to query.
  6875. * @returns {string} Returns the `toStringTag`.
  6876. */
  6877. var getTag = baseGetTag;
  6878. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6879. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6880. (Map && getTag(new Map) != mapTag) ||
  6881. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6882. (Set && getTag(new Set) != setTag) ||
  6883. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6884. getTag = function(value) {
  6885. var result = baseGetTag(value),
  6886. Ctor = result == objectTag ? value.constructor : undefined,
  6887. ctorString = Ctor ? toSource(Ctor) : '';
  6888. if (ctorString) {
  6889. switch (ctorString) {
  6890. case dataViewCtorString: return dataViewTag;
  6891. case mapCtorString: return mapTag;
  6892. case promiseCtorString: return promiseTag;
  6893. case setCtorString: return setTag;
  6894. case weakMapCtorString: return weakMapTag;
  6895. }
  6896. }
  6897. return result;
  6898. };
  6899. }
  6900. /**
  6901. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6902. *
  6903. * @private
  6904. * @param {number} start The start of the view.
  6905. * @param {number} end The end of the view.
  6906. * @param {Array} transforms The transformations to apply to the view.
  6907. * @returns {Object} Returns an object containing the `start` and `end`
  6908. * positions of the view.
  6909. */
  6910. function getView(start, end, transforms) {
  6911. var index = -1,
  6912. length = transforms.length;
  6913. while (++index < length) {
  6914. var data = transforms[index],
  6915. size = data.size;
  6916. switch (data.type) {
  6917. case 'drop': start += size; break;
  6918. case 'dropRight': end -= size; break;
  6919. case 'take': end = nativeMin(end, start + size); break;
  6920. case 'takeRight': start = nativeMax(start, end - size); break;
  6921. }
  6922. }
  6923. return { 'start': start, 'end': end };
  6924. }
  6925. /**
  6926. * Extracts wrapper details from the `source` body comment.
  6927. *
  6928. * @private
  6929. * @param {string} source The source to inspect.
  6930. * @returns {Array} Returns the wrapper details.
  6931. */
  6932. function getWrapDetails(source) {
  6933. var match = source.match(reWrapDetails);
  6934. return match ? match[1].split(reSplitDetails) : [];
  6935. }
  6936. /**
  6937. * Checks if `path` exists on `object`.
  6938. *
  6939. * @private
  6940. * @param {Object} object The object to query.
  6941. * @param {Array|string} path The path to check.
  6942. * @param {Function} hasFunc The function to check properties.
  6943. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6944. */
  6945. function hasPath(object, path, hasFunc) {
  6946. path = castPath(path, object);
  6947. var index = -1,
  6948. length = path.length,
  6949. result = false;
  6950. while (++index < length) {
  6951. var key = toKey(path[index]);
  6952. if (!(result = object != null && hasFunc(object, key))) {
  6953. break;
  6954. }
  6955. object = object[key];
  6956. }
  6957. if (result || ++index != length) {
  6958. return result;
  6959. }
  6960. length = object == null ? 0 : object.length;
  6961. return !!length && isLength(length) && isIndex(key, length) &&
  6962. (isArray(object) || isArguments(object));
  6963. }
  6964. /**
  6965. * Initializes an array clone.
  6966. *
  6967. * @private
  6968. * @param {Array} array The array to clone.
  6969. * @returns {Array} Returns the initialized clone.
  6970. */
  6971. function initCloneArray(array) {
  6972. var length = array.length,
  6973. result = new array.constructor(length);
  6974. // Add properties assigned by `RegExp#exec`.
  6975. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6976. result.index = array.index;
  6977. result.input = array.input;
  6978. }
  6979. return result;
  6980. }
  6981. /**
  6982. * Initializes an object clone.
  6983. *
  6984. * @private
  6985. * @param {Object} object The object to clone.
  6986. * @returns {Object} Returns the initialized clone.
  6987. */
  6988. function initCloneObject(object) {
  6989. return (typeof object.constructor == 'function' && !isPrototype(object))
  6990. ? baseCreate(getPrototype(object))
  6991. : {};
  6992. }
  6993. /**
  6994. * Initializes an object clone based on its `toStringTag`.
  6995. *
  6996. * **Note:** This function only supports cloning values with tags of
  6997. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6998. *
  6999. * @private
  7000. * @param {Object} object The object to clone.
  7001. * @param {string} tag The `toStringTag` of the object to clone.
  7002. * @param {boolean} [isDeep] Specify a deep clone.
  7003. * @returns {Object} Returns the initialized clone.
  7004. */
  7005. function initCloneByTag(object, tag, isDeep) {
  7006. var Ctor = object.constructor;
  7007. switch (tag) {
  7008. case arrayBufferTag:
  7009. return cloneArrayBuffer(object);
  7010. case boolTag:
  7011. case dateTag:
  7012. return new Ctor(+object);
  7013. case dataViewTag:
  7014. return cloneDataView(object, isDeep);
  7015. case float32Tag: case float64Tag:
  7016. case int8Tag: case int16Tag: case int32Tag:
  7017. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7018. return cloneTypedArray(object, isDeep);
  7019. case mapTag:
  7020. return new Ctor;
  7021. case numberTag:
  7022. case stringTag:
  7023. return new Ctor(object);
  7024. case regexpTag:
  7025. return cloneRegExp(object);
  7026. case setTag:
  7027. return new Ctor;
  7028. case symbolTag:
  7029. return cloneSymbol(object);
  7030. }
  7031. }
  7032. /**
  7033. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7034. *
  7035. * @private
  7036. * @param {string} source The source to modify.
  7037. * @returns {Array} details The details to insert.
  7038. * @returns {string} Returns the modified source.
  7039. */
  7040. function insertWrapDetails(source, details) {
  7041. var length = details.length;
  7042. if (!length) {
  7043. return source;
  7044. }
  7045. var lastIndex = length - 1;
  7046. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7047. details = details.join(length > 2 ? ', ' : ' ');
  7048. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7049. }
  7050. /**
  7051. * Checks if `value` is a flattenable `arguments` object or array.
  7052. *
  7053. * @private
  7054. * @param {*} value The value to check.
  7055. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7056. */
  7057. function isFlattenable(value) {
  7058. return isArray(value) || isArguments(value) ||
  7059. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7060. }
  7061. /**
  7062. * Checks if `value` is a valid array-like index.
  7063. *
  7064. * @private
  7065. * @param {*} value The value to check.
  7066. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7067. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7068. */
  7069. function isIndex(value, length) {
  7070. var type = typeof value;
  7071. length = length == null ? MAX_SAFE_INTEGER : length;
  7072. return !!length &&
  7073. (type == 'number' ||
  7074. (type != 'symbol' && reIsUint.test(value))) &&
  7075. (value > -1 && value % 1 == 0 && value < length);
  7076. }
  7077. /**
  7078. * Checks if the given arguments are from an iteratee call.
  7079. *
  7080. * @private
  7081. * @param {*} value The potential iteratee value argument.
  7082. * @param {*} index The potential iteratee index or key argument.
  7083. * @param {*} object The potential iteratee object argument.
  7084. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7085. * else `false`.
  7086. */
  7087. function isIterateeCall(value, index, object) {
  7088. if (!isObject(object)) {
  7089. return false;
  7090. }
  7091. var type = typeof index;
  7092. if (type == 'number'
  7093. ? (isArrayLike(object) && isIndex(index, object.length))
  7094. : (type == 'string' && index in object)
  7095. ) {
  7096. return eq(object[index], value);
  7097. }
  7098. return false;
  7099. }
  7100. /**
  7101. * Checks if `value` is a property name and not a property path.
  7102. *
  7103. * @private
  7104. * @param {*} value The value to check.
  7105. * @param {Object} [object] The object to query keys on.
  7106. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7107. */
  7108. function isKey(value, object) {
  7109. if (isArray(value)) {
  7110. return false;
  7111. }
  7112. var type = typeof value;
  7113. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7114. value == null || isSymbol(value)) {
  7115. return true;
  7116. }
  7117. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7118. (object != null && value in Object(object));
  7119. }
  7120. /**
  7121. * Checks if `value` is suitable for use as unique object key.
  7122. *
  7123. * @private
  7124. * @param {*} value The value to check.
  7125. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7126. */
  7127. function isKeyable(value) {
  7128. var type = typeof value;
  7129. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7130. ? (value !== '__proto__')
  7131. : (value === null);
  7132. }
  7133. /**
  7134. * Checks if `func` has a lazy counterpart.
  7135. *
  7136. * @private
  7137. * @param {Function} func The function to check.
  7138. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7139. * else `false`.
  7140. */
  7141. function isLaziable(func) {
  7142. var funcName = getFuncName(func),
  7143. other = lodash[funcName];
  7144. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7145. return false;
  7146. }
  7147. if (func === other) {
  7148. return true;
  7149. }
  7150. var data = getData(other);
  7151. return !!data && func === data[0];
  7152. }
  7153. /**
  7154. * Checks if `func` has its source masked.
  7155. *
  7156. * @private
  7157. * @param {Function} func The function to check.
  7158. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7159. */
  7160. function isMasked(func) {
  7161. return !!maskSrcKey && (maskSrcKey in func);
  7162. }
  7163. /**
  7164. * Checks if `func` is capable of being masked.
  7165. *
  7166. * @private
  7167. * @param {*} value The value to check.
  7168. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7169. */
  7170. var isMaskable = coreJsData ? isFunction : stubFalse;
  7171. /**
  7172. * Checks if `value` is likely a prototype object.
  7173. *
  7174. * @private
  7175. * @param {*} value The value to check.
  7176. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7177. */
  7178. function isPrototype(value) {
  7179. var Ctor = value && value.constructor,
  7180. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7181. return value === proto;
  7182. }
  7183. /**
  7184. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7185. *
  7186. * @private
  7187. * @param {*} value The value to check.
  7188. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7189. * equality comparisons, else `false`.
  7190. */
  7191. function isStrictComparable(value) {
  7192. return value === value && !isObject(value);
  7193. }
  7194. /**
  7195. * A specialized version of `matchesProperty` for source values suitable
  7196. * for strict equality comparisons, i.e. `===`.
  7197. *
  7198. * @private
  7199. * @param {string} key The key of the property to get.
  7200. * @param {*} srcValue The value to match.
  7201. * @returns {Function} Returns the new spec function.
  7202. */
  7203. function matchesStrictComparable(key, srcValue) {
  7204. return function(object) {
  7205. if (object == null) {
  7206. return false;
  7207. }
  7208. return object[key] === srcValue &&
  7209. (srcValue !== undefined || (key in Object(object)));
  7210. };
  7211. }
  7212. /**
  7213. * A specialized version of `_.memoize` which clears the memoized function's
  7214. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7215. *
  7216. * @private
  7217. * @param {Function} func The function to have its output memoized.
  7218. * @returns {Function} Returns the new memoized function.
  7219. */
  7220. function memoizeCapped(func) {
  7221. var result = memoize(func, function(key) {
  7222. if (cache.size === MAX_MEMOIZE_SIZE) {
  7223. cache.clear();
  7224. }
  7225. return key;
  7226. });
  7227. var cache = result.cache;
  7228. return result;
  7229. }
  7230. /**
  7231. * Merges the function metadata of `source` into `data`.
  7232. *
  7233. * Merging metadata reduces the number of wrappers used to invoke a function.
  7234. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7235. * may be applied regardless of execution order. Methods like `_.ary` and
  7236. * `_.rearg` modify function arguments, making the order in which they are
  7237. * executed important, preventing the merging of metadata. However, we make
  7238. * an exception for a safe combined case where curried functions have `_.ary`
  7239. * and or `_.rearg` applied.
  7240. *
  7241. * @private
  7242. * @param {Array} data The destination metadata.
  7243. * @param {Array} source The source metadata.
  7244. * @returns {Array} Returns `data`.
  7245. */
  7246. function mergeData(data, source) {
  7247. var bitmask = data[1],
  7248. srcBitmask = source[1],
  7249. newBitmask = bitmask | srcBitmask,
  7250. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7251. var isCombo =
  7252. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7253. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7254. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7255. // Exit early if metadata can't be merged.
  7256. if (!(isCommon || isCombo)) {
  7257. return data;
  7258. }
  7259. // Use source `thisArg` if available.
  7260. if (srcBitmask & WRAP_BIND_FLAG) {
  7261. data[2] = source[2];
  7262. // Set when currying a bound function.
  7263. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7264. }
  7265. // Compose partial arguments.
  7266. var value = source[3];
  7267. if (value) {
  7268. var partials = data[3];
  7269. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7270. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7271. }
  7272. // Compose partial right arguments.
  7273. value = source[5];
  7274. if (value) {
  7275. partials = data[5];
  7276. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7277. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7278. }
  7279. // Use source `argPos` if available.
  7280. value = source[7];
  7281. if (value) {
  7282. data[7] = value;
  7283. }
  7284. // Use source `ary` if it's smaller.
  7285. if (srcBitmask & WRAP_ARY_FLAG) {
  7286. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7287. }
  7288. // Use source `arity` if one is not provided.
  7289. if (data[9] == null) {
  7290. data[9] = source[9];
  7291. }
  7292. // Use source `func` and merge bitmasks.
  7293. data[0] = source[0];
  7294. data[1] = newBitmask;
  7295. return data;
  7296. }
  7297. /**
  7298. * This function is like
  7299. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7300. * except that it includes inherited enumerable properties.
  7301. *
  7302. * @private
  7303. * @param {Object} object The object to query.
  7304. * @returns {Array} Returns the array of property names.
  7305. */
  7306. function nativeKeysIn(object) {
  7307. var result = [];
  7308. if (object != null) {
  7309. for (var key in Object(object)) {
  7310. result.push(key);
  7311. }
  7312. }
  7313. return result;
  7314. }
  7315. /**
  7316. * Converts `value` to a string using `Object.prototype.toString`.
  7317. *
  7318. * @private
  7319. * @param {*} value The value to convert.
  7320. * @returns {string} Returns the converted string.
  7321. */
  7322. function objectToString(value) {
  7323. return nativeObjectToString.call(value);
  7324. }
  7325. /**
  7326. * A specialized version of `baseRest` which transforms the rest array.
  7327. *
  7328. * @private
  7329. * @param {Function} func The function to apply a rest parameter to.
  7330. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7331. * @param {Function} transform The rest array transform.
  7332. * @returns {Function} Returns the new function.
  7333. */
  7334. function overRest(func, start, transform) {
  7335. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7336. return function() {
  7337. var args = arguments,
  7338. index = -1,
  7339. length = nativeMax(args.length - start, 0),
  7340. array = Array(length);
  7341. while (++index < length) {
  7342. array[index] = args[start + index];
  7343. }
  7344. index = -1;
  7345. var otherArgs = Array(start + 1);
  7346. while (++index < start) {
  7347. otherArgs[index] = args[index];
  7348. }
  7349. otherArgs[start] = transform(array);
  7350. return apply(func, this, otherArgs);
  7351. };
  7352. }
  7353. /**
  7354. * Gets the parent value at `path` of `object`.
  7355. *
  7356. * @private
  7357. * @param {Object} object The object to query.
  7358. * @param {Array} path The path to get the parent value of.
  7359. * @returns {*} Returns the parent value.
  7360. */
  7361. function parent(object, path) {
  7362. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7363. }
  7364. /**
  7365. * Reorder `array` according to the specified indexes where the element at
  7366. * the first index is assigned as the first element, the element at
  7367. * the second index is assigned as the second element, and so on.
  7368. *
  7369. * @private
  7370. * @param {Array} array The array to reorder.
  7371. * @param {Array} indexes The arranged array indexes.
  7372. * @returns {Array} Returns `array`.
  7373. */
  7374. function reorder(array, indexes) {
  7375. var arrLength = array.length,
  7376. length = nativeMin(indexes.length, arrLength),
  7377. oldArray = copyArray(array);
  7378. while (length--) {
  7379. var index = indexes[length];
  7380. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7381. }
  7382. return array;
  7383. }
  7384. /**
  7385. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7386. *
  7387. * @private
  7388. * @param {Object} object The object to query.
  7389. * @param {string} key The key of the property to get.
  7390. * @returns {*} Returns the property value.
  7391. */
  7392. function safeGet(object, key) {
  7393. if (key === 'constructor' && typeof object[key] === 'function') {
  7394. return;
  7395. }
  7396. if (key == '__proto__') {
  7397. return;
  7398. }
  7399. return object[key];
  7400. }
  7401. /**
  7402. * Sets metadata for `func`.
  7403. *
  7404. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7405. * period of time, it will trip its breaker and transition to an identity
  7406. * function to avoid garbage collection pauses in V8. See
  7407. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7408. * for more details.
  7409. *
  7410. * @private
  7411. * @param {Function} func The function to associate metadata with.
  7412. * @param {*} data The metadata.
  7413. * @returns {Function} Returns `func`.
  7414. */
  7415. var setData = shortOut(baseSetData);
  7416. /**
  7417. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7418. *
  7419. * @private
  7420. * @param {Function} func The function to delay.
  7421. * @param {number} wait The number of milliseconds to delay invocation.
  7422. * @returns {number|Object} Returns the timer id or timeout object.
  7423. */
  7424. var setTimeout = ctxSetTimeout || function(func, wait) {
  7425. return root.setTimeout(func, wait);
  7426. };
  7427. /**
  7428. * Sets the `toString` method of `func` to return `string`.
  7429. *
  7430. * @private
  7431. * @param {Function} func The function to modify.
  7432. * @param {Function} string The `toString` result.
  7433. * @returns {Function} Returns `func`.
  7434. */
  7435. var setToString = shortOut(baseSetToString);
  7436. /**
  7437. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7438. * with wrapper details in a comment at the top of the source body.
  7439. *
  7440. * @private
  7441. * @param {Function} wrapper The function to modify.
  7442. * @param {Function} reference The reference function.
  7443. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7444. * @returns {Function} Returns `wrapper`.
  7445. */
  7446. function setWrapToString(wrapper, reference, bitmask) {
  7447. var source = (reference + '');
  7448. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7449. }
  7450. /**
  7451. * Creates a function that'll short out and invoke `identity` instead
  7452. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7453. * milliseconds.
  7454. *
  7455. * @private
  7456. * @param {Function} func The function to restrict.
  7457. * @returns {Function} Returns the new shortable function.
  7458. */
  7459. function shortOut(func) {
  7460. var count = 0,
  7461. lastCalled = 0;
  7462. return function() {
  7463. var stamp = nativeNow(),
  7464. remaining = HOT_SPAN - (stamp - lastCalled);
  7465. lastCalled = stamp;
  7466. if (remaining > 0) {
  7467. if (++count >= HOT_COUNT) {
  7468. return arguments[0];
  7469. }
  7470. } else {
  7471. count = 0;
  7472. }
  7473. return func.apply(undefined, arguments);
  7474. };
  7475. }
  7476. /**
  7477. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7478. *
  7479. * @private
  7480. * @param {Array} array The array to shuffle.
  7481. * @param {number} [size=array.length] The size of `array`.
  7482. * @returns {Array} Returns `array`.
  7483. */
  7484. function shuffleSelf(array, size) {
  7485. var index = -1,
  7486. length = array.length,
  7487. lastIndex = length - 1;
  7488. size = size === undefined ? length : size;
  7489. while (++index < size) {
  7490. var rand = baseRandom(index, lastIndex),
  7491. value = array[rand];
  7492. array[rand] = array[index];
  7493. array[index] = value;
  7494. }
  7495. array.length = size;
  7496. return array;
  7497. }
  7498. /**
  7499. * Converts `string` to a property path array.
  7500. *
  7501. * @private
  7502. * @param {string} string The string to convert.
  7503. * @returns {Array} Returns the property path array.
  7504. */
  7505. var stringToPath = memoizeCapped(function(string) {
  7506. var result = [];
  7507. if (string.charCodeAt(0) === 46 /* . */) {
  7508. result.push('');
  7509. }
  7510. string.replace(rePropName, function(match, number, quote, subString) {
  7511. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7512. });
  7513. return result;
  7514. });
  7515. /**
  7516. * Converts `value` to a string key if it's not a string or symbol.
  7517. *
  7518. * @private
  7519. * @param {*} value The value to inspect.
  7520. * @returns {string|symbol} Returns the key.
  7521. */
  7522. function toKey(value) {
  7523. if (typeof value == 'string' || isSymbol(value)) {
  7524. return value;
  7525. }
  7526. var result = (value + '');
  7527. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7528. }
  7529. /**
  7530. * Converts `func` to its source code.
  7531. *
  7532. * @private
  7533. * @param {Function} func The function to convert.
  7534. * @returns {string} Returns the source code.
  7535. */
  7536. function toSource(func) {
  7537. if (func != null) {
  7538. try {
  7539. return funcToString.call(func);
  7540. } catch (e) {}
  7541. try {
  7542. return (func + '');
  7543. } catch (e) {}
  7544. }
  7545. return '';
  7546. }
  7547. /**
  7548. * Updates wrapper `details` based on `bitmask` flags.
  7549. *
  7550. * @private
  7551. * @returns {Array} details The details to modify.
  7552. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7553. * @returns {Array} Returns `details`.
  7554. */
  7555. function updateWrapDetails(details, bitmask) {
  7556. arrayEach(wrapFlags, function(pair) {
  7557. var value = '_.' + pair[0];
  7558. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7559. details.push(value);
  7560. }
  7561. });
  7562. return details.sort();
  7563. }
  7564. /**
  7565. * Creates a clone of `wrapper`.
  7566. *
  7567. * @private
  7568. * @param {Object} wrapper The wrapper to clone.
  7569. * @returns {Object} Returns the cloned wrapper.
  7570. */
  7571. function wrapperClone(wrapper) {
  7572. if (wrapper instanceof LazyWrapper) {
  7573. return wrapper.clone();
  7574. }
  7575. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7576. result.__actions__ = copyArray(wrapper.__actions__);
  7577. result.__index__ = wrapper.__index__;
  7578. result.__values__ = wrapper.__values__;
  7579. return result;
  7580. }
  7581. /*------------------------------------------------------------------------*/
  7582. /**
  7583. * Creates an array of elements split into groups the length of `size`.
  7584. * If `array` can't be split evenly, the final chunk will be the remaining
  7585. * elements.
  7586. *
  7587. * @static
  7588. * @memberOf _
  7589. * @since 3.0.0
  7590. * @category Array
  7591. * @param {Array} array The array to process.
  7592. * @param {number} [size=1] The length of each chunk
  7593. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7594. * @returns {Array} Returns the new array of chunks.
  7595. * @example
  7596. *
  7597. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7598. * // => [['a', 'b'], ['c', 'd']]
  7599. *
  7600. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7601. * // => [['a', 'b', 'c'], ['d']]
  7602. */
  7603. function chunk(array, size, guard) {
  7604. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7605. size = 1;
  7606. } else {
  7607. size = nativeMax(toInteger(size), 0);
  7608. }
  7609. var length = array == null ? 0 : array.length;
  7610. if (!length || size < 1) {
  7611. return [];
  7612. }
  7613. var index = 0,
  7614. resIndex = 0,
  7615. result = Array(nativeCeil(length / size));
  7616. while (index < length) {
  7617. result[resIndex++] = baseSlice(array, index, (index += size));
  7618. }
  7619. return result;
  7620. }
  7621. /**
  7622. * Creates an array with all falsey values removed. The values `false`, `null`,
  7623. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7624. *
  7625. * @static
  7626. * @memberOf _
  7627. * @since 0.1.0
  7628. * @category Array
  7629. * @param {Array} array The array to compact.
  7630. * @returns {Array} Returns the new array of filtered values.
  7631. * @example
  7632. *
  7633. * _.compact([0, 1, false, 2, '', 3]);
  7634. * // => [1, 2, 3]
  7635. */
  7636. function compact(array) {
  7637. var index = -1,
  7638. length = array == null ? 0 : array.length,
  7639. resIndex = 0,
  7640. result = [];
  7641. while (++index < length) {
  7642. var value = array[index];
  7643. if (value) {
  7644. result[resIndex++] = value;
  7645. }
  7646. }
  7647. return result;
  7648. }
  7649. /**
  7650. * Creates a new array concatenating `array` with any additional arrays
  7651. * and/or values.
  7652. *
  7653. * @static
  7654. * @memberOf _
  7655. * @since 4.0.0
  7656. * @category Array
  7657. * @param {Array} array The array to concatenate.
  7658. * @param {...*} [values] The values to concatenate.
  7659. * @returns {Array} Returns the new concatenated array.
  7660. * @example
  7661. *
  7662. * var array = [1];
  7663. * var other = _.concat(array, 2, [3], [[4]]);
  7664. *
  7665. * console.log(other);
  7666. * // => [1, 2, 3, [4]]
  7667. *
  7668. * console.log(array);
  7669. * // => [1]
  7670. */
  7671. function concat() {
  7672. var length = arguments.length;
  7673. if (!length) {
  7674. return [];
  7675. }
  7676. var args = Array(length - 1),
  7677. array = arguments[0],
  7678. index = length;
  7679. while (index--) {
  7680. args[index - 1] = arguments[index];
  7681. }
  7682. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7683. }
  7684. /**
  7685. * Creates an array of `array` values not included in the other given arrays
  7686. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7687. * for equality comparisons. The order and references of result values are
  7688. * determined by the first array.
  7689. *
  7690. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7691. *
  7692. * @static
  7693. * @memberOf _
  7694. * @since 0.1.0
  7695. * @category Array
  7696. * @param {Array} array The array to inspect.
  7697. * @param {...Array} [values] The values to exclude.
  7698. * @returns {Array} Returns the new array of filtered values.
  7699. * @see _.without, _.xor
  7700. * @example
  7701. *
  7702. * _.difference([2, 1], [2, 3]);
  7703. * // => [1]
  7704. */
  7705. var difference = baseRest(function(array, values) {
  7706. return isArrayLikeObject(array)
  7707. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7708. : [];
  7709. });
  7710. /**
  7711. * This method is like `_.difference` except that it accepts `iteratee` which
  7712. * is invoked for each element of `array` and `values` to generate the criterion
  7713. * by which they're compared. The order and references of result values are
  7714. * determined by the first array. The iteratee is invoked with one argument:
  7715. * (value).
  7716. *
  7717. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7718. *
  7719. * @static
  7720. * @memberOf _
  7721. * @since 4.0.0
  7722. * @category Array
  7723. * @param {Array} array The array to inspect.
  7724. * @param {...Array} [values] The values to exclude.
  7725. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7726. * @returns {Array} Returns the new array of filtered values.
  7727. * @example
  7728. *
  7729. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7730. * // => [1.2]
  7731. *
  7732. * // The `_.property` iteratee shorthand.
  7733. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7734. * // => [{ 'x': 2 }]
  7735. */
  7736. var differenceBy = baseRest(function(array, values) {
  7737. var iteratee = last(values);
  7738. if (isArrayLikeObject(iteratee)) {
  7739. iteratee = undefined;
  7740. }
  7741. return isArrayLikeObject(array)
  7742. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7743. : [];
  7744. });
  7745. /**
  7746. * This method is like `_.difference` except that it accepts `comparator`
  7747. * which is invoked to compare elements of `array` to `values`. The order and
  7748. * references of result values are determined by the first array. The comparator
  7749. * is invoked with two arguments: (arrVal, othVal).
  7750. *
  7751. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7752. *
  7753. * @static
  7754. * @memberOf _
  7755. * @since 4.0.0
  7756. * @category Array
  7757. * @param {Array} array The array to inspect.
  7758. * @param {...Array} [values] The values to exclude.
  7759. * @param {Function} [comparator] The comparator invoked per element.
  7760. * @returns {Array} Returns the new array of filtered values.
  7761. * @example
  7762. *
  7763. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7764. *
  7765. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7766. * // => [{ 'x': 2, 'y': 1 }]
  7767. */
  7768. var differenceWith = baseRest(function(array, values) {
  7769. var comparator = last(values);
  7770. if (isArrayLikeObject(comparator)) {
  7771. comparator = undefined;
  7772. }
  7773. return isArrayLikeObject(array)
  7774. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7775. : [];
  7776. });
  7777. /**
  7778. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7779. *
  7780. * @static
  7781. * @memberOf _
  7782. * @since 0.5.0
  7783. * @category Array
  7784. * @param {Array} array The array to query.
  7785. * @param {number} [n=1] The number of elements to drop.
  7786. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7787. * @returns {Array} Returns the slice of `array`.
  7788. * @example
  7789. *
  7790. * _.drop([1, 2, 3]);
  7791. * // => [2, 3]
  7792. *
  7793. * _.drop([1, 2, 3], 2);
  7794. * // => [3]
  7795. *
  7796. * _.drop([1, 2, 3], 5);
  7797. * // => []
  7798. *
  7799. * _.drop([1, 2, 3], 0);
  7800. * // => [1, 2, 3]
  7801. */
  7802. function drop(array, n, guard) {
  7803. var length = array == null ? 0 : array.length;
  7804. if (!length) {
  7805. return [];
  7806. }
  7807. n = (guard || n === undefined) ? 1 : toInteger(n);
  7808. return baseSlice(array, n < 0 ? 0 : n, length);
  7809. }
  7810. /**
  7811. * Creates a slice of `array` with `n` elements dropped from the end.
  7812. *
  7813. * @static
  7814. * @memberOf _
  7815. * @since 3.0.0
  7816. * @category Array
  7817. * @param {Array} array The array to query.
  7818. * @param {number} [n=1] The number of elements to drop.
  7819. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7820. * @returns {Array} Returns the slice of `array`.
  7821. * @example
  7822. *
  7823. * _.dropRight([1, 2, 3]);
  7824. * // => [1, 2]
  7825. *
  7826. * _.dropRight([1, 2, 3], 2);
  7827. * // => [1]
  7828. *
  7829. * _.dropRight([1, 2, 3], 5);
  7830. * // => []
  7831. *
  7832. * _.dropRight([1, 2, 3], 0);
  7833. * // => [1, 2, 3]
  7834. */
  7835. function dropRight(array, n, guard) {
  7836. var length = array == null ? 0 : array.length;
  7837. if (!length) {
  7838. return [];
  7839. }
  7840. n = (guard || n === undefined) ? 1 : toInteger(n);
  7841. n = length - n;
  7842. return baseSlice(array, 0, n < 0 ? 0 : n);
  7843. }
  7844. /**
  7845. * Creates a slice of `array` excluding elements dropped from the end.
  7846. * Elements are dropped until `predicate` returns falsey. The predicate is
  7847. * invoked with three arguments: (value, index, array).
  7848. *
  7849. * @static
  7850. * @memberOf _
  7851. * @since 3.0.0
  7852. * @category Array
  7853. * @param {Array} array The array to query.
  7854. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7855. * @returns {Array} Returns the slice of `array`.
  7856. * @example
  7857. *
  7858. * var users = [
  7859. * { 'user': 'barney', 'active': true },
  7860. * { 'user': 'fred', 'active': false },
  7861. * { 'user': 'pebbles', 'active': false }
  7862. * ];
  7863. *
  7864. * _.dropRightWhile(users, function(o) { return !o.active; });
  7865. * // => objects for ['barney']
  7866. *
  7867. * // The `_.matches` iteratee shorthand.
  7868. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7869. * // => objects for ['barney', 'fred']
  7870. *
  7871. * // The `_.matchesProperty` iteratee shorthand.
  7872. * _.dropRightWhile(users, ['active', false]);
  7873. * // => objects for ['barney']
  7874. *
  7875. * // The `_.property` iteratee shorthand.
  7876. * _.dropRightWhile(users, 'active');
  7877. * // => objects for ['barney', 'fred', 'pebbles']
  7878. */
  7879. function dropRightWhile(array, predicate) {
  7880. return (array && array.length)
  7881. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7882. : [];
  7883. }
  7884. /**
  7885. * Creates a slice of `array` excluding elements dropped from the beginning.
  7886. * Elements are dropped until `predicate` returns falsey. The predicate is
  7887. * invoked with three arguments: (value, index, array).
  7888. *
  7889. * @static
  7890. * @memberOf _
  7891. * @since 3.0.0
  7892. * @category Array
  7893. * @param {Array} array The array to query.
  7894. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7895. * @returns {Array} Returns the slice of `array`.
  7896. * @example
  7897. *
  7898. * var users = [
  7899. * { 'user': 'barney', 'active': false },
  7900. * { 'user': 'fred', 'active': false },
  7901. * { 'user': 'pebbles', 'active': true }
  7902. * ];
  7903. *
  7904. * _.dropWhile(users, function(o) { return !o.active; });
  7905. * // => objects for ['pebbles']
  7906. *
  7907. * // The `_.matches` iteratee shorthand.
  7908. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7909. * // => objects for ['fred', 'pebbles']
  7910. *
  7911. * // The `_.matchesProperty` iteratee shorthand.
  7912. * _.dropWhile(users, ['active', false]);
  7913. * // => objects for ['pebbles']
  7914. *
  7915. * // The `_.property` iteratee shorthand.
  7916. * _.dropWhile(users, 'active');
  7917. * // => objects for ['barney', 'fred', 'pebbles']
  7918. */
  7919. function dropWhile(array, predicate) {
  7920. return (array && array.length)
  7921. ? baseWhile(array, getIteratee(predicate, 3), true)
  7922. : [];
  7923. }
  7924. /**
  7925. * Fills elements of `array` with `value` from `start` up to, but not
  7926. * including, `end`.
  7927. *
  7928. * **Note:** This method mutates `array`.
  7929. *
  7930. * @static
  7931. * @memberOf _
  7932. * @since 3.2.0
  7933. * @category Array
  7934. * @param {Array} array The array to fill.
  7935. * @param {*} value The value to fill `array` with.
  7936. * @param {number} [start=0] The start position.
  7937. * @param {number} [end=array.length] The end position.
  7938. * @returns {Array} Returns `array`.
  7939. * @example
  7940. *
  7941. * var array = [1, 2, 3];
  7942. *
  7943. * _.fill(array, 'a');
  7944. * console.log(array);
  7945. * // => ['a', 'a', 'a']
  7946. *
  7947. * _.fill(Array(3), 2);
  7948. * // => [2, 2, 2]
  7949. *
  7950. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7951. * // => [4, '*', '*', 10]
  7952. */
  7953. function fill(array, value, start, end) {
  7954. var length = array == null ? 0 : array.length;
  7955. if (!length) {
  7956. return [];
  7957. }
  7958. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7959. start = 0;
  7960. end = length;
  7961. }
  7962. return baseFill(array, value, start, end);
  7963. }
  7964. /**
  7965. * This method is like `_.find` except that it returns the index of the first
  7966. * element `predicate` returns truthy for instead of the element itself.
  7967. *
  7968. * @static
  7969. * @memberOf _
  7970. * @since 1.1.0
  7971. * @category Array
  7972. * @param {Array} array The array to inspect.
  7973. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7974. * @param {number} [fromIndex=0] The index to search from.
  7975. * @returns {number} Returns the index of the found element, else `-1`.
  7976. * @example
  7977. *
  7978. * var users = [
  7979. * { 'user': 'barney', 'active': false },
  7980. * { 'user': 'fred', 'active': false },
  7981. * { 'user': 'pebbles', 'active': true }
  7982. * ];
  7983. *
  7984. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7985. * // => 0
  7986. *
  7987. * // The `_.matches` iteratee shorthand.
  7988. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7989. * // => 1
  7990. *
  7991. * // The `_.matchesProperty` iteratee shorthand.
  7992. * _.findIndex(users, ['active', false]);
  7993. * // => 0
  7994. *
  7995. * // The `_.property` iteratee shorthand.
  7996. * _.findIndex(users, 'active');
  7997. * // => 2
  7998. */
  7999. function findIndex(array, predicate, fromIndex) {
  8000. var length = array == null ? 0 : array.length;
  8001. if (!length) {
  8002. return -1;
  8003. }
  8004. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8005. if (index < 0) {
  8006. index = nativeMax(length + index, 0);
  8007. }
  8008. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8009. }
  8010. /**
  8011. * This method is like `_.findIndex` except that it iterates over elements
  8012. * of `collection` from right to left.
  8013. *
  8014. * @static
  8015. * @memberOf _
  8016. * @since 2.0.0
  8017. * @category Array
  8018. * @param {Array} array The array to inspect.
  8019. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8020. * @param {number} [fromIndex=array.length-1] The index to search from.
  8021. * @returns {number} Returns the index of the found element, else `-1`.
  8022. * @example
  8023. *
  8024. * var users = [
  8025. * { 'user': 'barney', 'active': true },
  8026. * { 'user': 'fred', 'active': false },
  8027. * { 'user': 'pebbles', 'active': false }
  8028. * ];
  8029. *
  8030. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8031. * // => 2
  8032. *
  8033. * // The `_.matches` iteratee shorthand.
  8034. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8035. * // => 0
  8036. *
  8037. * // The `_.matchesProperty` iteratee shorthand.
  8038. * _.findLastIndex(users, ['active', false]);
  8039. * // => 2
  8040. *
  8041. * // The `_.property` iteratee shorthand.
  8042. * _.findLastIndex(users, 'active');
  8043. * // => 0
  8044. */
  8045. function findLastIndex(array, predicate, fromIndex) {
  8046. var length = array == null ? 0 : array.length;
  8047. if (!length) {
  8048. return -1;
  8049. }
  8050. var index = length - 1;
  8051. if (fromIndex !== undefined) {
  8052. index = toInteger(fromIndex);
  8053. index = fromIndex < 0
  8054. ? nativeMax(length + index, 0)
  8055. : nativeMin(index, length - 1);
  8056. }
  8057. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8058. }
  8059. /**
  8060. * Flattens `array` a single level deep.
  8061. *
  8062. * @static
  8063. * @memberOf _
  8064. * @since 0.1.0
  8065. * @category Array
  8066. * @param {Array} array The array to flatten.
  8067. * @returns {Array} Returns the new flattened array.
  8068. * @example
  8069. *
  8070. * _.flatten([1, [2, [3, [4]], 5]]);
  8071. * // => [1, 2, [3, [4]], 5]
  8072. */
  8073. function flatten(array) {
  8074. var length = array == null ? 0 : array.length;
  8075. return length ? baseFlatten(array, 1) : [];
  8076. }
  8077. /**
  8078. * Recursively flattens `array`.
  8079. *
  8080. * @static
  8081. * @memberOf _
  8082. * @since 3.0.0
  8083. * @category Array
  8084. * @param {Array} array The array to flatten.
  8085. * @returns {Array} Returns the new flattened array.
  8086. * @example
  8087. *
  8088. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8089. * // => [1, 2, 3, 4, 5]
  8090. */
  8091. function flattenDeep(array) {
  8092. var length = array == null ? 0 : array.length;
  8093. return length ? baseFlatten(array, INFINITY) : [];
  8094. }
  8095. /**
  8096. * Recursively flatten `array` up to `depth` times.
  8097. *
  8098. * @static
  8099. * @memberOf _
  8100. * @since 4.4.0
  8101. * @category Array
  8102. * @param {Array} array The array to flatten.
  8103. * @param {number} [depth=1] The maximum recursion depth.
  8104. * @returns {Array} Returns the new flattened array.
  8105. * @example
  8106. *
  8107. * var array = [1, [2, [3, [4]], 5]];
  8108. *
  8109. * _.flattenDepth(array, 1);
  8110. * // => [1, 2, [3, [4]], 5]
  8111. *
  8112. * _.flattenDepth(array, 2);
  8113. * // => [1, 2, 3, [4], 5]
  8114. */
  8115. function flattenDepth(array, depth) {
  8116. var length = array == null ? 0 : array.length;
  8117. if (!length) {
  8118. return [];
  8119. }
  8120. depth = depth === undefined ? 1 : toInteger(depth);
  8121. return baseFlatten(array, depth);
  8122. }
  8123. /**
  8124. * The inverse of `_.toPairs`; this method returns an object composed
  8125. * from key-value `pairs`.
  8126. *
  8127. * @static
  8128. * @memberOf _
  8129. * @since 4.0.0
  8130. * @category Array
  8131. * @param {Array} pairs The key-value pairs.
  8132. * @returns {Object} Returns the new object.
  8133. * @example
  8134. *
  8135. * _.fromPairs([['a', 1], ['b', 2]]);
  8136. * // => { 'a': 1, 'b': 2 }
  8137. */
  8138. function fromPairs(pairs) {
  8139. var index = -1,
  8140. length = pairs == null ? 0 : pairs.length,
  8141. result = {};
  8142. while (++index < length) {
  8143. var pair = pairs[index];
  8144. result[pair[0]] = pair[1];
  8145. }
  8146. return result;
  8147. }
  8148. /**
  8149. * Gets the first element of `array`.
  8150. *
  8151. * @static
  8152. * @memberOf _
  8153. * @since 0.1.0
  8154. * @alias first
  8155. * @category Array
  8156. * @param {Array} array The array to query.
  8157. * @returns {*} Returns the first element of `array`.
  8158. * @example
  8159. *
  8160. * _.head([1, 2, 3]);
  8161. * // => 1
  8162. *
  8163. * _.head([]);
  8164. * // => undefined
  8165. */
  8166. function head(array) {
  8167. return (array && array.length) ? array[0] : undefined;
  8168. }
  8169. /**
  8170. * Gets the index at which the first occurrence of `value` is found in `array`
  8171. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8172. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8173. * offset from the end of `array`.
  8174. *
  8175. * @static
  8176. * @memberOf _
  8177. * @since 0.1.0
  8178. * @category Array
  8179. * @param {Array} array The array to inspect.
  8180. * @param {*} value The value to search for.
  8181. * @param {number} [fromIndex=0] The index to search from.
  8182. * @returns {number} Returns the index of the matched value, else `-1`.
  8183. * @example
  8184. *
  8185. * _.indexOf([1, 2, 1, 2], 2);
  8186. * // => 1
  8187. *
  8188. * // Search from the `fromIndex`.
  8189. * _.indexOf([1, 2, 1, 2], 2, 2);
  8190. * // => 3
  8191. */
  8192. function indexOf(array, value, fromIndex) {
  8193. var length = array == null ? 0 : array.length;
  8194. if (!length) {
  8195. return -1;
  8196. }
  8197. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8198. if (index < 0) {
  8199. index = nativeMax(length + index, 0);
  8200. }
  8201. return baseIndexOf(array, value, index);
  8202. }
  8203. /**
  8204. * Gets all but the last element of `array`.
  8205. *
  8206. * @static
  8207. * @memberOf _
  8208. * @since 0.1.0
  8209. * @category Array
  8210. * @param {Array} array The array to query.
  8211. * @returns {Array} Returns the slice of `array`.
  8212. * @example
  8213. *
  8214. * _.initial([1, 2, 3]);
  8215. * // => [1, 2]
  8216. */
  8217. function initial(array) {
  8218. var length = array == null ? 0 : array.length;
  8219. return length ? baseSlice(array, 0, -1) : [];
  8220. }
  8221. /**
  8222. * Creates an array of unique values that are included in all given arrays
  8223. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8224. * for equality comparisons. The order and references of result values are
  8225. * determined by the first array.
  8226. *
  8227. * @static
  8228. * @memberOf _
  8229. * @since 0.1.0
  8230. * @category Array
  8231. * @param {...Array} [arrays] The arrays to inspect.
  8232. * @returns {Array} Returns the new array of intersecting values.
  8233. * @example
  8234. *
  8235. * _.intersection([2, 1], [2, 3]);
  8236. * // => [2]
  8237. */
  8238. var intersection = baseRest(function(arrays) {
  8239. var mapped = arrayMap(arrays, castArrayLikeObject);
  8240. return (mapped.length && mapped[0] === arrays[0])
  8241. ? baseIntersection(mapped)
  8242. : [];
  8243. });
  8244. /**
  8245. * This method is like `_.intersection` except that it accepts `iteratee`
  8246. * which is invoked for each element of each `arrays` to generate the criterion
  8247. * by which they're compared. The order and references of result values are
  8248. * determined by the first array. The iteratee is invoked with one argument:
  8249. * (value).
  8250. *
  8251. * @static
  8252. * @memberOf _
  8253. * @since 4.0.0
  8254. * @category Array
  8255. * @param {...Array} [arrays] The arrays to inspect.
  8256. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8257. * @returns {Array} Returns the new array of intersecting values.
  8258. * @example
  8259. *
  8260. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8261. * // => [2.1]
  8262. *
  8263. * // The `_.property` iteratee shorthand.
  8264. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8265. * // => [{ 'x': 1 }]
  8266. */
  8267. var intersectionBy = baseRest(function(arrays) {
  8268. var iteratee = last(arrays),
  8269. mapped = arrayMap(arrays, castArrayLikeObject);
  8270. if (iteratee === last(mapped)) {
  8271. iteratee = undefined;
  8272. } else {
  8273. mapped.pop();
  8274. }
  8275. return (mapped.length && mapped[0] === arrays[0])
  8276. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8277. : [];
  8278. });
  8279. /**
  8280. * This method is like `_.intersection` except that it accepts `comparator`
  8281. * which is invoked to compare elements of `arrays`. The order and references
  8282. * of result values are determined by the first array. The comparator is
  8283. * invoked with two arguments: (arrVal, othVal).
  8284. *
  8285. * @static
  8286. * @memberOf _
  8287. * @since 4.0.0
  8288. * @category Array
  8289. * @param {...Array} [arrays] The arrays to inspect.
  8290. * @param {Function} [comparator] The comparator invoked per element.
  8291. * @returns {Array} Returns the new array of intersecting values.
  8292. * @example
  8293. *
  8294. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8295. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8296. *
  8297. * _.intersectionWith(objects, others, _.isEqual);
  8298. * // => [{ 'x': 1, 'y': 2 }]
  8299. */
  8300. var intersectionWith = baseRest(function(arrays) {
  8301. var comparator = last(arrays),
  8302. mapped = arrayMap(arrays, castArrayLikeObject);
  8303. comparator = typeof comparator == 'function' ? comparator : undefined;
  8304. if (comparator) {
  8305. mapped.pop();
  8306. }
  8307. return (mapped.length && mapped[0] === arrays[0])
  8308. ? baseIntersection(mapped, undefined, comparator)
  8309. : [];
  8310. });
  8311. /**
  8312. * Converts all elements in `array` into a string separated by `separator`.
  8313. *
  8314. * @static
  8315. * @memberOf _
  8316. * @since 4.0.0
  8317. * @category Array
  8318. * @param {Array} array The array to convert.
  8319. * @param {string} [separator=','] The element separator.
  8320. * @returns {string} Returns the joined string.
  8321. * @example
  8322. *
  8323. * _.join(['a', 'b', 'c'], '~');
  8324. * // => 'a~b~c'
  8325. */
  8326. function join(array, separator) {
  8327. return array == null ? '' : nativeJoin.call(array, separator);
  8328. }
  8329. /**
  8330. * Gets the last element of `array`.
  8331. *
  8332. * @static
  8333. * @memberOf _
  8334. * @since 0.1.0
  8335. * @category Array
  8336. * @param {Array} array The array to query.
  8337. * @returns {*} Returns the last element of `array`.
  8338. * @example
  8339. *
  8340. * _.last([1, 2, 3]);
  8341. * // => 3
  8342. */
  8343. function last(array) {
  8344. var length = array == null ? 0 : array.length;
  8345. return length ? array[length - 1] : undefined;
  8346. }
  8347. /**
  8348. * This method is like `_.indexOf` except that it iterates over elements of
  8349. * `array` from right to left.
  8350. *
  8351. * @static
  8352. * @memberOf _
  8353. * @since 0.1.0
  8354. * @category Array
  8355. * @param {Array} array The array to inspect.
  8356. * @param {*} value The value to search for.
  8357. * @param {number} [fromIndex=array.length-1] The index to search from.
  8358. * @returns {number} Returns the index of the matched value, else `-1`.
  8359. * @example
  8360. *
  8361. * _.lastIndexOf([1, 2, 1, 2], 2);
  8362. * // => 3
  8363. *
  8364. * // Search from the `fromIndex`.
  8365. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8366. * // => 1
  8367. */
  8368. function lastIndexOf(array, value, fromIndex) {
  8369. var length = array == null ? 0 : array.length;
  8370. if (!length) {
  8371. return -1;
  8372. }
  8373. var index = length;
  8374. if (fromIndex !== undefined) {
  8375. index = toInteger(fromIndex);
  8376. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8377. }
  8378. return value === value
  8379. ? strictLastIndexOf(array, value, index)
  8380. : baseFindIndex(array, baseIsNaN, index, true);
  8381. }
  8382. /**
  8383. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8384. * element from the end is returned.
  8385. *
  8386. * @static
  8387. * @memberOf _
  8388. * @since 4.11.0
  8389. * @category Array
  8390. * @param {Array} array The array to query.
  8391. * @param {number} [n=0] The index of the element to return.
  8392. * @returns {*} Returns the nth element of `array`.
  8393. * @example
  8394. *
  8395. * var array = ['a', 'b', 'c', 'd'];
  8396. *
  8397. * _.nth(array, 1);
  8398. * // => 'b'
  8399. *
  8400. * _.nth(array, -2);
  8401. * // => 'c';
  8402. */
  8403. function nth(array, n) {
  8404. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8405. }
  8406. /**
  8407. * Removes all given values from `array` using
  8408. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8409. * for equality comparisons.
  8410. *
  8411. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8412. * to remove elements from an array by predicate.
  8413. *
  8414. * @static
  8415. * @memberOf _
  8416. * @since 2.0.0
  8417. * @category Array
  8418. * @param {Array} array The array to modify.
  8419. * @param {...*} [values] The values to remove.
  8420. * @returns {Array} Returns `array`.
  8421. * @example
  8422. *
  8423. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8424. *
  8425. * _.pull(array, 'a', 'c');
  8426. * console.log(array);
  8427. * // => ['b', 'b']
  8428. */
  8429. var pull = baseRest(pullAll);
  8430. /**
  8431. * This method is like `_.pull` except that it accepts an array of values to remove.
  8432. *
  8433. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8434. *
  8435. * @static
  8436. * @memberOf _
  8437. * @since 4.0.0
  8438. * @category Array
  8439. * @param {Array} array The array to modify.
  8440. * @param {Array} values The values to remove.
  8441. * @returns {Array} Returns `array`.
  8442. * @example
  8443. *
  8444. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8445. *
  8446. * _.pullAll(array, ['a', 'c']);
  8447. * console.log(array);
  8448. * // => ['b', 'b']
  8449. */
  8450. function pullAll(array, values) {
  8451. return (array && array.length && values && values.length)
  8452. ? basePullAll(array, values)
  8453. : array;
  8454. }
  8455. /**
  8456. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8457. * invoked for each element of `array` and `values` to generate the criterion
  8458. * by which they're compared. The iteratee is invoked with one argument: (value).
  8459. *
  8460. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8461. *
  8462. * @static
  8463. * @memberOf _
  8464. * @since 4.0.0
  8465. * @category Array
  8466. * @param {Array} array The array to modify.
  8467. * @param {Array} values The values to remove.
  8468. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8469. * @returns {Array} Returns `array`.
  8470. * @example
  8471. *
  8472. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8473. *
  8474. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8475. * console.log(array);
  8476. * // => [{ 'x': 2 }]
  8477. */
  8478. function pullAllBy(array, values, iteratee) {
  8479. return (array && array.length && values && values.length)
  8480. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8481. : array;
  8482. }
  8483. /**
  8484. * This method is like `_.pullAll` except that it accepts `comparator` which
  8485. * is invoked to compare elements of `array` to `values`. The comparator is
  8486. * invoked with two arguments: (arrVal, othVal).
  8487. *
  8488. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8489. *
  8490. * @static
  8491. * @memberOf _
  8492. * @since 4.6.0
  8493. * @category Array
  8494. * @param {Array} array The array to modify.
  8495. * @param {Array} values The values to remove.
  8496. * @param {Function} [comparator] The comparator invoked per element.
  8497. * @returns {Array} Returns `array`.
  8498. * @example
  8499. *
  8500. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8501. *
  8502. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8503. * console.log(array);
  8504. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8505. */
  8506. function pullAllWith(array, values, comparator) {
  8507. return (array && array.length && values && values.length)
  8508. ? basePullAll(array, values, undefined, comparator)
  8509. : array;
  8510. }
  8511. /**
  8512. * Removes elements from `array` corresponding to `indexes` and returns an
  8513. * array of removed elements.
  8514. *
  8515. * **Note:** Unlike `_.at`, this method mutates `array`.
  8516. *
  8517. * @static
  8518. * @memberOf _
  8519. * @since 3.0.0
  8520. * @category Array
  8521. * @param {Array} array The array to modify.
  8522. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8523. * @returns {Array} Returns the new array of removed elements.
  8524. * @example
  8525. *
  8526. * var array = ['a', 'b', 'c', 'd'];
  8527. * var pulled = _.pullAt(array, [1, 3]);
  8528. *
  8529. * console.log(array);
  8530. * // => ['a', 'c']
  8531. *
  8532. * console.log(pulled);
  8533. * // => ['b', 'd']
  8534. */
  8535. var pullAt = flatRest(function(array, indexes) {
  8536. var length = array == null ? 0 : array.length,
  8537. result = baseAt(array, indexes);
  8538. basePullAt(array, arrayMap(indexes, function(index) {
  8539. return isIndex(index, length) ? +index : index;
  8540. }).sort(compareAscending));
  8541. return result;
  8542. });
  8543. /**
  8544. * Removes all elements from `array` that `predicate` returns truthy for
  8545. * and returns an array of the removed elements. The predicate is invoked
  8546. * with three arguments: (value, index, array).
  8547. *
  8548. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8549. * to pull elements from an array by value.
  8550. *
  8551. * @static
  8552. * @memberOf _
  8553. * @since 2.0.0
  8554. * @category Array
  8555. * @param {Array} array The array to modify.
  8556. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8557. * @returns {Array} Returns the new array of removed elements.
  8558. * @example
  8559. *
  8560. * var array = [1, 2, 3, 4];
  8561. * var evens = _.remove(array, function(n) {
  8562. * return n % 2 == 0;
  8563. * });
  8564. *
  8565. * console.log(array);
  8566. * // => [1, 3]
  8567. *
  8568. * console.log(evens);
  8569. * // => [2, 4]
  8570. */
  8571. function remove(array, predicate) {
  8572. var result = [];
  8573. if (!(array && array.length)) {
  8574. return result;
  8575. }
  8576. var index = -1,
  8577. indexes = [],
  8578. length = array.length;
  8579. predicate = getIteratee(predicate, 3);
  8580. while (++index < length) {
  8581. var value = array[index];
  8582. if (predicate(value, index, array)) {
  8583. result.push(value);
  8584. indexes.push(index);
  8585. }
  8586. }
  8587. basePullAt(array, indexes);
  8588. return result;
  8589. }
  8590. /**
  8591. * Reverses `array` so that the first element becomes the last, the second
  8592. * element becomes the second to last, and so on.
  8593. *
  8594. * **Note:** This method mutates `array` and is based on
  8595. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8596. *
  8597. * @static
  8598. * @memberOf _
  8599. * @since 4.0.0
  8600. * @category Array
  8601. * @param {Array} array The array to modify.
  8602. * @returns {Array} Returns `array`.
  8603. * @example
  8604. *
  8605. * var array = [1, 2, 3];
  8606. *
  8607. * _.reverse(array);
  8608. * // => [3, 2, 1]
  8609. *
  8610. * console.log(array);
  8611. * // => [3, 2, 1]
  8612. */
  8613. function reverse(array) {
  8614. return array == null ? array : nativeReverse.call(array);
  8615. }
  8616. /**
  8617. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8618. *
  8619. * **Note:** This method is used instead of
  8620. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8621. * returned.
  8622. *
  8623. * @static
  8624. * @memberOf _
  8625. * @since 3.0.0
  8626. * @category Array
  8627. * @param {Array} array The array to slice.
  8628. * @param {number} [start=0] The start position.
  8629. * @param {number} [end=array.length] The end position.
  8630. * @returns {Array} Returns the slice of `array`.
  8631. */
  8632. function slice(array, start, end) {
  8633. var length = array == null ? 0 : array.length;
  8634. if (!length) {
  8635. return [];
  8636. }
  8637. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8638. start = 0;
  8639. end = length;
  8640. }
  8641. else {
  8642. start = start == null ? 0 : toInteger(start);
  8643. end = end === undefined ? length : toInteger(end);
  8644. }
  8645. return baseSlice(array, start, end);
  8646. }
  8647. /**
  8648. * Uses a binary search to determine the lowest index at which `value`
  8649. * should be inserted into `array` in order to maintain its sort order.
  8650. *
  8651. * @static
  8652. * @memberOf _
  8653. * @since 0.1.0
  8654. * @category Array
  8655. * @param {Array} array The sorted array to inspect.
  8656. * @param {*} value The value to evaluate.
  8657. * @returns {number} Returns the index at which `value` should be inserted
  8658. * into `array`.
  8659. * @example
  8660. *
  8661. * _.sortedIndex([30, 50], 40);
  8662. * // => 1
  8663. */
  8664. function sortedIndex(array, value) {
  8665. return baseSortedIndex(array, value);
  8666. }
  8667. /**
  8668. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8669. * which is invoked for `value` and each element of `array` to compute their
  8670. * sort ranking. The iteratee is invoked with one argument: (value).
  8671. *
  8672. * @static
  8673. * @memberOf _
  8674. * @since 4.0.0
  8675. * @category Array
  8676. * @param {Array} array The sorted array to inspect.
  8677. * @param {*} value The value to evaluate.
  8678. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8679. * @returns {number} Returns the index at which `value` should be inserted
  8680. * into `array`.
  8681. * @example
  8682. *
  8683. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8684. *
  8685. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8686. * // => 0
  8687. *
  8688. * // The `_.property` iteratee shorthand.
  8689. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8690. * // => 0
  8691. */
  8692. function sortedIndexBy(array, value, iteratee) {
  8693. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8694. }
  8695. /**
  8696. * This method is like `_.indexOf` except that it performs a binary
  8697. * search on a sorted `array`.
  8698. *
  8699. * @static
  8700. * @memberOf _
  8701. * @since 4.0.0
  8702. * @category Array
  8703. * @param {Array} array The array to inspect.
  8704. * @param {*} value The value to search for.
  8705. * @returns {number} Returns the index of the matched value, else `-1`.
  8706. * @example
  8707. *
  8708. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8709. * // => 1
  8710. */
  8711. function sortedIndexOf(array, value) {
  8712. var length = array == null ? 0 : array.length;
  8713. if (length) {
  8714. var index = baseSortedIndex(array, value);
  8715. if (index < length && eq(array[index], value)) {
  8716. return index;
  8717. }
  8718. }
  8719. return -1;
  8720. }
  8721. /**
  8722. * This method is like `_.sortedIndex` except that it returns the highest
  8723. * index at which `value` should be inserted into `array` in order to
  8724. * maintain its sort order.
  8725. *
  8726. * @static
  8727. * @memberOf _
  8728. * @since 3.0.0
  8729. * @category Array
  8730. * @param {Array} array The sorted array to inspect.
  8731. * @param {*} value The value to evaluate.
  8732. * @returns {number} Returns the index at which `value` should be inserted
  8733. * into `array`.
  8734. * @example
  8735. *
  8736. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8737. * // => 4
  8738. */
  8739. function sortedLastIndex(array, value) {
  8740. return baseSortedIndex(array, value, true);
  8741. }
  8742. /**
  8743. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8744. * which is invoked for `value` and each element of `array` to compute their
  8745. * sort ranking. The iteratee is invoked with one argument: (value).
  8746. *
  8747. * @static
  8748. * @memberOf _
  8749. * @since 4.0.0
  8750. * @category Array
  8751. * @param {Array} array The sorted array to inspect.
  8752. * @param {*} value The value to evaluate.
  8753. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8754. * @returns {number} Returns the index at which `value` should be inserted
  8755. * into `array`.
  8756. * @example
  8757. *
  8758. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8759. *
  8760. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8761. * // => 1
  8762. *
  8763. * // The `_.property` iteratee shorthand.
  8764. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8765. * // => 1
  8766. */
  8767. function sortedLastIndexBy(array, value, iteratee) {
  8768. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8769. }
  8770. /**
  8771. * This method is like `_.lastIndexOf` except that it performs a binary
  8772. * search on a sorted `array`.
  8773. *
  8774. * @static
  8775. * @memberOf _
  8776. * @since 4.0.0
  8777. * @category Array
  8778. * @param {Array} array The array to inspect.
  8779. * @param {*} value The value to search for.
  8780. * @returns {number} Returns the index of the matched value, else `-1`.
  8781. * @example
  8782. *
  8783. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8784. * // => 3
  8785. */
  8786. function sortedLastIndexOf(array, value) {
  8787. var length = array == null ? 0 : array.length;
  8788. if (length) {
  8789. var index = baseSortedIndex(array, value, true) - 1;
  8790. if (eq(array[index], value)) {
  8791. return index;
  8792. }
  8793. }
  8794. return -1;
  8795. }
  8796. /**
  8797. * This method is like `_.uniq` except that it's designed and optimized
  8798. * for sorted arrays.
  8799. *
  8800. * @static
  8801. * @memberOf _
  8802. * @since 4.0.0
  8803. * @category Array
  8804. * @param {Array} array The array to inspect.
  8805. * @returns {Array} Returns the new duplicate free array.
  8806. * @example
  8807. *
  8808. * _.sortedUniq([1, 1, 2]);
  8809. * // => [1, 2]
  8810. */
  8811. function sortedUniq(array) {
  8812. return (array && array.length)
  8813. ? baseSortedUniq(array)
  8814. : [];
  8815. }
  8816. /**
  8817. * This method is like `_.uniqBy` except that it's designed and optimized
  8818. * for sorted arrays.
  8819. *
  8820. * @static
  8821. * @memberOf _
  8822. * @since 4.0.0
  8823. * @category Array
  8824. * @param {Array} array The array to inspect.
  8825. * @param {Function} [iteratee] The iteratee invoked per element.
  8826. * @returns {Array} Returns the new duplicate free array.
  8827. * @example
  8828. *
  8829. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8830. * // => [1.1, 2.3]
  8831. */
  8832. function sortedUniqBy(array, iteratee) {
  8833. return (array && array.length)
  8834. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8835. : [];
  8836. }
  8837. /**
  8838. * Gets all but the first element of `array`.
  8839. *
  8840. * @static
  8841. * @memberOf _
  8842. * @since 4.0.0
  8843. * @category Array
  8844. * @param {Array} array The array to query.
  8845. * @returns {Array} Returns the slice of `array`.
  8846. * @example
  8847. *
  8848. * _.tail([1, 2, 3]);
  8849. * // => [2, 3]
  8850. */
  8851. function tail(array) {
  8852. var length = array == null ? 0 : array.length;
  8853. return length ? baseSlice(array, 1, length) : [];
  8854. }
  8855. /**
  8856. * Creates a slice of `array` with `n` elements taken from the beginning.
  8857. *
  8858. * @static
  8859. * @memberOf _
  8860. * @since 0.1.0
  8861. * @category Array
  8862. * @param {Array} array The array to query.
  8863. * @param {number} [n=1] The number of elements to take.
  8864. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8865. * @returns {Array} Returns the slice of `array`.
  8866. * @example
  8867. *
  8868. * _.take([1, 2, 3]);
  8869. * // => [1]
  8870. *
  8871. * _.take([1, 2, 3], 2);
  8872. * // => [1, 2]
  8873. *
  8874. * _.take([1, 2, 3], 5);
  8875. * // => [1, 2, 3]
  8876. *
  8877. * _.take([1, 2, 3], 0);
  8878. * // => []
  8879. */
  8880. function take(array, n, guard) {
  8881. if (!(array && array.length)) {
  8882. return [];
  8883. }
  8884. n = (guard || n === undefined) ? 1 : toInteger(n);
  8885. return baseSlice(array, 0, n < 0 ? 0 : n);
  8886. }
  8887. /**
  8888. * Creates a slice of `array` with `n` elements taken from the end.
  8889. *
  8890. * @static
  8891. * @memberOf _
  8892. * @since 3.0.0
  8893. * @category Array
  8894. * @param {Array} array The array to query.
  8895. * @param {number} [n=1] The number of elements to take.
  8896. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8897. * @returns {Array} Returns the slice of `array`.
  8898. * @example
  8899. *
  8900. * _.takeRight([1, 2, 3]);
  8901. * // => [3]
  8902. *
  8903. * _.takeRight([1, 2, 3], 2);
  8904. * // => [2, 3]
  8905. *
  8906. * _.takeRight([1, 2, 3], 5);
  8907. * // => [1, 2, 3]
  8908. *
  8909. * _.takeRight([1, 2, 3], 0);
  8910. * // => []
  8911. */
  8912. function takeRight(array, n, guard) {
  8913. var length = array == null ? 0 : array.length;
  8914. if (!length) {
  8915. return [];
  8916. }
  8917. n = (guard || n === undefined) ? 1 : toInteger(n);
  8918. n = length - n;
  8919. return baseSlice(array, n < 0 ? 0 : n, length);
  8920. }
  8921. /**
  8922. * Creates a slice of `array` with elements taken from the end. Elements are
  8923. * taken until `predicate` returns falsey. The predicate is invoked with
  8924. * three arguments: (value, index, array).
  8925. *
  8926. * @static
  8927. * @memberOf _
  8928. * @since 3.0.0
  8929. * @category Array
  8930. * @param {Array} array The array to query.
  8931. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8932. * @returns {Array} Returns the slice of `array`.
  8933. * @example
  8934. *
  8935. * var users = [
  8936. * { 'user': 'barney', 'active': true },
  8937. * { 'user': 'fred', 'active': false },
  8938. * { 'user': 'pebbles', 'active': false }
  8939. * ];
  8940. *
  8941. * _.takeRightWhile(users, function(o) { return !o.active; });
  8942. * // => objects for ['fred', 'pebbles']
  8943. *
  8944. * // The `_.matches` iteratee shorthand.
  8945. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8946. * // => objects for ['pebbles']
  8947. *
  8948. * // The `_.matchesProperty` iteratee shorthand.
  8949. * _.takeRightWhile(users, ['active', false]);
  8950. * // => objects for ['fred', 'pebbles']
  8951. *
  8952. * // The `_.property` iteratee shorthand.
  8953. * _.takeRightWhile(users, 'active');
  8954. * // => []
  8955. */
  8956. function takeRightWhile(array, predicate) {
  8957. return (array && array.length)
  8958. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8959. : [];
  8960. }
  8961. /**
  8962. * Creates a slice of `array` with elements taken from the beginning. Elements
  8963. * are taken until `predicate` returns falsey. The predicate is invoked with
  8964. * three arguments: (value, index, array).
  8965. *
  8966. * @static
  8967. * @memberOf _
  8968. * @since 3.0.0
  8969. * @category Array
  8970. * @param {Array} array The array to query.
  8971. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8972. * @returns {Array} Returns the slice of `array`.
  8973. * @example
  8974. *
  8975. * var users = [
  8976. * { 'user': 'barney', 'active': false },
  8977. * { 'user': 'fred', 'active': false },
  8978. * { 'user': 'pebbles', 'active': true }
  8979. * ];
  8980. *
  8981. * _.takeWhile(users, function(o) { return !o.active; });
  8982. * // => objects for ['barney', 'fred']
  8983. *
  8984. * // The `_.matches` iteratee shorthand.
  8985. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8986. * // => objects for ['barney']
  8987. *
  8988. * // The `_.matchesProperty` iteratee shorthand.
  8989. * _.takeWhile(users, ['active', false]);
  8990. * // => objects for ['barney', 'fred']
  8991. *
  8992. * // The `_.property` iteratee shorthand.
  8993. * _.takeWhile(users, 'active');
  8994. * // => []
  8995. */
  8996. function takeWhile(array, predicate) {
  8997. return (array && array.length)
  8998. ? baseWhile(array, getIteratee(predicate, 3))
  8999. : [];
  9000. }
  9001. /**
  9002. * Creates an array of unique values, in order, from all given arrays using
  9003. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9004. * for equality comparisons.
  9005. *
  9006. * @static
  9007. * @memberOf _
  9008. * @since 0.1.0
  9009. * @category Array
  9010. * @param {...Array} [arrays] The arrays to inspect.
  9011. * @returns {Array} Returns the new array of combined values.
  9012. * @example
  9013. *
  9014. * _.union([2], [1, 2]);
  9015. * // => [2, 1]
  9016. */
  9017. var union = baseRest(function(arrays) {
  9018. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9019. });
  9020. /**
  9021. * This method is like `_.union` except that it accepts `iteratee` which is
  9022. * invoked for each element of each `arrays` to generate the criterion by
  9023. * which uniqueness is computed. Result values are chosen from the first
  9024. * array in which the value occurs. The iteratee is invoked with one argument:
  9025. * (value).
  9026. *
  9027. * @static
  9028. * @memberOf _
  9029. * @since 4.0.0
  9030. * @category Array
  9031. * @param {...Array} [arrays] The arrays to inspect.
  9032. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9033. * @returns {Array} Returns the new array of combined values.
  9034. * @example
  9035. *
  9036. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9037. * // => [2.1, 1.2]
  9038. *
  9039. * // The `_.property` iteratee shorthand.
  9040. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9041. * // => [{ 'x': 1 }, { 'x': 2 }]
  9042. */
  9043. var unionBy = baseRest(function(arrays) {
  9044. var iteratee = last(arrays);
  9045. if (isArrayLikeObject(iteratee)) {
  9046. iteratee = undefined;
  9047. }
  9048. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9049. });
  9050. /**
  9051. * This method is like `_.union` except that it accepts `comparator` which
  9052. * is invoked to compare elements of `arrays`. Result values are chosen from
  9053. * the first array in which the value occurs. The comparator is invoked
  9054. * with two arguments: (arrVal, othVal).
  9055. *
  9056. * @static
  9057. * @memberOf _
  9058. * @since 4.0.0
  9059. * @category Array
  9060. * @param {...Array} [arrays] The arrays to inspect.
  9061. * @param {Function} [comparator] The comparator invoked per element.
  9062. * @returns {Array} Returns the new array of combined values.
  9063. * @example
  9064. *
  9065. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9066. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9067. *
  9068. * _.unionWith(objects, others, _.isEqual);
  9069. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9070. */
  9071. var unionWith = baseRest(function(arrays) {
  9072. var comparator = last(arrays);
  9073. comparator = typeof comparator == 'function' ? comparator : undefined;
  9074. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9075. });
  9076. /**
  9077. * Creates a duplicate-free version of an array, using
  9078. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9079. * for equality comparisons, in which only the first occurrence of each element
  9080. * is kept. The order of result values is determined by the order they occur
  9081. * in the array.
  9082. *
  9083. * @static
  9084. * @memberOf _
  9085. * @since 0.1.0
  9086. * @category Array
  9087. * @param {Array} array The array to inspect.
  9088. * @returns {Array} Returns the new duplicate free array.
  9089. * @example
  9090. *
  9091. * _.uniq([2, 1, 2]);
  9092. * // => [2, 1]
  9093. */
  9094. function uniq(array) {
  9095. return (array && array.length) ? baseUniq(array) : [];
  9096. }
  9097. /**
  9098. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9099. * invoked for each element in `array` to generate the criterion by which
  9100. * uniqueness is computed. The order of result values is determined by the
  9101. * order they occur in the array. The iteratee is invoked with one argument:
  9102. * (value).
  9103. *
  9104. * @static
  9105. * @memberOf _
  9106. * @since 4.0.0
  9107. * @category Array
  9108. * @param {Array} array The array to inspect.
  9109. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9110. * @returns {Array} Returns the new duplicate free array.
  9111. * @example
  9112. *
  9113. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9114. * // => [2.1, 1.2]
  9115. *
  9116. * // The `_.property` iteratee shorthand.
  9117. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9118. * // => [{ 'x': 1 }, { 'x': 2 }]
  9119. */
  9120. function uniqBy(array, iteratee) {
  9121. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9122. }
  9123. /**
  9124. * This method is like `_.uniq` except that it accepts `comparator` which
  9125. * is invoked to compare elements of `array`. The order of result values is
  9126. * determined by the order they occur in the array.The comparator is invoked
  9127. * with two arguments: (arrVal, othVal).
  9128. *
  9129. * @static
  9130. * @memberOf _
  9131. * @since 4.0.0
  9132. * @category Array
  9133. * @param {Array} array The array to inspect.
  9134. * @param {Function} [comparator] The comparator invoked per element.
  9135. * @returns {Array} Returns the new duplicate free array.
  9136. * @example
  9137. *
  9138. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9139. *
  9140. * _.uniqWith(objects, _.isEqual);
  9141. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9142. */
  9143. function uniqWith(array, comparator) {
  9144. comparator = typeof comparator == 'function' ? comparator : undefined;
  9145. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9146. }
  9147. /**
  9148. * This method is like `_.zip` except that it accepts an array of grouped
  9149. * elements and creates an array regrouping the elements to their pre-zip
  9150. * configuration.
  9151. *
  9152. * @static
  9153. * @memberOf _
  9154. * @since 1.2.0
  9155. * @category Array
  9156. * @param {Array} array The array of grouped elements to process.
  9157. * @returns {Array} Returns the new array of regrouped elements.
  9158. * @example
  9159. *
  9160. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9161. * // => [['a', 1, true], ['b', 2, false]]
  9162. *
  9163. * _.unzip(zipped);
  9164. * // => [['a', 'b'], [1, 2], [true, false]]
  9165. */
  9166. function unzip(array) {
  9167. if (!(array && array.length)) {
  9168. return [];
  9169. }
  9170. var length = 0;
  9171. array = arrayFilter(array, function(group) {
  9172. if (isArrayLikeObject(group)) {
  9173. length = nativeMax(group.length, length);
  9174. return true;
  9175. }
  9176. });
  9177. return baseTimes(length, function(index) {
  9178. return arrayMap(array, baseProperty(index));
  9179. });
  9180. }
  9181. /**
  9182. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9183. * how regrouped values should be combined. The iteratee is invoked with the
  9184. * elements of each group: (...group).
  9185. *
  9186. * @static
  9187. * @memberOf _
  9188. * @since 3.8.0
  9189. * @category Array
  9190. * @param {Array} array The array of grouped elements to process.
  9191. * @param {Function} [iteratee=_.identity] The function to combine
  9192. * regrouped values.
  9193. * @returns {Array} Returns the new array of regrouped elements.
  9194. * @example
  9195. *
  9196. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9197. * // => [[1, 10, 100], [2, 20, 200]]
  9198. *
  9199. * _.unzipWith(zipped, _.add);
  9200. * // => [3, 30, 300]
  9201. */
  9202. function unzipWith(array, iteratee) {
  9203. if (!(array && array.length)) {
  9204. return [];
  9205. }
  9206. var result = unzip(array);
  9207. if (iteratee == null) {
  9208. return result;
  9209. }
  9210. return arrayMap(result, function(group) {
  9211. return apply(iteratee, undefined, group);
  9212. });
  9213. }
  9214. /**
  9215. * Creates an array excluding all given values using
  9216. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9217. * for equality comparisons.
  9218. *
  9219. * **Note:** Unlike `_.pull`, this method returns a new array.
  9220. *
  9221. * @static
  9222. * @memberOf _
  9223. * @since 0.1.0
  9224. * @category Array
  9225. * @param {Array} array The array to inspect.
  9226. * @param {...*} [values] The values to exclude.
  9227. * @returns {Array} Returns the new array of filtered values.
  9228. * @see _.difference, _.xor
  9229. * @example
  9230. *
  9231. * _.without([2, 1, 2, 3], 1, 2);
  9232. * // => [3]
  9233. */
  9234. var without = baseRest(function(array, values) {
  9235. return isArrayLikeObject(array)
  9236. ? baseDifference(array, values)
  9237. : [];
  9238. });
  9239. /**
  9240. * Creates an array of unique values that is the
  9241. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9242. * of the given arrays. The order of result values is determined by the order
  9243. * they occur in the arrays.
  9244. *
  9245. * @static
  9246. * @memberOf _
  9247. * @since 2.4.0
  9248. * @category Array
  9249. * @param {...Array} [arrays] The arrays to inspect.
  9250. * @returns {Array} Returns the new array of filtered values.
  9251. * @see _.difference, _.without
  9252. * @example
  9253. *
  9254. * _.xor([2, 1], [2, 3]);
  9255. * // => [1, 3]
  9256. */
  9257. var xor = baseRest(function(arrays) {
  9258. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9259. });
  9260. /**
  9261. * This method is like `_.xor` except that it accepts `iteratee` which is
  9262. * invoked for each element of each `arrays` to generate the criterion by
  9263. * which by which they're compared. The order of result values is determined
  9264. * by the order they occur in the arrays. The iteratee is invoked with one
  9265. * argument: (value).
  9266. *
  9267. * @static
  9268. * @memberOf _
  9269. * @since 4.0.0
  9270. * @category Array
  9271. * @param {...Array} [arrays] The arrays to inspect.
  9272. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9273. * @returns {Array} Returns the new array of filtered values.
  9274. * @example
  9275. *
  9276. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9277. * // => [1.2, 3.4]
  9278. *
  9279. * // The `_.property` iteratee shorthand.
  9280. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9281. * // => [{ 'x': 2 }]
  9282. */
  9283. var xorBy = baseRest(function(arrays) {
  9284. var iteratee = last(arrays);
  9285. if (isArrayLikeObject(iteratee)) {
  9286. iteratee = undefined;
  9287. }
  9288. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9289. });
  9290. /**
  9291. * This method is like `_.xor` except that it accepts `comparator` which is
  9292. * invoked to compare elements of `arrays`. The order of result values is
  9293. * determined by the order they occur in the arrays. The comparator is invoked
  9294. * with two arguments: (arrVal, othVal).
  9295. *
  9296. * @static
  9297. * @memberOf _
  9298. * @since 4.0.0
  9299. * @category Array
  9300. * @param {...Array} [arrays] The arrays to inspect.
  9301. * @param {Function} [comparator] The comparator invoked per element.
  9302. * @returns {Array} Returns the new array of filtered values.
  9303. * @example
  9304. *
  9305. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9306. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9307. *
  9308. * _.xorWith(objects, others, _.isEqual);
  9309. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9310. */
  9311. var xorWith = baseRest(function(arrays) {
  9312. var comparator = last(arrays);
  9313. comparator = typeof comparator == 'function' ? comparator : undefined;
  9314. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9315. });
  9316. /**
  9317. * Creates an array of grouped elements, the first of which contains the
  9318. * first elements of the given arrays, the second of which contains the
  9319. * second elements of the given arrays, and so on.
  9320. *
  9321. * @static
  9322. * @memberOf _
  9323. * @since 0.1.0
  9324. * @category Array
  9325. * @param {...Array} [arrays] The arrays to process.
  9326. * @returns {Array} Returns the new array of grouped elements.
  9327. * @example
  9328. *
  9329. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9330. * // => [['a', 1, true], ['b', 2, false]]
  9331. */
  9332. var zip = baseRest(unzip);
  9333. /**
  9334. * This method is like `_.fromPairs` except that it accepts two arrays,
  9335. * one of property identifiers and one of corresponding values.
  9336. *
  9337. * @static
  9338. * @memberOf _
  9339. * @since 0.4.0
  9340. * @category Array
  9341. * @param {Array} [props=[]] The property identifiers.
  9342. * @param {Array} [values=[]] The property values.
  9343. * @returns {Object} Returns the new object.
  9344. * @example
  9345. *
  9346. * _.zipObject(['a', 'b'], [1, 2]);
  9347. * // => { 'a': 1, 'b': 2 }
  9348. */
  9349. function zipObject(props, values) {
  9350. return baseZipObject(props || [], values || [], assignValue);
  9351. }
  9352. /**
  9353. * This method is like `_.zipObject` except that it supports property paths.
  9354. *
  9355. * @static
  9356. * @memberOf _
  9357. * @since 4.1.0
  9358. * @category Array
  9359. * @param {Array} [props=[]] The property identifiers.
  9360. * @param {Array} [values=[]] The property values.
  9361. * @returns {Object} Returns the new object.
  9362. * @example
  9363. *
  9364. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9365. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9366. */
  9367. function zipObjectDeep(props, values) {
  9368. return baseZipObject(props || [], values || [], baseSet);
  9369. }
  9370. /**
  9371. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9372. * how grouped values should be combined. The iteratee is invoked with the
  9373. * elements of each group: (...group).
  9374. *
  9375. * @static
  9376. * @memberOf _
  9377. * @since 3.8.0
  9378. * @category Array
  9379. * @param {...Array} [arrays] The arrays to process.
  9380. * @param {Function} [iteratee=_.identity] The function to combine
  9381. * grouped values.
  9382. * @returns {Array} Returns the new array of grouped elements.
  9383. * @example
  9384. *
  9385. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9386. * return a + b + c;
  9387. * });
  9388. * // => [111, 222]
  9389. */
  9390. var zipWith = baseRest(function(arrays) {
  9391. var length = arrays.length,
  9392. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9393. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9394. return unzipWith(arrays, iteratee);
  9395. });
  9396. /*------------------------------------------------------------------------*/
  9397. /**
  9398. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9399. * chain sequences enabled. The result of such sequences must be unwrapped
  9400. * with `_#value`.
  9401. *
  9402. * @static
  9403. * @memberOf _
  9404. * @since 1.3.0
  9405. * @category Seq
  9406. * @param {*} value The value to wrap.
  9407. * @returns {Object} Returns the new `lodash` wrapper instance.
  9408. * @example
  9409. *
  9410. * var users = [
  9411. * { 'user': 'barney', 'age': 36 },
  9412. * { 'user': 'fred', 'age': 40 },
  9413. * { 'user': 'pebbles', 'age': 1 }
  9414. * ];
  9415. *
  9416. * var youngest = _
  9417. * .chain(users)
  9418. * .sortBy('age')
  9419. * .map(function(o) {
  9420. * return o.user + ' is ' + o.age;
  9421. * })
  9422. * .head()
  9423. * .value();
  9424. * // => 'pebbles is 1'
  9425. */
  9426. function chain(value) {
  9427. var result = lodash(value);
  9428. result.__chain__ = true;
  9429. return result;
  9430. }
  9431. /**
  9432. * This method invokes `interceptor` and returns `value`. The interceptor
  9433. * is invoked with one argument; (value). The purpose of this method is to
  9434. * "tap into" a method chain sequence in order to modify intermediate results.
  9435. *
  9436. * @static
  9437. * @memberOf _
  9438. * @since 0.1.0
  9439. * @category Seq
  9440. * @param {*} value The value to provide to `interceptor`.
  9441. * @param {Function} interceptor The function to invoke.
  9442. * @returns {*} Returns `value`.
  9443. * @example
  9444. *
  9445. * _([1, 2, 3])
  9446. * .tap(function(array) {
  9447. * // Mutate input array.
  9448. * array.pop();
  9449. * })
  9450. * .reverse()
  9451. * .value();
  9452. * // => [2, 1]
  9453. */
  9454. function tap(value, interceptor) {
  9455. interceptor(value);
  9456. return value;
  9457. }
  9458. /**
  9459. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9460. * The purpose of this method is to "pass thru" values replacing intermediate
  9461. * results in a method chain sequence.
  9462. *
  9463. * @static
  9464. * @memberOf _
  9465. * @since 3.0.0
  9466. * @category Seq
  9467. * @param {*} value The value to provide to `interceptor`.
  9468. * @param {Function} interceptor The function to invoke.
  9469. * @returns {*} Returns the result of `interceptor`.
  9470. * @example
  9471. *
  9472. * _(' abc ')
  9473. * .chain()
  9474. * .trim()
  9475. * .thru(function(value) {
  9476. * return [value];
  9477. * })
  9478. * .value();
  9479. * // => ['abc']
  9480. */
  9481. function thru(value, interceptor) {
  9482. return interceptor(value);
  9483. }
  9484. /**
  9485. * This method is the wrapper version of `_.at`.
  9486. *
  9487. * @name at
  9488. * @memberOf _
  9489. * @since 1.0.0
  9490. * @category Seq
  9491. * @param {...(string|string[])} [paths] The property paths to pick.
  9492. * @returns {Object} Returns the new `lodash` wrapper instance.
  9493. * @example
  9494. *
  9495. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9496. *
  9497. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9498. * // => [3, 4]
  9499. */
  9500. var wrapperAt = flatRest(function(paths) {
  9501. var length = paths.length,
  9502. start = length ? paths[0] : 0,
  9503. value = this.__wrapped__,
  9504. interceptor = function(object) { return baseAt(object, paths); };
  9505. if (length > 1 || this.__actions__.length ||
  9506. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9507. return this.thru(interceptor);
  9508. }
  9509. value = value.slice(start, +start + (length ? 1 : 0));
  9510. value.__actions__.push({
  9511. 'func': thru,
  9512. 'args': [interceptor],
  9513. 'thisArg': undefined
  9514. });
  9515. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9516. if (length && !array.length) {
  9517. array.push(undefined);
  9518. }
  9519. return array;
  9520. });
  9521. });
  9522. /**
  9523. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9524. *
  9525. * @name chain
  9526. * @memberOf _
  9527. * @since 0.1.0
  9528. * @category Seq
  9529. * @returns {Object} Returns the new `lodash` wrapper instance.
  9530. * @example
  9531. *
  9532. * var users = [
  9533. * { 'user': 'barney', 'age': 36 },
  9534. * { 'user': 'fred', 'age': 40 }
  9535. * ];
  9536. *
  9537. * // A sequence without explicit chaining.
  9538. * _(users).head();
  9539. * // => { 'user': 'barney', 'age': 36 }
  9540. *
  9541. * // A sequence with explicit chaining.
  9542. * _(users)
  9543. * .chain()
  9544. * .head()
  9545. * .pick('user')
  9546. * .value();
  9547. * // => { 'user': 'barney' }
  9548. */
  9549. function wrapperChain() {
  9550. return chain(this);
  9551. }
  9552. /**
  9553. * Executes the chain sequence and returns the wrapped result.
  9554. *
  9555. * @name commit
  9556. * @memberOf _
  9557. * @since 3.2.0
  9558. * @category Seq
  9559. * @returns {Object} Returns the new `lodash` wrapper instance.
  9560. * @example
  9561. *
  9562. * var array = [1, 2];
  9563. * var wrapped = _(array).push(3);
  9564. *
  9565. * console.log(array);
  9566. * // => [1, 2]
  9567. *
  9568. * wrapped = wrapped.commit();
  9569. * console.log(array);
  9570. * // => [1, 2, 3]
  9571. *
  9572. * wrapped.last();
  9573. * // => 3
  9574. *
  9575. * console.log(array);
  9576. * // => [1, 2, 3]
  9577. */
  9578. function wrapperCommit() {
  9579. return new LodashWrapper(this.value(), this.__chain__);
  9580. }
  9581. /**
  9582. * Gets the next value on a wrapped object following the
  9583. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9584. *
  9585. * @name next
  9586. * @memberOf _
  9587. * @since 4.0.0
  9588. * @category Seq
  9589. * @returns {Object} Returns the next iterator value.
  9590. * @example
  9591. *
  9592. * var wrapped = _([1, 2]);
  9593. *
  9594. * wrapped.next();
  9595. * // => { 'done': false, 'value': 1 }
  9596. *
  9597. * wrapped.next();
  9598. * // => { 'done': false, 'value': 2 }
  9599. *
  9600. * wrapped.next();
  9601. * // => { 'done': true, 'value': undefined }
  9602. */
  9603. function wrapperNext() {
  9604. if (this.__values__ === undefined) {
  9605. this.__values__ = toArray(this.value());
  9606. }
  9607. var done = this.__index__ >= this.__values__.length,
  9608. value = done ? undefined : this.__values__[this.__index__++];
  9609. return { 'done': done, 'value': value };
  9610. }
  9611. /**
  9612. * Enables the wrapper to be iterable.
  9613. *
  9614. * @name Symbol.iterator
  9615. * @memberOf _
  9616. * @since 4.0.0
  9617. * @category Seq
  9618. * @returns {Object} Returns the wrapper object.
  9619. * @example
  9620. *
  9621. * var wrapped = _([1, 2]);
  9622. *
  9623. * wrapped[Symbol.iterator]() === wrapped;
  9624. * // => true
  9625. *
  9626. * Array.from(wrapped);
  9627. * // => [1, 2]
  9628. */
  9629. function wrapperToIterator() {
  9630. return this;
  9631. }
  9632. /**
  9633. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9634. *
  9635. * @name plant
  9636. * @memberOf _
  9637. * @since 3.2.0
  9638. * @category Seq
  9639. * @param {*} value The value to plant.
  9640. * @returns {Object} Returns the new `lodash` wrapper instance.
  9641. * @example
  9642. *
  9643. * function square(n) {
  9644. * return n * n;
  9645. * }
  9646. *
  9647. * var wrapped = _([1, 2]).map(square);
  9648. * var other = wrapped.plant([3, 4]);
  9649. *
  9650. * other.value();
  9651. * // => [9, 16]
  9652. *
  9653. * wrapped.value();
  9654. * // => [1, 4]
  9655. */
  9656. function wrapperPlant(value) {
  9657. var result,
  9658. parent = this;
  9659. while (parent instanceof baseLodash) {
  9660. var clone = wrapperClone(parent);
  9661. clone.__index__ = 0;
  9662. clone.__values__ = undefined;
  9663. if (result) {
  9664. previous.__wrapped__ = clone;
  9665. } else {
  9666. result = clone;
  9667. }
  9668. var previous = clone;
  9669. parent = parent.__wrapped__;
  9670. }
  9671. previous.__wrapped__ = value;
  9672. return result;
  9673. }
  9674. /**
  9675. * This method is the wrapper version of `_.reverse`.
  9676. *
  9677. * **Note:** This method mutates the wrapped array.
  9678. *
  9679. * @name reverse
  9680. * @memberOf _
  9681. * @since 0.1.0
  9682. * @category Seq
  9683. * @returns {Object} Returns the new `lodash` wrapper instance.
  9684. * @example
  9685. *
  9686. * var array = [1, 2, 3];
  9687. *
  9688. * _(array).reverse().value()
  9689. * // => [3, 2, 1]
  9690. *
  9691. * console.log(array);
  9692. * // => [3, 2, 1]
  9693. */
  9694. function wrapperReverse() {
  9695. var value = this.__wrapped__;
  9696. if (value instanceof LazyWrapper) {
  9697. var wrapped = value;
  9698. if (this.__actions__.length) {
  9699. wrapped = new LazyWrapper(this);
  9700. }
  9701. wrapped = wrapped.reverse();
  9702. wrapped.__actions__.push({
  9703. 'func': thru,
  9704. 'args': [reverse],
  9705. 'thisArg': undefined
  9706. });
  9707. return new LodashWrapper(wrapped, this.__chain__);
  9708. }
  9709. return this.thru(reverse);
  9710. }
  9711. /**
  9712. * Executes the chain sequence to resolve the unwrapped value.
  9713. *
  9714. * @name value
  9715. * @memberOf _
  9716. * @since 0.1.0
  9717. * @alias toJSON, valueOf
  9718. * @category Seq
  9719. * @returns {*} Returns the resolved unwrapped value.
  9720. * @example
  9721. *
  9722. * _([1, 2, 3]).value();
  9723. * // => [1, 2, 3]
  9724. */
  9725. function wrapperValue() {
  9726. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9727. }
  9728. /*------------------------------------------------------------------------*/
  9729. /**
  9730. * Creates an object composed of keys generated from the results of running
  9731. * each element of `collection` thru `iteratee`. The corresponding value of
  9732. * each key is the number of times the key was returned by `iteratee`. The
  9733. * iteratee is invoked with one argument: (value).
  9734. *
  9735. * @static
  9736. * @memberOf _
  9737. * @since 0.5.0
  9738. * @category Collection
  9739. * @param {Array|Object} collection The collection to iterate over.
  9740. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9741. * @returns {Object} Returns the composed aggregate object.
  9742. * @example
  9743. *
  9744. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9745. * // => { '4': 1, '6': 2 }
  9746. *
  9747. * // The `_.property` iteratee shorthand.
  9748. * _.countBy(['one', 'two', 'three'], 'length');
  9749. * // => { '3': 2, '5': 1 }
  9750. */
  9751. var countBy = createAggregator(function(result, value, key) {
  9752. if (hasOwnProperty.call(result, key)) {
  9753. ++result[key];
  9754. } else {
  9755. baseAssignValue(result, key, 1);
  9756. }
  9757. });
  9758. /**
  9759. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9760. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9761. * invoked with three arguments: (value, index|key, collection).
  9762. *
  9763. * **Note:** This method returns `true` for
  9764. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9765. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9766. * elements of empty collections.
  9767. *
  9768. * @static
  9769. * @memberOf _
  9770. * @since 0.1.0
  9771. * @category Collection
  9772. * @param {Array|Object} collection The collection to iterate over.
  9773. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9774. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9775. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9776. * else `false`.
  9777. * @example
  9778. *
  9779. * _.every([true, 1, null, 'yes'], Boolean);
  9780. * // => false
  9781. *
  9782. * var users = [
  9783. * { 'user': 'barney', 'age': 36, 'active': false },
  9784. * { 'user': 'fred', 'age': 40, 'active': false }
  9785. * ];
  9786. *
  9787. * // The `_.matches` iteratee shorthand.
  9788. * _.every(users, { 'user': 'barney', 'active': false });
  9789. * // => false
  9790. *
  9791. * // The `_.matchesProperty` iteratee shorthand.
  9792. * _.every(users, ['active', false]);
  9793. * // => true
  9794. *
  9795. * // The `_.property` iteratee shorthand.
  9796. * _.every(users, 'active');
  9797. * // => false
  9798. */
  9799. function every(collection, predicate, guard) {
  9800. var func = isArray(collection) ? arrayEvery : baseEvery;
  9801. if (guard && isIterateeCall(collection, predicate, guard)) {
  9802. predicate = undefined;
  9803. }
  9804. return func(collection, getIteratee(predicate, 3));
  9805. }
  9806. /**
  9807. * Iterates over elements of `collection`, returning an array of all elements
  9808. * `predicate` returns truthy for. The predicate is invoked with three
  9809. * arguments: (value, index|key, collection).
  9810. *
  9811. * **Note:** Unlike `_.remove`, this method returns a new array.
  9812. *
  9813. * @static
  9814. * @memberOf _
  9815. * @since 0.1.0
  9816. * @category Collection
  9817. * @param {Array|Object} collection The collection to iterate over.
  9818. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9819. * @returns {Array} Returns the new filtered array.
  9820. * @see _.reject
  9821. * @example
  9822. *
  9823. * var users = [
  9824. * { 'user': 'barney', 'age': 36, 'active': true },
  9825. * { 'user': 'fred', 'age': 40, 'active': false }
  9826. * ];
  9827. *
  9828. * _.filter(users, function(o) { return !o.active; });
  9829. * // => objects for ['fred']
  9830. *
  9831. * // The `_.matches` iteratee shorthand.
  9832. * _.filter(users, { 'age': 36, 'active': true });
  9833. * // => objects for ['barney']
  9834. *
  9835. * // The `_.matchesProperty` iteratee shorthand.
  9836. * _.filter(users, ['active', false]);
  9837. * // => objects for ['fred']
  9838. *
  9839. * // The `_.property` iteratee shorthand.
  9840. * _.filter(users, 'active');
  9841. * // => objects for ['barney']
  9842. *
  9843. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9844. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9845. * // => objects for ['fred', 'barney']
  9846. */
  9847. function filter(collection, predicate) {
  9848. var func = isArray(collection) ? arrayFilter : baseFilter;
  9849. return func(collection, getIteratee(predicate, 3));
  9850. }
  9851. /**
  9852. * Iterates over elements of `collection`, returning the first element
  9853. * `predicate` returns truthy for. The predicate is invoked with three
  9854. * arguments: (value, index|key, collection).
  9855. *
  9856. * @static
  9857. * @memberOf _
  9858. * @since 0.1.0
  9859. * @category Collection
  9860. * @param {Array|Object} collection The collection to inspect.
  9861. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9862. * @param {number} [fromIndex=0] The index to search from.
  9863. * @returns {*} Returns the matched element, else `undefined`.
  9864. * @example
  9865. *
  9866. * var users = [
  9867. * { 'user': 'barney', 'age': 36, 'active': true },
  9868. * { 'user': 'fred', 'age': 40, 'active': false },
  9869. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9870. * ];
  9871. *
  9872. * _.find(users, function(o) { return o.age < 40; });
  9873. * // => object for 'barney'
  9874. *
  9875. * // The `_.matches` iteratee shorthand.
  9876. * _.find(users, { 'age': 1, 'active': true });
  9877. * // => object for 'pebbles'
  9878. *
  9879. * // The `_.matchesProperty` iteratee shorthand.
  9880. * _.find(users, ['active', false]);
  9881. * // => object for 'fred'
  9882. *
  9883. * // The `_.property` iteratee shorthand.
  9884. * _.find(users, 'active');
  9885. * // => object for 'barney'
  9886. */
  9887. var find = createFind(findIndex);
  9888. /**
  9889. * This method is like `_.find` except that it iterates over elements of
  9890. * `collection` from right to left.
  9891. *
  9892. * @static
  9893. * @memberOf _
  9894. * @since 2.0.0
  9895. * @category Collection
  9896. * @param {Array|Object} collection The collection to inspect.
  9897. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9898. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9899. * @returns {*} Returns the matched element, else `undefined`.
  9900. * @example
  9901. *
  9902. * _.findLast([1, 2, 3, 4], function(n) {
  9903. * return n % 2 == 1;
  9904. * });
  9905. * // => 3
  9906. */
  9907. var findLast = createFind(findLastIndex);
  9908. /**
  9909. * Creates a flattened array of values by running each element in `collection`
  9910. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9911. * with three arguments: (value, index|key, collection).
  9912. *
  9913. * @static
  9914. * @memberOf _
  9915. * @since 4.0.0
  9916. * @category Collection
  9917. * @param {Array|Object} collection The collection to iterate over.
  9918. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9919. * @returns {Array} Returns the new flattened array.
  9920. * @example
  9921. *
  9922. * function duplicate(n) {
  9923. * return [n, n];
  9924. * }
  9925. *
  9926. * _.flatMap([1, 2], duplicate);
  9927. * // => [1, 1, 2, 2]
  9928. */
  9929. function flatMap(collection, iteratee) {
  9930. return baseFlatten(map(collection, iteratee), 1);
  9931. }
  9932. /**
  9933. * This method is like `_.flatMap` except that it recursively flattens the
  9934. * mapped results.
  9935. *
  9936. * @static
  9937. * @memberOf _
  9938. * @since 4.7.0
  9939. * @category Collection
  9940. * @param {Array|Object} collection The collection to iterate over.
  9941. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9942. * @returns {Array} Returns the new flattened array.
  9943. * @example
  9944. *
  9945. * function duplicate(n) {
  9946. * return [[[n, n]]];
  9947. * }
  9948. *
  9949. * _.flatMapDeep([1, 2], duplicate);
  9950. * // => [1, 1, 2, 2]
  9951. */
  9952. function flatMapDeep(collection, iteratee) {
  9953. return baseFlatten(map(collection, iteratee), INFINITY);
  9954. }
  9955. /**
  9956. * This method is like `_.flatMap` except that it recursively flattens the
  9957. * mapped results up to `depth` times.
  9958. *
  9959. * @static
  9960. * @memberOf _
  9961. * @since 4.7.0
  9962. * @category Collection
  9963. * @param {Array|Object} collection The collection to iterate over.
  9964. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9965. * @param {number} [depth=1] The maximum recursion depth.
  9966. * @returns {Array} Returns the new flattened array.
  9967. * @example
  9968. *
  9969. * function duplicate(n) {
  9970. * return [[[n, n]]];
  9971. * }
  9972. *
  9973. * _.flatMapDepth([1, 2], duplicate, 2);
  9974. * // => [[1, 1], [2, 2]]
  9975. */
  9976. function flatMapDepth(collection, iteratee, depth) {
  9977. depth = depth === undefined ? 1 : toInteger(depth);
  9978. return baseFlatten(map(collection, iteratee), depth);
  9979. }
  9980. /**
  9981. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9982. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9983. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9984. *
  9985. * **Note:** As with other "Collections" methods, objects with a "length"
  9986. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9987. * or `_.forOwn` for object iteration.
  9988. *
  9989. * @static
  9990. * @memberOf _
  9991. * @since 0.1.0
  9992. * @alias each
  9993. * @category Collection
  9994. * @param {Array|Object} collection The collection to iterate over.
  9995. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9996. * @returns {Array|Object} Returns `collection`.
  9997. * @see _.forEachRight
  9998. * @example
  9999. *
  10000. * _.forEach([1, 2], function(value) {
  10001. * console.log(value);
  10002. * });
  10003. * // => Logs `1` then `2`.
  10004. *
  10005. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10006. * console.log(key);
  10007. * });
  10008. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10009. */
  10010. function forEach(collection, iteratee) {
  10011. var func = isArray(collection) ? arrayEach : baseEach;
  10012. return func(collection, getIteratee(iteratee, 3));
  10013. }
  10014. /**
  10015. * This method is like `_.forEach` except that it iterates over elements of
  10016. * `collection` from right to left.
  10017. *
  10018. * @static
  10019. * @memberOf _
  10020. * @since 2.0.0
  10021. * @alias eachRight
  10022. * @category Collection
  10023. * @param {Array|Object} collection The collection to iterate over.
  10024. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10025. * @returns {Array|Object} Returns `collection`.
  10026. * @see _.forEach
  10027. * @example
  10028. *
  10029. * _.forEachRight([1, 2], function(value) {
  10030. * console.log(value);
  10031. * });
  10032. * // => Logs `2` then `1`.
  10033. */
  10034. function forEachRight(collection, iteratee) {
  10035. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10036. return func(collection, getIteratee(iteratee, 3));
  10037. }
  10038. /**
  10039. * Creates an object composed of keys generated from the results of running
  10040. * each element of `collection` thru `iteratee`. The order of grouped values
  10041. * is determined by the order they occur in `collection`. The corresponding
  10042. * value of each key is an array of elements responsible for generating the
  10043. * key. The iteratee is invoked with one argument: (value).
  10044. *
  10045. * @static
  10046. * @memberOf _
  10047. * @since 0.1.0
  10048. * @category Collection
  10049. * @param {Array|Object} collection The collection to iterate over.
  10050. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10051. * @returns {Object} Returns the composed aggregate object.
  10052. * @example
  10053. *
  10054. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10055. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10056. *
  10057. * // The `_.property` iteratee shorthand.
  10058. * _.groupBy(['one', 'two', 'three'], 'length');
  10059. * // => { '3': ['one', 'two'], '5': ['three'] }
  10060. */
  10061. var groupBy = createAggregator(function(result, value, key) {
  10062. if (hasOwnProperty.call(result, key)) {
  10063. result[key].push(value);
  10064. } else {
  10065. baseAssignValue(result, key, [value]);
  10066. }
  10067. });
  10068. /**
  10069. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10070. * checked for a substring of `value`, otherwise
  10071. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10072. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10073. * the offset from the end of `collection`.
  10074. *
  10075. * @static
  10076. * @memberOf _
  10077. * @since 0.1.0
  10078. * @category Collection
  10079. * @param {Array|Object|string} collection The collection to inspect.
  10080. * @param {*} value The value to search for.
  10081. * @param {number} [fromIndex=0] The index to search from.
  10082. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10083. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10084. * @example
  10085. *
  10086. * _.includes([1, 2, 3], 1);
  10087. * // => true
  10088. *
  10089. * _.includes([1, 2, 3], 1, 2);
  10090. * // => false
  10091. *
  10092. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10093. * // => true
  10094. *
  10095. * _.includes('abcd', 'bc');
  10096. * // => true
  10097. */
  10098. function includes(collection, value, fromIndex, guard) {
  10099. collection = isArrayLike(collection) ? collection : values(collection);
  10100. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10101. var length = collection.length;
  10102. if (fromIndex < 0) {
  10103. fromIndex = nativeMax(length + fromIndex, 0);
  10104. }
  10105. return isString(collection)
  10106. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10107. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10108. }
  10109. /**
  10110. * Invokes the method at `path` of each element in `collection`, returning
  10111. * an array of the results of each invoked method. Any additional arguments
  10112. * are provided to each invoked method. If `path` is a function, it's invoked
  10113. * for, and `this` bound to, each element in `collection`.
  10114. *
  10115. * @static
  10116. * @memberOf _
  10117. * @since 4.0.0
  10118. * @category Collection
  10119. * @param {Array|Object} collection The collection to iterate over.
  10120. * @param {Array|Function|string} path The path of the method to invoke or
  10121. * the function invoked per iteration.
  10122. * @param {...*} [args] The arguments to invoke each method with.
  10123. * @returns {Array} Returns the array of results.
  10124. * @example
  10125. *
  10126. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10127. * // => [[1, 5, 7], [1, 2, 3]]
  10128. *
  10129. * _.invokeMap([123, 456], String.prototype.split, '');
  10130. * // => [['1', '2', '3'], ['4', '5', '6']]
  10131. */
  10132. var invokeMap = baseRest(function(collection, path, args) {
  10133. var index = -1,
  10134. isFunc = typeof path == 'function',
  10135. result = isArrayLike(collection) ? Array(collection.length) : [];
  10136. baseEach(collection, function(value) {
  10137. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10138. });
  10139. return result;
  10140. });
  10141. /**
  10142. * Creates an object composed of keys generated from the results of running
  10143. * each element of `collection` thru `iteratee`. The corresponding value of
  10144. * each key is the last element responsible for generating the key. The
  10145. * iteratee is invoked with one argument: (value).
  10146. *
  10147. * @static
  10148. * @memberOf _
  10149. * @since 4.0.0
  10150. * @category Collection
  10151. * @param {Array|Object} collection The collection to iterate over.
  10152. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10153. * @returns {Object} Returns the composed aggregate object.
  10154. * @example
  10155. *
  10156. * var array = [
  10157. * { 'dir': 'left', 'code': 97 },
  10158. * { 'dir': 'right', 'code': 100 }
  10159. * ];
  10160. *
  10161. * _.keyBy(array, function(o) {
  10162. * return String.fromCharCode(o.code);
  10163. * });
  10164. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10165. *
  10166. * _.keyBy(array, 'dir');
  10167. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10168. */
  10169. var keyBy = createAggregator(function(result, value, key) {
  10170. baseAssignValue(result, key, value);
  10171. });
  10172. /**
  10173. * Creates an array of values by running each element in `collection` thru
  10174. * `iteratee`. The iteratee is invoked with three arguments:
  10175. * (value, index|key, collection).
  10176. *
  10177. * Many lodash methods are guarded to work as iteratees for methods like
  10178. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10179. *
  10180. * The guarded methods are:
  10181. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10182. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10183. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10184. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10185. *
  10186. * @static
  10187. * @memberOf _
  10188. * @since 0.1.0
  10189. * @category Collection
  10190. * @param {Array|Object} collection The collection to iterate over.
  10191. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10192. * @returns {Array} Returns the new mapped array.
  10193. * @example
  10194. *
  10195. * function square(n) {
  10196. * return n * n;
  10197. * }
  10198. *
  10199. * _.map([4, 8], square);
  10200. * // => [16, 64]
  10201. *
  10202. * _.map({ 'a': 4, 'b': 8 }, square);
  10203. * // => [16, 64] (iteration order is not guaranteed)
  10204. *
  10205. * var users = [
  10206. * { 'user': 'barney' },
  10207. * { 'user': 'fred' }
  10208. * ];
  10209. *
  10210. * // The `_.property` iteratee shorthand.
  10211. * _.map(users, 'user');
  10212. * // => ['barney', 'fred']
  10213. */
  10214. function map(collection, iteratee) {
  10215. var func = isArray(collection) ? arrayMap : baseMap;
  10216. return func(collection, getIteratee(iteratee, 3));
  10217. }
  10218. /**
  10219. * This method is like `_.sortBy` except that it allows specifying the sort
  10220. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10221. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10222. * descending or "asc" for ascending sort order of corresponding values.
  10223. *
  10224. * @static
  10225. * @memberOf _
  10226. * @since 4.0.0
  10227. * @category Collection
  10228. * @param {Array|Object} collection The collection to iterate over.
  10229. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10230. * The iteratees to sort by.
  10231. * @param {string[]} [orders] The sort orders of `iteratees`.
  10232. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10233. * @returns {Array} Returns the new sorted array.
  10234. * @example
  10235. *
  10236. * var users = [
  10237. * { 'user': 'fred', 'age': 48 },
  10238. * { 'user': 'barney', 'age': 34 },
  10239. * { 'user': 'fred', 'age': 40 },
  10240. * { 'user': 'barney', 'age': 36 }
  10241. * ];
  10242. *
  10243. * // Sort by `user` in ascending order and by `age` in descending order.
  10244. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10245. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10246. */
  10247. function orderBy(collection, iteratees, orders, guard) {
  10248. if (collection == null) {
  10249. return [];
  10250. }
  10251. if (!isArray(iteratees)) {
  10252. iteratees = iteratees == null ? [] : [iteratees];
  10253. }
  10254. orders = guard ? undefined : orders;
  10255. if (!isArray(orders)) {
  10256. orders = orders == null ? [] : [orders];
  10257. }
  10258. return baseOrderBy(collection, iteratees, orders);
  10259. }
  10260. /**
  10261. * Creates an array of elements split into two groups, the first of which
  10262. * contains elements `predicate` returns truthy for, the second of which
  10263. * contains elements `predicate` returns falsey for. The predicate is
  10264. * invoked with one argument: (value).
  10265. *
  10266. * @static
  10267. * @memberOf _
  10268. * @since 3.0.0
  10269. * @category Collection
  10270. * @param {Array|Object} collection The collection to iterate over.
  10271. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10272. * @returns {Array} Returns the array of grouped elements.
  10273. * @example
  10274. *
  10275. * var users = [
  10276. * { 'user': 'barney', 'age': 36, 'active': false },
  10277. * { 'user': 'fred', 'age': 40, 'active': true },
  10278. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10279. * ];
  10280. *
  10281. * _.partition(users, function(o) { return o.active; });
  10282. * // => objects for [['fred'], ['barney', 'pebbles']]
  10283. *
  10284. * // The `_.matches` iteratee shorthand.
  10285. * _.partition(users, { 'age': 1, 'active': false });
  10286. * // => objects for [['pebbles'], ['barney', 'fred']]
  10287. *
  10288. * // The `_.matchesProperty` iteratee shorthand.
  10289. * _.partition(users, ['active', false]);
  10290. * // => objects for [['barney', 'pebbles'], ['fred']]
  10291. *
  10292. * // The `_.property` iteratee shorthand.
  10293. * _.partition(users, 'active');
  10294. * // => objects for [['fred'], ['barney', 'pebbles']]
  10295. */
  10296. var partition = createAggregator(function(result, value, key) {
  10297. result[key ? 0 : 1].push(value);
  10298. }, function() { return [[], []]; });
  10299. /**
  10300. * Reduces `collection` to a value which is the accumulated result of running
  10301. * each element in `collection` thru `iteratee`, where each successive
  10302. * invocation is supplied the return value of the previous. If `accumulator`
  10303. * is not given, the first element of `collection` is used as the initial
  10304. * value. The iteratee is invoked with four arguments:
  10305. * (accumulator, value, index|key, collection).
  10306. *
  10307. * Many lodash methods are guarded to work as iteratees for methods like
  10308. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10309. *
  10310. * The guarded methods are:
  10311. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10312. * and `sortBy`
  10313. *
  10314. * @static
  10315. * @memberOf _
  10316. * @since 0.1.0
  10317. * @category Collection
  10318. * @param {Array|Object} collection The collection to iterate over.
  10319. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10320. * @param {*} [accumulator] The initial value.
  10321. * @returns {*} Returns the accumulated value.
  10322. * @see _.reduceRight
  10323. * @example
  10324. *
  10325. * _.reduce([1, 2], function(sum, n) {
  10326. * return sum + n;
  10327. * }, 0);
  10328. * // => 3
  10329. *
  10330. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10331. * (result[value] || (result[value] = [])).push(key);
  10332. * return result;
  10333. * }, {});
  10334. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10335. */
  10336. function reduce(collection, iteratee, accumulator) {
  10337. var func = isArray(collection) ? arrayReduce : baseReduce,
  10338. initAccum = arguments.length < 3;
  10339. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10340. }
  10341. /**
  10342. * This method is like `_.reduce` except that it iterates over elements of
  10343. * `collection` from right to left.
  10344. *
  10345. * @static
  10346. * @memberOf _
  10347. * @since 0.1.0
  10348. * @category Collection
  10349. * @param {Array|Object} collection The collection to iterate over.
  10350. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10351. * @param {*} [accumulator] The initial value.
  10352. * @returns {*} Returns the accumulated value.
  10353. * @see _.reduce
  10354. * @example
  10355. *
  10356. * var array = [[0, 1], [2, 3], [4, 5]];
  10357. *
  10358. * _.reduceRight(array, function(flattened, other) {
  10359. * return flattened.concat(other);
  10360. * }, []);
  10361. * // => [4, 5, 2, 3, 0, 1]
  10362. */
  10363. function reduceRight(collection, iteratee, accumulator) {
  10364. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10365. initAccum = arguments.length < 3;
  10366. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10367. }
  10368. /**
  10369. * The opposite of `_.filter`; this method returns the elements of `collection`
  10370. * that `predicate` does **not** return truthy for.
  10371. *
  10372. * @static
  10373. * @memberOf _
  10374. * @since 0.1.0
  10375. * @category Collection
  10376. * @param {Array|Object} collection The collection to iterate over.
  10377. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10378. * @returns {Array} Returns the new filtered array.
  10379. * @see _.filter
  10380. * @example
  10381. *
  10382. * var users = [
  10383. * { 'user': 'barney', 'age': 36, 'active': false },
  10384. * { 'user': 'fred', 'age': 40, 'active': true }
  10385. * ];
  10386. *
  10387. * _.reject(users, function(o) { return !o.active; });
  10388. * // => objects for ['fred']
  10389. *
  10390. * // The `_.matches` iteratee shorthand.
  10391. * _.reject(users, { 'age': 40, 'active': true });
  10392. * // => objects for ['barney']
  10393. *
  10394. * // The `_.matchesProperty` iteratee shorthand.
  10395. * _.reject(users, ['active', false]);
  10396. * // => objects for ['fred']
  10397. *
  10398. * // The `_.property` iteratee shorthand.
  10399. * _.reject(users, 'active');
  10400. * // => objects for ['barney']
  10401. */
  10402. function reject(collection, predicate) {
  10403. var func = isArray(collection) ? arrayFilter : baseFilter;
  10404. return func(collection, negate(getIteratee(predicate, 3)));
  10405. }
  10406. /**
  10407. * Gets a random element from `collection`.
  10408. *
  10409. * @static
  10410. * @memberOf _
  10411. * @since 2.0.0
  10412. * @category Collection
  10413. * @param {Array|Object} collection The collection to sample.
  10414. * @returns {*} Returns the random element.
  10415. * @example
  10416. *
  10417. * _.sample([1, 2, 3, 4]);
  10418. * // => 2
  10419. */
  10420. function sample(collection) {
  10421. var func = isArray(collection) ? arraySample : baseSample;
  10422. return func(collection);
  10423. }
  10424. /**
  10425. * Gets `n` random elements at unique keys from `collection` up to the
  10426. * size of `collection`.
  10427. *
  10428. * @static
  10429. * @memberOf _
  10430. * @since 4.0.0
  10431. * @category Collection
  10432. * @param {Array|Object} collection The collection to sample.
  10433. * @param {number} [n=1] The number of elements to sample.
  10434. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10435. * @returns {Array} Returns the random elements.
  10436. * @example
  10437. *
  10438. * _.sampleSize([1, 2, 3], 2);
  10439. * // => [3, 1]
  10440. *
  10441. * _.sampleSize([1, 2, 3], 4);
  10442. * // => [2, 3, 1]
  10443. */
  10444. function sampleSize(collection, n, guard) {
  10445. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10446. n = 1;
  10447. } else {
  10448. n = toInteger(n);
  10449. }
  10450. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10451. return func(collection, n);
  10452. }
  10453. /**
  10454. * Creates an array of shuffled values, using a version of the
  10455. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10456. *
  10457. * @static
  10458. * @memberOf _
  10459. * @since 0.1.0
  10460. * @category Collection
  10461. * @param {Array|Object} collection The collection to shuffle.
  10462. * @returns {Array} Returns the new shuffled array.
  10463. * @example
  10464. *
  10465. * _.shuffle([1, 2, 3, 4]);
  10466. * // => [4, 1, 3, 2]
  10467. */
  10468. function shuffle(collection) {
  10469. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10470. return func(collection);
  10471. }
  10472. /**
  10473. * Gets the size of `collection` by returning its length for array-like
  10474. * values or the number of own enumerable string keyed properties for objects.
  10475. *
  10476. * @static
  10477. * @memberOf _
  10478. * @since 0.1.0
  10479. * @category Collection
  10480. * @param {Array|Object|string} collection The collection to inspect.
  10481. * @returns {number} Returns the collection size.
  10482. * @example
  10483. *
  10484. * _.size([1, 2, 3]);
  10485. * // => 3
  10486. *
  10487. * _.size({ 'a': 1, 'b': 2 });
  10488. * // => 2
  10489. *
  10490. * _.size('pebbles');
  10491. * // => 7
  10492. */
  10493. function size(collection) {
  10494. if (collection == null) {
  10495. return 0;
  10496. }
  10497. if (isArrayLike(collection)) {
  10498. return isString(collection) ? stringSize(collection) : collection.length;
  10499. }
  10500. var tag = getTag(collection);
  10501. if (tag == mapTag || tag == setTag) {
  10502. return collection.size;
  10503. }
  10504. return baseKeys(collection).length;
  10505. }
  10506. /**
  10507. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10508. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10509. * invoked with three arguments: (value, index|key, collection).
  10510. *
  10511. * @static
  10512. * @memberOf _
  10513. * @since 0.1.0
  10514. * @category Collection
  10515. * @param {Array|Object} collection The collection to iterate over.
  10516. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10517. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10518. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10519. * else `false`.
  10520. * @example
  10521. *
  10522. * _.some([null, 0, 'yes', false], Boolean);
  10523. * // => true
  10524. *
  10525. * var users = [
  10526. * { 'user': 'barney', 'active': true },
  10527. * { 'user': 'fred', 'active': false }
  10528. * ];
  10529. *
  10530. * // The `_.matches` iteratee shorthand.
  10531. * _.some(users, { 'user': 'barney', 'active': false });
  10532. * // => false
  10533. *
  10534. * // The `_.matchesProperty` iteratee shorthand.
  10535. * _.some(users, ['active', false]);
  10536. * // => true
  10537. *
  10538. * // The `_.property` iteratee shorthand.
  10539. * _.some(users, 'active');
  10540. * // => true
  10541. */
  10542. function some(collection, predicate, guard) {
  10543. var func = isArray(collection) ? arraySome : baseSome;
  10544. if (guard && isIterateeCall(collection, predicate, guard)) {
  10545. predicate = undefined;
  10546. }
  10547. return func(collection, getIteratee(predicate, 3));
  10548. }
  10549. /**
  10550. * Creates an array of elements, sorted in ascending order by the results of
  10551. * running each element in a collection thru each iteratee. This method
  10552. * performs a stable sort, that is, it preserves the original sort order of
  10553. * equal elements. The iteratees are invoked with one argument: (value).
  10554. *
  10555. * @static
  10556. * @memberOf _
  10557. * @since 0.1.0
  10558. * @category Collection
  10559. * @param {Array|Object} collection The collection to iterate over.
  10560. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10561. * The iteratees to sort by.
  10562. * @returns {Array} Returns the new sorted array.
  10563. * @example
  10564. *
  10565. * var users = [
  10566. * { 'user': 'fred', 'age': 48 },
  10567. * { 'user': 'barney', 'age': 36 },
  10568. * { 'user': 'fred', 'age': 30 },
  10569. * { 'user': 'barney', 'age': 34 }
  10570. * ];
  10571. *
  10572. * _.sortBy(users, [function(o) { return o.user; }]);
  10573. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10574. *
  10575. * _.sortBy(users, ['user', 'age']);
  10576. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10577. */
  10578. var sortBy = baseRest(function(collection, iteratees) {
  10579. if (collection == null) {
  10580. return [];
  10581. }
  10582. var length = iteratees.length;
  10583. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10584. iteratees = [];
  10585. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10586. iteratees = [iteratees[0]];
  10587. }
  10588. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10589. });
  10590. /*------------------------------------------------------------------------*/
  10591. /**
  10592. * Gets the timestamp of the number of milliseconds that have elapsed since
  10593. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10594. *
  10595. * @static
  10596. * @memberOf _
  10597. * @since 2.4.0
  10598. * @category Date
  10599. * @returns {number} Returns the timestamp.
  10600. * @example
  10601. *
  10602. * _.defer(function(stamp) {
  10603. * console.log(_.now() - stamp);
  10604. * }, _.now());
  10605. * // => Logs the number of milliseconds it took for the deferred invocation.
  10606. */
  10607. var now = ctxNow || function() {
  10608. return root.Date.now();
  10609. };
  10610. /*------------------------------------------------------------------------*/
  10611. /**
  10612. * The opposite of `_.before`; this method creates a function that invokes
  10613. * `func` once it's called `n` or more times.
  10614. *
  10615. * @static
  10616. * @memberOf _
  10617. * @since 0.1.0
  10618. * @category Function
  10619. * @param {number} n The number of calls before `func` is invoked.
  10620. * @param {Function} func The function to restrict.
  10621. * @returns {Function} Returns the new restricted function.
  10622. * @example
  10623. *
  10624. * var saves = ['profile', 'settings'];
  10625. *
  10626. * var done = _.after(saves.length, function() {
  10627. * console.log('done saving!');
  10628. * });
  10629. *
  10630. * _.forEach(saves, function(type) {
  10631. * asyncSave({ 'type': type, 'complete': done });
  10632. * });
  10633. * // => Logs 'done saving!' after the two async saves have completed.
  10634. */
  10635. function after(n, func) {
  10636. if (typeof func != 'function') {
  10637. throw new TypeError(FUNC_ERROR_TEXT);
  10638. }
  10639. n = toInteger(n);
  10640. return function() {
  10641. if (--n < 1) {
  10642. return func.apply(this, arguments);
  10643. }
  10644. };
  10645. }
  10646. /**
  10647. * Creates a function that invokes `func`, with up to `n` arguments,
  10648. * ignoring any additional arguments.
  10649. *
  10650. * @static
  10651. * @memberOf _
  10652. * @since 3.0.0
  10653. * @category Function
  10654. * @param {Function} func The function to cap arguments for.
  10655. * @param {number} [n=func.length] The arity cap.
  10656. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10657. * @returns {Function} Returns the new capped function.
  10658. * @example
  10659. *
  10660. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10661. * // => [6, 8, 10]
  10662. */
  10663. function ary(func, n, guard) {
  10664. n = guard ? undefined : n;
  10665. n = (func && n == null) ? func.length : n;
  10666. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10667. }
  10668. /**
  10669. * Creates a function that invokes `func`, with the `this` binding and arguments
  10670. * of the created function, while it's called less than `n` times. Subsequent
  10671. * calls to the created function return the result of the last `func` invocation.
  10672. *
  10673. * @static
  10674. * @memberOf _
  10675. * @since 3.0.0
  10676. * @category Function
  10677. * @param {number} n The number of calls at which `func` is no longer invoked.
  10678. * @param {Function} func The function to restrict.
  10679. * @returns {Function} Returns the new restricted function.
  10680. * @example
  10681. *
  10682. * jQuery(element).on('click', _.before(5, addContactToList));
  10683. * // => Allows adding up to 4 contacts to the list.
  10684. */
  10685. function before(n, func) {
  10686. var result;
  10687. if (typeof func != 'function') {
  10688. throw new TypeError(FUNC_ERROR_TEXT);
  10689. }
  10690. n = toInteger(n);
  10691. return function() {
  10692. if (--n > 0) {
  10693. result = func.apply(this, arguments);
  10694. }
  10695. if (n <= 1) {
  10696. func = undefined;
  10697. }
  10698. return result;
  10699. };
  10700. }
  10701. /**
  10702. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10703. * and `partials` prepended to the arguments it receives.
  10704. *
  10705. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10706. * may be used as a placeholder for partially applied arguments.
  10707. *
  10708. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10709. * property of bound functions.
  10710. *
  10711. * @static
  10712. * @memberOf _
  10713. * @since 0.1.0
  10714. * @category Function
  10715. * @param {Function} func The function to bind.
  10716. * @param {*} thisArg The `this` binding of `func`.
  10717. * @param {...*} [partials] The arguments to be partially applied.
  10718. * @returns {Function} Returns the new bound function.
  10719. * @example
  10720. *
  10721. * function greet(greeting, punctuation) {
  10722. * return greeting + ' ' + this.user + punctuation;
  10723. * }
  10724. *
  10725. * var object = { 'user': 'fred' };
  10726. *
  10727. * var bound = _.bind(greet, object, 'hi');
  10728. * bound('!');
  10729. * // => 'hi fred!'
  10730. *
  10731. * // Bound with placeholders.
  10732. * var bound = _.bind(greet, object, _, '!');
  10733. * bound('hi');
  10734. * // => 'hi fred!'
  10735. */
  10736. var bind = baseRest(function(func, thisArg, partials) {
  10737. var bitmask = WRAP_BIND_FLAG;
  10738. if (partials.length) {
  10739. var holders = replaceHolders(partials, getHolder(bind));
  10740. bitmask |= WRAP_PARTIAL_FLAG;
  10741. }
  10742. return createWrap(func, bitmask, thisArg, partials, holders);
  10743. });
  10744. /**
  10745. * Creates a function that invokes the method at `object[key]` with `partials`
  10746. * prepended to the arguments it receives.
  10747. *
  10748. * This method differs from `_.bind` by allowing bound functions to reference
  10749. * methods that may be redefined or don't yet exist. See
  10750. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10751. * for more details.
  10752. *
  10753. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10754. * builds, may be used as a placeholder for partially applied arguments.
  10755. *
  10756. * @static
  10757. * @memberOf _
  10758. * @since 0.10.0
  10759. * @category Function
  10760. * @param {Object} object The object to invoke the method on.
  10761. * @param {string} key The key of the method.
  10762. * @param {...*} [partials] The arguments to be partially applied.
  10763. * @returns {Function} Returns the new bound function.
  10764. * @example
  10765. *
  10766. * var object = {
  10767. * 'user': 'fred',
  10768. * 'greet': function(greeting, punctuation) {
  10769. * return greeting + ' ' + this.user + punctuation;
  10770. * }
  10771. * };
  10772. *
  10773. * var bound = _.bindKey(object, 'greet', 'hi');
  10774. * bound('!');
  10775. * // => 'hi fred!'
  10776. *
  10777. * object.greet = function(greeting, punctuation) {
  10778. * return greeting + 'ya ' + this.user + punctuation;
  10779. * };
  10780. *
  10781. * bound('!');
  10782. * // => 'hiya fred!'
  10783. *
  10784. * // Bound with placeholders.
  10785. * var bound = _.bindKey(object, 'greet', _, '!');
  10786. * bound('hi');
  10787. * // => 'hiya fred!'
  10788. */
  10789. var bindKey = baseRest(function(object, key, partials) {
  10790. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10791. if (partials.length) {
  10792. var holders = replaceHolders(partials, getHolder(bindKey));
  10793. bitmask |= WRAP_PARTIAL_FLAG;
  10794. }
  10795. return createWrap(key, bitmask, object, partials, holders);
  10796. });
  10797. /**
  10798. * Creates a function that accepts arguments of `func` and either invokes
  10799. * `func` returning its result, if at least `arity` number of arguments have
  10800. * been provided, or returns a function that accepts the remaining `func`
  10801. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10802. * is not sufficient.
  10803. *
  10804. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10805. * may be used as a placeholder for provided arguments.
  10806. *
  10807. * **Note:** This method doesn't set the "length" property of curried functions.
  10808. *
  10809. * @static
  10810. * @memberOf _
  10811. * @since 2.0.0
  10812. * @category Function
  10813. * @param {Function} func The function to curry.
  10814. * @param {number} [arity=func.length] The arity of `func`.
  10815. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10816. * @returns {Function} Returns the new curried function.
  10817. * @example
  10818. *
  10819. * var abc = function(a, b, c) {
  10820. * return [a, b, c];
  10821. * };
  10822. *
  10823. * var curried = _.curry(abc);
  10824. *
  10825. * curried(1)(2)(3);
  10826. * // => [1, 2, 3]
  10827. *
  10828. * curried(1, 2)(3);
  10829. * // => [1, 2, 3]
  10830. *
  10831. * curried(1, 2, 3);
  10832. * // => [1, 2, 3]
  10833. *
  10834. * // Curried with placeholders.
  10835. * curried(1)(_, 3)(2);
  10836. * // => [1, 2, 3]
  10837. */
  10838. function curry(func, arity, guard) {
  10839. arity = guard ? undefined : arity;
  10840. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10841. result.placeholder = curry.placeholder;
  10842. return result;
  10843. }
  10844. /**
  10845. * This method is like `_.curry` except that arguments are applied to `func`
  10846. * in the manner of `_.partialRight` instead of `_.partial`.
  10847. *
  10848. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10849. * builds, may be used as a placeholder for provided arguments.
  10850. *
  10851. * **Note:** This method doesn't set the "length" property of curried functions.
  10852. *
  10853. * @static
  10854. * @memberOf _
  10855. * @since 3.0.0
  10856. * @category Function
  10857. * @param {Function} func The function to curry.
  10858. * @param {number} [arity=func.length] The arity of `func`.
  10859. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10860. * @returns {Function} Returns the new curried function.
  10861. * @example
  10862. *
  10863. * var abc = function(a, b, c) {
  10864. * return [a, b, c];
  10865. * };
  10866. *
  10867. * var curried = _.curryRight(abc);
  10868. *
  10869. * curried(3)(2)(1);
  10870. * // => [1, 2, 3]
  10871. *
  10872. * curried(2, 3)(1);
  10873. * // => [1, 2, 3]
  10874. *
  10875. * curried(1, 2, 3);
  10876. * // => [1, 2, 3]
  10877. *
  10878. * // Curried with placeholders.
  10879. * curried(3)(1, _)(2);
  10880. * // => [1, 2, 3]
  10881. */
  10882. function curryRight(func, arity, guard) {
  10883. arity = guard ? undefined : arity;
  10884. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10885. result.placeholder = curryRight.placeholder;
  10886. return result;
  10887. }
  10888. /**
  10889. * Creates a debounced function that delays invoking `func` until after `wait`
  10890. * milliseconds have elapsed since the last time the debounced function was
  10891. * invoked. The debounced function comes with a `cancel` method to cancel
  10892. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10893. * Provide `options` to indicate whether `func` should be invoked on the
  10894. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10895. * with the last arguments provided to the debounced function. Subsequent
  10896. * calls to the debounced function return the result of the last `func`
  10897. * invocation.
  10898. *
  10899. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10900. * invoked on the trailing edge of the timeout only if the debounced function
  10901. * is invoked more than once during the `wait` timeout.
  10902. *
  10903. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10904. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10905. *
  10906. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10907. * for details over the differences between `_.debounce` and `_.throttle`.
  10908. *
  10909. * @static
  10910. * @memberOf _
  10911. * @since 0.1.0
  10912. * @category Function
  10913. * @param {Function} func The function to debounce.
  10914. * @param {number} [wait=0] The number of milliseconds to delay.
  10915. * @param {Object} [options={}] The options object.
  10916. * @param {boolean} [options.leading=false]
  10917. * Specify invoking on the leading edge of the timeout.
  10918. * @param {number} [options.maxWait]
  10919. * The maximum time `func` is allowed to be delayed before it's invoked.
  10920. * @param {boolean} [options.trailing=true]
  10921. * Specify invoking on the trailing edge of the timeout.
  10922. * @returns {Function} Returns the new debounced function.
  10923. * @example
  10924. *
  10925. * // Avoid costly calculations while the window size is in flux.
  10926. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10927. *
  10928. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10929. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10930. * 'leading': true,
  10931. * 'trailing': false
  10932. * }));
  10933. *
  10934. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10935. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10936. * var source = new EventSource('/stream');
  10937. * jQuery(source).on('message', debounced);
  10938. *
  10939. * // Cancel the trailing debounced invocation.
  10940. * jQuery(window).on('popstate', debounced.cancel);
  10941. */
  10942. function debounce(func, wait, options) {
  10943. var lastArgs,
  10944. lastThis,
  10945. maxWait,
  10946. result,
  10947. timerId,
  10948. lastCallTime,
  10949. lastInvokeTime = 0,
  10950. leading = false,
  10951. maxing = false,
  10952. trailing = true;
  10953. if (typeof func != 'function') {
  10954. throw new TypeError(FUNC_ERROR_TEXT);
  10955. }
  10956. wait = toNumber(wait) || 0;
  10957. if (isObject(options)) {
  10958. leading = !!options.leading;
  10959. maxing = 'maxWait' in options;
  10960. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10961. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10962. }
  10963. function invokeFunc(time) {
  10964. var args = lastArgs,
  10965. thisArg = lastThis;
  10966. lastArgs = lastThis = undefined;
  10967. lastInvokeTime = time;
  10968. result = func.apply(thisArg, args);
  10969. return result;
  10970. }
  10971. function leadingEdge(time) {
  10972. // Reset any `maxWait` timer.
  10973. lastInvokeTime = time;
  10974. // Start the timer for the trailing edge.
  10975. timerId = setTimeout(timerExpired, wait);
  10976. // Invoke the leading edge.
  10977. return leading ? invokeFunc(time) : result;
  10978. }
  10979. function remainingWait(time) {
  10980. var timeSinceLastCall = time - lastCallTime,
  10981. timeSinceLastInvoke = time - lastInvokeTime,
  10982. timeWaiting = wait - timeSinceLastCall;
  10983. return maxing
  10984. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10985. : timeWaiting;
  10986. }
  10987. function shouldInvoke(time) {
  10988. var timeSinceLastCall = time - lastCallTime,
  10989. timeSinceLastInvoke = time - lastInvokeTime;
  10990. // Either this is the first call, activity has stopped and we're at the
  10991. // trailing edge, the system time has gone backwards and we're treating
  10992. // it as the trailing edge, or we've hit the `maxWait` limit.
  10993. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10994. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10995. }
  10996. function timerExpired() {
  10997. var time = now();
  10998. if (shouldInvoke(time)) {
  10999. return trailingEdge(time);
  11000. }
  11001. // Restart the timer.
  11002. timerId = setTimeout(timerExpired, remainingWait(time));
  11003. }
  11004. function trailingEdge(time) {
  11005. timerId = undefined;
  11006. // Only invoke if we have `lastArgs` which means `func` has been
  11007. // debounced at least once.
  11008. if (trailing && lastArgs) {
  11009. return invokeFunc(time);
  11010. }
  11011. lastArgs = lastThis = undefined;
  11012. return result;
  11013. }
  11014. function cancel() {
  11015. if (timerId !== undefined) {
  11016. clearTimeout(timerId);
  11017. }
  11018. lastInvokeTime = 0;
  11019. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11020. }
  11021. function flush() {
  11022. return timerId === undefined ? result : trailingEdge(now());
  11023. }
  11024. function debounced() {
  11025. var time = now(),
  11026. isInvoking = shouldInvoke(time);
  11027. lastArgs = arguments;
  11028. lastThis = this;
  11029. lastCallTime = time;
  11030. if (isInvoking) {
  11031. if (timerId === undefined) {
  11032. return leadingEdge(lastCallTime);
  11033. }
  11034. if (maxing) {
  11035. // Handle invocations in a tight loop.
  11036. clearTimeout(timerId);
  11037. timerId = setTimeout(timerExpired, wait);
  11038. return invokeFunc(lastCallTime);
  11039. }
  11040. }
  11041. if (timerId === undefined) {
  11042. timerId = setTimeout(timerExpired, wait);
  11043. }
  11044. return result;
  11045. }
  11046. debounced.cancel = cancel;
  11047. debounced.flush = flush;
  11048. return debounced;
  11049. }
  11050. /**
  11051. * Defers invoking the `func` until the current call stack has cleared. Any
  11052. * additional arguments are provided to `func` when it's invoked.
  11053. *
  11054. * @static
  11055. * @memberOf _
  11056. * @since 0.1.0
  11057. * @category Function
  11058. * @param {Function} func The function to defer.
  11059. * @param {...*} [args] The arguments to invoke `func` with.
  11060. * @returns {number} Returns the timer id.
  11061. * @example
  11062. *
  11063. * _.defer(function(text) {
  11064. * console.log(text);
  11065. * }, 'deferred');
  11066. * // => Logs 'deferred' after one millisecond.
  11067. */
  11068. var defer = baseRest(function(func, args) {
  11069. return baseDelay(func, 1, args);
  11070. });
  11071. /**
  11072. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11073. * provided to `func` when it's invoked.
  11074. *
  11075. * @static
  11076. * @memberOf _
  11077. * @since 0.1.0
  11078. * @category Function
  11079. * @param {Function} func The function to delay.
  11080. * @param {number} wait The number of milliseconds to delay invocation.
  11081. * @param {...*} [args] The arguments to invoke `func` with.
  11082. * @returns {number} Returns the timer id.
  11083. * @example
  11084. *
  11085. * _.delay(function(text) {
  11086. * console.log(text);
  11087. * }, 1000, 'later');
  11088. * // => Logs 'later' after one second.
  11089. */
  11090. var delay = baseRest(function(func, wait, args) {
  11091. return baseDelay(func, toNumber(wait) || 0, args);
  11092. });
  11093. /**
  11094. * Creates a function that invokes `func` with arguments reversed.
  11095. *
  11096. * @static
  11097. * @memberOf _
  11098. * @since 4.0.0
  11099. * @category Function
  11100. * @param {Function} func The function to flip arguments for.
  11101. * @returns {Function} Returns the new flipped function.
  11102. * @example
  11103. *
  11104. * var flipped = _.flip(function() {
  11105. * return _.toArray(arguments);
  11106. * });
  11107. *
  11108. * flipped('a', 'b', 'c', 'd');
  11109. * // => ['d', 'c', 'b', 'a']
  11110. */
  11111. function flip(func) {
  11112. return createWrap(func, WRAP_FLIP_FLAG);
  11113. }
  11114. /**
  11115. * Creates a function that memoizes the result of `func`. If `resolver` is
  11116. * provided, it determines the cache key for storing the result based on the
  11117. * arguments provided to the memoized function. By default, the first argument
  11118. * provided to the memoized function is used as the map cache key. The `func`
  11119. * is invoked with the `this` binding of the memoized function.
  11120. *
  11121. * **Note:** The cache is exposed as the `cache` property on the memoized
  11122. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11123. * constructor with one whose instances implement the
  11124. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11125. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11126. *
  11127. * @static
  11128. * @memberOf _
  11129. * @since 0.1.0
  11130. * @category Function
  11131. * @param {Function} func The function to have its output memoized.
  11132. * @param {Function} [resolver] The function to resolve the cache key.
  11133. * @returns {Function} Returns the new memoized function.
  11134. * @example
  11135. *
  11136. * var object = { 'a': 1, 'b': 2 };
  11137. * var other = { 'c': 3, 'd': 4 };
  11138. *
  11139. * var values = _.memoize(_.values);
  11140. * values(object);
  11141. * // => [1, 2]
  11142. *
  11143. * values(other);
  11144. * // => [3, 4]
  11145. *
  11146. * object.a = 2;
  11147. * values(object);
  11148. * // => [1, 2]
  11149. *
  11150. * // Modify the result cache.
  11151. * values.cache.set(object, ['a', 'b']);
  11152. * values(object);
  11153. * // => ['a', 'b']
  11154. *
  11155. * // Replace `_.memoize.Cache`.
  11156. * _.memoize.Cache = WeakMap;
  11157. */
  11158. function memoize(func, resolver) {
  11159. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11160. throw new TypeError(FUNC_ERROR_TEXT);
  11161. }
  11162. var memoized = function() {
  11163. var args = arguments,
  11164. key = resolver ? resolver.apply(this, args) : args[0],
  11165. cache = memoized.cache;
  11166. if (cache.has(key)) {
  11167. return cache.get(key);
  11168. }
  11169. var result = func.apply(this, args);
  11170. memoized.cache = cache.set(key, result) || cache;
  11171. return result;
  11172. };
  11173. memoized.cache = new (memoize.Cache || MapCache);
  11174. return memoized;
  11175. }
  11176. // Expose `MapCache`.
  11177. memoize.Cache = MapCache;
  11178. /**
  11179. * Creates a function that negates the result of the predicate `func`. The
  11180. * `func` predicate is invoked with the `this` binding and arguments of the
  11181. * created function.
  11182. *
  11183. * @static
  11184. * @memberOf _
  11185. * @since 3.0.0
  11186. * @category Function
  11187. * @param {Function} predicate The predicate to negate.
  11188. * @returns {Function} Returns the new negated function.
  11189. * @example
  11190. *
  11191. * function isEven(n) {
  11192. * return n % 2 == 0;
  11193. * }
  11194. *
  11195. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11196. * // => [1, 3, 5]
  11197. */
  11198. function negate(predicate) {
  11199. if (typeof predicate != 'function') {
  11200. throw new TypeError(FUNC_ERROR_TEXT);
  11201. }
  11202. return function() {
  11203. var args = arguments;
  11204. switch (args.length) {
  11205. case 0: return !predicate.call(this);
  11206. case 1: return !predicate.call(this, args[0]);
  11207. case 2: return !predicate.call(this, args[0], args[1]);
  11208. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11209. }
  11210. return !predicate.apply(this, args);
  11211. };
  11212. }
  11213. /**
  11214. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11215. * to the function return the value of the first invocation. The `func` is
  11216. * invoked with the `this` binding and arguments of the created function.
  11217. *
  11218. * @static
  11219. * @memberOf _
  11220. * @since 0.1.0
  11221. * @category Function
  11222. * @param {Function} func The function to restrict.
  11223. * @returns {Function} Returns the new restricted function.
  11224. * @example
  11225. *
  11226. * var initialize = _.once(createApplication);
  11227. * initialize();
  11228. * initialize();
  11229. * // => `createApplication` is invoked once
  11230. */
  11231. function once(func) {
  11232. return before(2, func);
  11233. }
  11234. /**
  11235. * Creates a function that invokes `func` with its arguments transformed.
  11236. *
  11237. * @static
  11238. * @since 4.0.0
  11239. * @memberOf _
  11240. * @category Function
  11241. * @param {Function} func The function to wrap.
  11242. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11243. * The argument transforms.
  11244. * @returns {Function} Returns the new function.
  11245. * @example
  11246. *
  11247. * function doubled(n) {
  11248. * return n * 2;
  11249. * }
  11250. *
  11251. * function square(n) {
  11252. * return n * n;
  11253. * }
  11254. *
  11255. * var func = _.overArgs(function(x, y) {
  11256. * return [x, y];
  11257. * }, [square, doubled]);
  11258. *
  11259. * func(9, 3);
  11260. * // => [81, 6]
  11261. *
  11262. * func(10, 5);
  11263. * // => [100, 10]
  11264. */
  11265. var overArgs = castRest(function(func, transforms) {
  11266. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11267. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11268. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11269. var funcsLength = transforms.length;
  11270. return baseRest(function(args) {
  11271. var index = -1,
  11272. length = nativeMin(args.length, funcsLength);
  11273. while (++index < length) {
  11274. args[index] = transforms[index].call(this, args[index]);
  11275. }
  11276. return apply(func, this, args);
  11277. });
  11278. });
  11279. /**
  11280. * Creates a function that invokes `func` with `partials` prepended to the
  11281. * arguments it receives. This method is like `_.bind` except it does **not**
  11282. * alter the `this` binding.
  11283. *
  11284. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11285. * builds, may be used as a placeholder for partially applied arguments.
  11286. *
  11287. * **Note:** This method doesn't set the "length" property of partially
  11288. * applied functions.
  11289. *
  11290. * @static
  11291. * @memberOf _
  11292. * @since 0.2.0
  11293. * @category Function
  11294. * @param {Function} func The function to partially apply arguments to.
  11295. * @param {...*} [partials] The arguments to be partially applied.
  11296. * @returns {Function} Returns the new partially applied function.
  11297. * @example
  11298. *
  11299. * function greet(greeting, name) {
  11300. * return greeting + ' ' + name;
  11301. * }
  11302. *
  11303. * var sayHelloTo = _.partial(greet, 'hello');
  11304. * sayHelloTo('fred');
  11305. * // => 'hello fred'
  11306. *
  11307. * // Partially applied with placeholders.
  11308. * var greetFred = _.partial(greet, _, 'fred');
  11309. * greetFred('hi');
  11310. * // => 'hi fred'
  11311. */
  11312. var partial = baseRest(function(func, partials) {
  11313. var holders = replaceHolders(partials, getHolder(partial));
  11314. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11315. });
  11316. /**
  11317. * This method is like `_.partial` except that partially applied arguments
  11318. * are appended to the arguments it receives.
  11319. *
  11320. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11321. * builds, may be used as a placeholder for partially applied arguments.
  11322. *
  11323. * **Note:** This method doesn't set the "length" property of partially
  11324. * applied functions.
  11325. *
  11326. * @static
  11327. * @memberOf _
  11328. * @since 1.0.0
  11329. * @category Function
  11330. * @param {Function} func The function to partially apply arguments to.
  11331. * @param {...*} [partials] The arguments to be partially applied.
  11332. * @returns {Function} Returns the new partially applied function.
  11333. * @example
  11334. *
  11335. * function greet(greeting, name) {
  11336. * return greeting + ' ' + name;
  11337. * }
  11338. *
  11339. * var greetFred = _.partialRight(greet, 'fred');
  11340. * greetFred('hi');
  11341. * // => 'hi fred'
  11342. *
  11343. * // Partially applied with placeholders.
  11344. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11345. * sayHelloTo('fred');
  11346. * // => 'hello fred'
  11347. */
  11348. var partialRight = baseRest(function(func, partials) {
  11349. var holders = replaceHolders(partials, getHolder(partialRight));
  11350. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11351. });
  11352. /**
  11353. * Creates a function that invokes `func` with arguments arranged according
  11354. * to the specified `indexes` where the argument value at the first index is
  11355. * provided as the first argument, the argument value at the second index is
  11356. * provided as the second argument, and so on.
  11357. *
  11358. * @static
  11359. * @memberOf _
  11360. * @since 3.0.0
  11361. * @category Function
  11362. * @param {Function} func The function to rearrange arguments for.
  11363. * @param {...(number|number[])} indexes The arranged argument indexes.
  11364. * @returns {Function} Returns the new function.
  11365. * @example
  11366. *
  11367. * var rearged = _.rearg(function(a, b, c) {
  11368. * return [a, b, c];
  11369. * }, [2, 0, 1]);
  11370. *
  11371. * rearged('b', 'c', 'a')
  11372. * // => ['a', 'b', 'c']
  11373. */
  11374. var rearg = flatRest(function(func, indexes) {
  11375. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11376. });
  11377. /**
  11378. * Creates a function that invokes `func` with the `this` binding of the
  11379. * created function and arguments from `start` and beyond provided as
  11380. * an array.
  11381. *
  11382. * **Note:** This method is based on the
  11383. * [rest parameter](https://mdn.io/rest_parameters).
  11384. *
  11385. * @static
  11386. * @memberOf _
  11387. * @since 4.0.0
  11388. * @category Function
  11389. * @param {Function} func The function to apply a rest parameter to.
  11390. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11391. * @returns {Function} Returns the new function.
  11392. * @example
  11393. *
  11394. * var say = _.rest(function(what, names) {
  11395. * return what + ' ' + _.initial(names).join(', ') +
  11396. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11397. * });
  11398. *
  11399. * say('hello', 'fred', 'barney', 'pebbles');
  11400. * // => 'hello fred, barney, & pebbles'
  11401. */
  11402. function rest(func, start) {
  11403. if (typeof func != 'function') {
  11404. throw new TypeError(FUNC_ERROR_TEXT);
  11405. }
  11406. start = start === undefined ? start : toInteger(start);
  11407. return baseRest(func, start);
  11408. }
  11409. /**
  11410. * Creates a function that invokes `func` with the `this` binding of the
  11411. * create function and an array of arguments much like
  11412. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11413. *
  11414. * **Note:** This method is based on the
  11415. * [spread operator](https://mdn.io/spread_operator).
  11416. *
  11417. * @static
  11418. * @memberOf _
  11419. * @since 3.2.0
  11420. * @category Function
  11421. * @param {Function} func The function to spread arguments over.
  11422. * @param {number} [start=0] The start position of the spread.
  11423. * @returns {Function} Returns the new function.
  11424. * @example
  11425. *
  11426. * var say = _.spread(function(who, what) {
  11427. * return who + ' says ' + what;
  11428. * });
  11429. *
  11430. * say(['fred', 'hello']);
  11431. * // => 'fred says hello'
  11432. *
  11433. * var numbers = Promise.all([
  11434. * Promise.resolve(40),
  11435. * Promise.resolve(36)
  11436. * ]);
  11437. *
  11438. * numbers.then(_.spread(function(x, y) {
  11439. * return x + y;
  11440. * }));
  11441. * // => a Promise of 76
  11442. */
  11443. function spread(func, start) {
  11444. if (typeof func != 'function') {
  11445. throw new TypeError(FUNC_ERROR_TEXT);
  11446. }
  11447. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11448. return baseRest(function(args) {
  11449. var array = args[start],
  11450. otherArgs = castSlice(args, 0, start);
  11451. if (array) {
  11452. arrayPush(otherArgs, array);
  11453. }
  11454. return apply(func, this, otherArgs);
  11455. });
  11456. }
  11457. /**
  11458. * Creates a throttled function that only invokes `func` at most once per
  11459. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11460. * method to cancel delayed `func` invocations and a `flush` method to
  11461. * immediately invoke them. Provide `options` to indicate whether `func`
  11462. * should be invoked on the leading and/or trailing edge of the `wait`
  11463. * timeout. The `func` is invoked with the last arguments provided to the
  11464. * throttled function. Subsequent calls to the throttled function return the
  11465. * result of the last `func` invocation.
  11466. *
  11467. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11468. * invoked on the trailing edge of the timeout only if the throttled function
  11469. * is invoked more than once during the `wait` timeout.
  11470. *
  11471. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11472. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11473. *
  11474. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11475. * for details over the differences between `_.throttle` and `_.debounce`.
  11476. *
  11477. * @static
  11478. * @memberOf _
  11479. * @since 0.1.0
  11480. * @category Function
  11481. * @param {Function} func The function to throttle.
  11482. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11483. * @param {Object} [options={}] The options object.
  11484. * @param {boolean} [options.leading=true]
  11485. * Specify invoking on the leading edge of the timeout.
  11486. * @param {boolean} [options.trailing=true]
  11487. * Specify invoking on the trailing edge of the timeout.
  11488. * @returns {Function} Returns the new throttled function.
  11489. * @example
  11490. *
  11491. * // Avoid excessively updating the position while scrolling.
  11492. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11493. *
  11494. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11495. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11496. * jQuery(element).on('click', throttled);
  11497. *
  11498. * // Cancel the trailing throttled invocation.
  11499. * jQuery(window).on('popstate', throttled.cancel);
  11500. */
  11501. function throttle(func, wait, options) {
  11502. var leading = true,
  11503. trailing = true;
  11504. if (typeof func != 'function') {
  11505. throw new TypeError(FUNC_ERROR_TEXT);
  11506. }
  11507. if (isObject(options)) {
  11508. leading = 'leading' in options ? !!options.leading : leading;
  11509. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11510. }
  11511. return debounce(func, wait, {
  11512. 'leading': leading,
  11513. 'maxWait': wait,
  11514. 'trailing': trailing
  11515. });
  11516. }
  11517. /**
  11518. * Creates a function that accepts up to one argument, ignoring any
  11519. * additional arguments.
  11520. *
  11521. * @static
  11522. * @memberOf _
  11523. * @since 4.0.0
  11524. * @category Function
  11525. * @param {Function} func The function to cap arguments for.
  11526. * @returns {Function} Returns the new capped function.
  11527. * @example
  11528. *
  11529. * _.map(['6', '8', '10'], _.unary(parseInt));
  11530. * // => [6, 8, 10]
  11531. */
  11532. function unary(func) {
  11533. return ary(func, 1);
  11534. }
  11535. /**
  11536. * Creates a function that provides `value` to `wrapper` as its first
  11537. * argument. Any additional arguments provided to the function are appended
  11538. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11539. * binding of the created function.
  11540. *
  11541. * @static
  11542. * @memberOf _
  11543. * @since 0.1.0
  11544. * @category Function
  11545. * @param {*} value The value to wrap.
  11546. * @param {Function} [wrapper=identity] The wrapper function.
  11547. * @returns {Function} Returns the new function.
  11548. * @example
  11549. *
  11550. * var p = _.wrap(_.escape, function(func, text) {
  11551. * return '<p>' + func(text) + '</p>';
  11552. * });
  11553. *
  11554. * p('fred, barney, & pebbles');
  11555. * // => '<p>fred, barney, &amp; pebbles</p>'
  11556. */
  11557. function wrap(value, wrapper) {
  11558. return partial(castFunction(wrapper), value);
  11559. }
  11560. /*------------------------------------------------------------------------*/
  11561. /**
  11562. * Casts `value` as an array if it's not one.
  11563. *
  11564. * @static
  11565. * @memberOf _
  11566. * @since 4.4.0
  11567. * @category Lang
  11568. * @param {*} value The value to inspect.
  11569. * @returns {Array} Returns the cast array.
  11570. * @example
  11571. *
  11572. * _.castArray(1);
  11573. * // => [1]
  11574. *
  11575. * _.castArray({ 'a': 1 });
  11576. * // => [{ 'a': 1 }]
  11577. *
  11578. * _.castArray('abc');
  11579. * // => ['abc']
  11580. *
  11581. * _.castArray(null);
  11582. * // => [null]
  11583. *
  11584. * _.castArray(undefined);
  11585. * // => [undefined]
  11586. *
  11587. * _.castArray();
  11588. * // => []
  11589. *
  11590. * var array = [1, 2, 3];
  11591. * console.log(_.castArray(array) === array);
  11592. * // => true
  11593. */
  11594. function castArray() {
  11595. if (!arguments.length) {
  11596. return [];
  11597. }
  11598. var value = arguments[0];
  11599. return isArray(value) ? value : [value];
  11600. }
  11601. /**
  11602. * Creates a shallow clone of `value`.
  11603. *
  11604. * **Note:** This method is loosely based on the
  11605. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11606. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11607. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11608. * arrays. The own enumerable properties of `arguments` objects are cloned
  11609. * as plain objects. An empty object is returned for uncloneable values such
  11610. * as error objects, functions, DOM nodes, and WeakMaps.
  11611. *
  11612. * @static
  11613. * @memberOf _
  11614. * @since 0.1.0
  11615. * @category Lang
  11616. * @param {*} value The value to clone.
  11617. * @returns {*} Returns the cloned value.
  11618. * @see _.cloneDeep
  11619. * @example
  11620. *
  11621. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11622. *
  11623. * var shallow = _.clone(objects);
  11624. * console.log(shallow[0] === objects[0]);
  11625. * // => true
  11626. */
  11627. function clone(value) {
  11628. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11629. }
  11630. /**
  11631. * This method is like `_.clone` except that it accepts `customizer` which
  11632. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11633. * cloning is handled by the method instead. The `customizer` is invoked with
  11634. * up to four arguments; (value [, index|key, object, stack]).
  11635. *
  11636. * @static
  11637. * @memberOf _
  11638. * @since 4.0.0
  11639. * @category Lang
  11640. * @param {*} value The value to clone.
  11641. * @param {Function} [customizer] The function to customize cloning.
  11642. * @returns {*} Returns the cloned value.
  11643. * @see _.cloneDeepWith
  11644. * @example
  11645. *
  11646. * function customizer(value) {
  11647. * if (_.isElement(value)) {
  11648. * return value.cloneNode(false);
  11649. * }
  11650. * }
  11651. *
  11652. * var el = _.cloneWith(document.body, customizer);
  11653. *
  11654. * console.log(el === document.body);
  11655. * // => false
  11656. * console.log(el.nodeName);
  11657. * // => 'BODY'
  11658. * console.log(el.childNodes.length);
  11659. * // => 0
  11660. */
  11661. function cloneWith(value, customizer) {
  11662. customizer = typeof customizer == 'function' ? customizer : undefined;
  11663. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11664. }
  11665. /**
  11666. * This method is like `_.clone` except that it recursively clones `value`.
  11667. *
  11668. * @static
  11669. * @memberOf _
  11670. * @since 1.0.0
  11671. * @category Lang
  11672. * @param {*} value The value to recursively clone.
  11673. * @returns {*} Returns the deep cloned value.
  11674. * @see _.clone
  11675. * @example
  11676. *
  11677. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11678. *
  11679. * var deep = _.cloneDeep(objects);
  11680. * console.log(deep[0] === objects[0]);
  11681. * // => false
  11682. */
  11683. function cloneDeep(value) {
  11684. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11685. }
  11686. /**
  11687. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11688. *
  11689. * @static
  11690. * @memberOf _
  11691. * @since 4.0.0
  11692. * @category Lang
  11693. * @param {*} value The value to recursively clone.
  11694. * @param {Function} [customizer] The function to customize cloning.
  11695. * @returns {*} Returns the deep cloned value.
  11696. * @see _.cloneWith
  11697. * @example
  11698. *
  11699. * function customizer(value) {
  11700. * if (_.isElement(value)) {
  11701. * return value.cloneNode(true);
  11702. * }
  11703. * }
  11704. *
  11705. * var el = _.cloneDeepWith(document.body, customizer);
  11706. *
  11707. * console.log(el === document.body);
  11708. * // => false
  11709. * console.log(el.nodeName);
  11710. * // => 'BODY'
  11711. * console.log(el.childNodes.length);
  11712. * // => 20
  11713. */
  11714. function cloneDeepWith(value, customizer) {
  11715. customizer = typeof customizer == 'function' ? customizer : undefined;
  11716. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11717. }
  11718. /**
  11719. * Checks if `object` conforms to `source` by invoking the predicate
  11720. * properties of `source` with the corresponding property values of `object`.
  11721. *
  11722. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11723. * partially applied.
  11724. *
  11725. * @static
  11726. * @memberOf _
  11727. * @since 4.14.0
  11728. * @category Lang
  11729. * @param {Object} object The object to inspect.
  11730. * @param {Object} source The object of property predicates to conform to.
  11731. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11732. * @example
  11733. *
  11734. * var object = { 'a': 1, 'b': 2 };
  11735. *
  11736. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11737. * // => true
  11738. *
  11739. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11740. * // => false
  11741. */
  11742. function conformsTo(object, source) {
  11743. return source == null || baseConformsTo(object, source, keys(source));
  11744. }
  11745. /**
  11746. * Performs a
  11747. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11748. * comparison between two values to determine if they are equivalent.
  11749. *
  11750. * @static
  11751. * @memberOf _
  11752. * @since 4.0.0
  11753. * @category Lang
  11754. * @param {*} value The value to compare.
  11755. * @param {*} other The other value to compare.
  11756. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11757. * @example
  11758. *
  11759. * var object = { 'a': 1 };
  11760. * var other = { 'a': 1 };
  11761. *
  11762. * _.eq(object, object);
  11763. * // => true
  11764. *
  11765. * _.eq(object, other);
  11766. * // => false
  11767. *
  11768. * _.eq('a', 'a');
  11769. * // => true
  11770. *
  11771. * _.eq('a', Object('a'));
  11772. * // => false
  11773. *
  11774. * _.eq(NaN, NaN);
  11775. * // => true
  11776. */
  11777. function eq(value, other) {
  11778. return value === other || (value !== value && other !== other);
  11779. }
  11780. /**
  11781. * Checks if `value` is greater than `other`.
  11782. *
  11783. * @static
  11784. * @memberOf _
  11785. * @since 3.9.0
  11786. * @category Lang
  11787. * @param {*} value The value to compare.
  11788. * @param {*} other The other value to compare.
  11789. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11790. * else `false`.
  11791. * @see _.lt
  11792. * @example
  11793. *
  11794. * _.gt(3, 1);
  11795. * // => true
  11796. *
  11797. * _.gt(3, 3);
  11798. * // => false
  11799. *
  11800. * _.gt(1, 3);
  11801. * // => false
  11802. */
  11803. var gt = createRelationalOperation(baseGt);
  11804. /**
  11805. * Checks if `value` is greater than or equal to `other`.
  11806. *
  11807. * @static
  11808. * @memberOf _
  11809. * @since 3.9.0
  11810. * @category Lang
  11811. * @param {*} value The value to compare.
  11812. * @param {*} other The other value to compare.
  11813. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11814. * `other`, else `false`.
  11815. * @see _.lte
  11816. * @example
  11817. *
  11818. * _.gte(3, 1);
  11819. * // => true
  11820. *
  11821. * _.gte(3, 3);
  11822. * // => true
  11823. *
  11824. * _.gte(1, 3);
  11825. * // => false
  11826. */
  11827. var gte = createRelationalOperation(function(value, other) {
  11828. return value >= other;
  11829. });
  11830. /**
  11831. * Checks if `value` is likely an `arguments` object.
  11832. *
  11833. * @static
  11834. * @memberOf _
  11835. * @since 0.1.0
  11836. * @category Lang
  11837. * @param {*} value The value to check.
  11838. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11839. * else `false`.
  11840. * @example
  11841. *
  11842. * _.isArguments(function() { return arguments; }());
  11843. * // => true
  11844. *
  11845. * _.isArguments([1, 2, 3]);
  11846. * // => false
  11847. */
  11848. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11849. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11850. !propertyIsEnumerable.call(value, 'callee');
  11851. };
  11852. /**
  11853. * Checks if `value` is classified as an `Array` object.
  11854. *
  11855. * @static
  11856. * @memberOf _
  11857. * @since 0.1.0
  11858. * @category Lang
  11859. * @param {*} value The value to check.
  11860. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11861. * @example
  11862. *
  11863. * _.isArray([1, 2, 3]);
  11864. * // => true
  11865. *
  11866. * _.isArray(document.body.children);
  11867. * // => false
  11868. *
  11869. * _.isArray('abc');
  11870. * // => false
  11871. *
  11872. * _.isArray(_.noop);
  11873. * // => false
  11874. */
  11875. var isArray = Array.isArray;
  11876. /**
  11877. * Checks if `value` is classified as an `ArrayBuffer` object.
  11878. *
  11879. * @static
  11880. * @memberOf _
  11881. * @since 4.3.0
  11882. * @category Lang
  11883. * @param {*} value The value to check.
  11884. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11885. * @example
  11886. *
  11887. * _.isArrayBuffer(new ArrayBuffer(2));
  11888. * // => true
  11889. *
  11890. * _.isArrayBuffer(new Array(2));
  11891. * // => false
  11892. */
  11893. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11894. /**
  11895. * Checks if `value` is array-like. A value is considered array-like if it's
  11896. * not a function and has a `value.length` that's an integer greater than or
  11897. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11898. *
  11899. * @static
  11900. * @memberOf _
  11901. * @since 4.0.0
  11902. * @category Lang
  11903. * @param {*} value The value to check.
  11904. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11905. * @example
  11906. *
  11907. * _.isArrayLike([1, 2, 3]);
  11908. * // => true
  11909. *
  11910. * _.isArrayLike(document.body.children);
  11911. * // => true
  11912. *
  11913. * _.isArrayLike('abc');
  11914. * // => true
  11915. *
  11916. * _.isArrayLike(_.noop);
  11917. * // => false
  11918. */
  11919. function isArrayLike(value) {
  11920. return value != null && isLength(value.length) && !isFunction(value);
  11921. }
  11922. /**
  11923. * This method is like `_.isArrayLike` except that it also checks if `value`
  11924. * is an object.
  11925. *
  11926. * @static
  11927. * @memberOf _
  11928. * @since 4.0.0
  11929. * @category Lang
  11930. * @param {*} value The value to check.
  11931. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11932. * else `false`.
  11933. * @example
  11934. *
  11935. * _.isArrayLikeObject([1, 2, 3]);
  11936. * // => true
  11937. *
  11938. * _.isArrayLikeObject(document.body.children);
  11939. * // => true
  11940. *
  11941. * _.isArrayLikeObject('abc');
  11942. * // => false
  11943. *
  11944. * _.isArrayLikeObject(_.noop);
  11945. * // => false
  11946. */
  11947. function isArrayLikeObject(value) {
  11948. return isObjectLike(value) && isArrayLike(value);
  11949. }
  11950. /**
  11951. * Checks if `value` is classified as a boolean primitive or object.
  11952. *
  11953. * @static
  11954. * @memberOf _
  11955. * @since 0.1.0
  11956. * @category Lang
  11957. * @param {*} value The value to check.
  11958. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11959. * @example
  11960. *
  11961. * _.isBoolean(false);
  11962. * // => true
  11963. *
  11964. * _.isBoolean(null);
  11965. * // => false
  11966. */
  11967. function isBoolean(value) {
  11968. return value === true || value === false ||
  11969. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11970. }
  11971. /**
  11972. * Checks if `value` is a buffer.
  11973. *
  11974. * @static
  11975. * @memberOf _
  11976. * @since 4.3.0
  11977. * @category Lang
  11978. * @param {*} value The value to check.
  11979. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11980. * @example
  11981. *
  11982. * _.isBuffer(new Buffer(2));
  11983. * // => true
  11984. *
  11985. * _.isBuffer(new Uint8Array(2));
  11986. * // => false
  11987. */
  11988. var isBuffer = nativeIsBuffer || stubFalse;
  11989. /**
  11990. * Checks if `value` is classified as a `Date` object.
  11991. *
  11992. * @static
  11993. * @memberOf _
  11994. * @since 0.1.0
  11995. * @category Lang
  11996. * @param {*} value The value to check.
  11997. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11998. * @example
  11999. *
  12000. * _.isDate(new Date);
  12001. * // => true
  12002. *
  12003. * _.isDate('Mon April 23 2012');
  12004. * // => false
  12005. */
  12006. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12007. /**
  12008. * Checks if `value` is likely a DOM element.
  12009. *
  12010. * @static
  12011. * @memberOf _
  12012. * @since 0.1.0
  12013. * @category Lang
  12014. * @param {*} value The value to check.
  12015. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12016. * @example
  12017. *
  12018. * _.isElement(document.body);
  12019. * // => true
  12020. *
  12021. * _.isElement('<body>');
  12022. * // => false
  12023. */
  12024. function isElement(value) {
  12025. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12026. }
  12027. /**
  12028. * Checks if `value` is an empty object, collection, map, or set.
  12029. *
  12030. * Objects are considered empty if they have no own enumerable string keyed
  12031. * properties.
  12032. *
  12033. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12034. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12035. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12036. *
  12037. * @static
  12038. * @memberOf _
  12039. * @since 0.1.0
  12040. * @category Lang
  12041. * @param {*} value The value to check.
  12042. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12043. * @example
  12044. *
  12045. * _.isEmpty(null);
  12046. * // => true
  12047. *
  12048. * _.isEmpty(true);
  12049. * // => true
  12050. *
  12051. * _.isEmpty(1);
  12052. * // => true
  12053. *
  12054. * _.isEmpty([1, 2, 3]);
  12055. * // => false
  12056. *
  12057. * _.isEmpty({ 'a': 1 });
  12058. * // => false
  12059. */
  12060. function isEmpty(value) {
  12061. if (value == null) {
  12062. return true;
  12063. }
  12064. if (isArrayLike(value) &&
  12065. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12066. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12067. return !value.length;
  12068. }
  12069. var tag = getTag(value);
  12070. if (tag == mapTag || tag == setTag) {
  12071. return !value.size;
  12072. }
  12073. if (isPrototype(value)) {
  12074. return !baseKeys(value).length;
  12075. }
  12076. for (var key in value) {
  12077. if (hasOwnProperty.call(value, key)) {
  12078. return false;
  12079. }
  12080. }
  12081. return true;
  12082. }
  12083. /**
  12084. * Performs a deep comparison between two values to determine if they are
  12085. * equivalent.
  12086. *
  12087. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12088. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12089. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12090. * by their own, not inherited, enumerable properties. Functions and DOM
  12091. * nodes are compared by strict equality, i.e. `===`.
  12092. *
  12093. * @static
  12094. * @memberOf _
  12095. * @since 0.1.0
  12096. * @category Lang
  12097. * @param {*} value The value to compare.
  12098. * @param {*} other The other value to compare.
  12099. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12100. * @example
  12101. *
  12102. * var object = { 'a': 1 };
  12103. * var other = { 'a': 1 };
  12104. *
  12105. * _.isEqual(object, other);
  12106. * // => true
  12107. *
  12108. * object === other;
  12109. * // => false
  12110. */
  12111. function isEqual(value, other) {
  12112. return baseIsEqual(value, other);
  12113. }
  12114. /**
  12115. * This method is like `_.isEqual` except that it accepts `customizer` which
  12116. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12117. * are handled by the method instead. The `customizer` is invoked with up to
  12118. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12119. *
  12120. * @static
  12121. * @memberOf _
  12122. * @since 4.0.0
  12123. * @category Lang
  12124. * @param {*} value The value to compare.
  12125. * @param {*} other The other value to compare.
  12126. * @param {Function} [customizer] The function to customize comparisons.
  12127. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12128. * @example
  12129. *
  12130. * function isGreeting(value) {
  12131. * return /^h(?:i|ello)$/.test(value);
  12132. * }
  12133. *
  12134. * function customizer(objValue, othValue) {
  12135. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12136. * return true;
  12137. * }
  12138. * }
  12139. *
  12140. * var array = ['hello', 'goodbye'];
  12141. * var other = ['hi', 'goodbye'];
  12142. *
  12143. * _.isEqualWith(array, other, customizer);
  12144. * // => true
  12145. */
  12146. function isEqualWith(value, other, customizer) {
  12147. customizer = typeof customizer == 'function' ? customizer : undefined;
  12148. var result = customizer ? customizer(value, other) : undefined;
  12149. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12150. }
  12151. /**
  12152. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12153. * `SyntaxError`, `TypeError`, or `URIError` object.
  12154. *
  12155. * @static
  12156. * @memberOf _
  12157. * @since 3.0.0
  12158. * @category Lang
  12159. * @param {*} value The value to check.
  12160. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12161. * @example
  12162. *
  12163. * _.isError(new Error);
  12164. * // => true
  12165. *
  12166. * _.isError(Error);
  12167. * // => false
  12168. */
  12169. function isError(value) {
  12170. if (!isObjectLike(value)) {
  12171. return false;
  12172. }
  12173. var tag = baseGetTag(value);
  12174. return tag == errorTag || tag == domExcTag ||
  12175. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12176. }
  12177. /**
  12178. * Checks if `value` is a finite primitive number.
  12179. *
  12180. * **Note:** This method is based on
  12181. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12182. *
  12183. * @static
  12184. * @memberOf _
  12185. * @since 0.1.0
  12186. * @category Lang
  12187. * @param {*} value The value to check.
  12188. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12189. * @example
  12190. *
  12191. * _.isFinite(3);
  12192. * // => true
  12193. *
  12194. * _.isFinite(Number.MIN_VALUE);
  12195. * // => true
  12196. *
  12197. * _.isFinite(Infinity);
  12198. * // => false
  12199. *
  12200. * _.isFinite('3');
  12201. * // => false
  12202. */
  12203. function isFinite(value) {
  12204. return typeof value == 'number' && nativeIsFinite(value);
  12205. }
  12206. /**
  12207. * Checks if `value` is classified as a `Function` object.
  12208. *
  12209. * @static
  12210. * @memberOf _
  12211. * @since 0.1.0
  12212. * @category Lang
  12213. * @param {*} value The value to check.
  12214. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12215. * @example
  12216. *
  12217. * _.isFunction(_);
  12218. * // => true
  12219. *
  12220. * _.isFunction(/abc/);
  12221. * // => false
  12222. */
  12223. function isFunction(value) {
  12224. if (!isObject(value)) {
  12225. return false;
  12226. }
  12227. // The use of `Object#toString` avoids issues with the `typeof` operator
  12228. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12229. var tag = baseGetTag(value);
  12230. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12231. }
  12232. /**
  12233. * Checks if `value` is an integer.
  12234. *
  12235. * **Note:** This method is based on
  12236. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12237. *
  12238. * @static
  12239. * @memberOf _
  12240. * @since 4.0.0
  12241. * @category Lang
  12242. * @param {*} value The value to check.
  12243. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12244. * @example
  12245. *
  12246. * _.isInteger(3);
  12247. * // => true
  12248. *
  12249. * _.isInteger(Number.MIN_VALUE);
  12250. * // => false
  12251. *
  12252. * _.isInteger(Infinity);
  12253. * // => false
  12254. *
  12255. * _.isInteger('3');
  12256. * // => false
  12257. */
  12258. function isInteger(value) {
  12259. return typeof value == 'number' && value == toInteger(value);
  12260. }
  12261. /**
  12262. * Checks if `value` is a valid array-like length.
  12263. *
  12264. * **Note:** This method is loosely based on
  12265. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12266. *
  12267. * @static
  12268. * @memberOf _
  12269. * @since 4.0.0
  12270. * @category Lang
  12271. * @param {*} value The value to check.
  12272. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12273. * @example
  12274. *
  12275. * _.isLength(3);
  12276. * // => true
  12277. *
  12278. * _.isLength(Number.MIN_VALUE);
  12279. * // => false
  12280. *
  12281. * _.isLength(Infinity);
  12282. * // => false
  12283. *
  12284. * _.isLength('3');
  12285. * // => false
  12286. */
  12287. function isLength(value) {
  12288. return typeof value == 'number' &&
  12289. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12290. }
  12291. /**
  12292. * Checks if `value` is the
  12293. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12294. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12295. *
  12296. * @static
  12297. * @memberOf _
  12298. * @since 0.1.0
  12299. * @category Lang
  12300. * @param {*} value The value to check.
  12301. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12302. * @example
  12303. *
  12304. * _.isObject({});
  12305. * // => true
  12306. *
  12307. * _.isObject([1, 2, 3]);
  12308. * // => true
  12309. *
  12310. * _.isObject(_.noop);
  12311. * // => true
  12312. *
  12313. * _.isObject(null);
  12314. * // => false
  12315. */
  12316. function isObject(value) {
  12317. var type = typeof value;
  12318. return value != null && (type == 'object' || type == 'function');
  12319. }
  12320. /**
  12321. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12322. * and has a `typeof` result of "object".
  12323. *
  12324. * @static
  12325. * @memberOf _
  12326. * @since 4.0.0
  12327. * @category Lang
  12328. * @param {*} value The value to check.
  12329. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12330. * @example
  12331. *
  12332. * _.isObjectLike({});
  12333. * // => true
  12334. *
  12335. * _.isObjectLike([1, 2, 3]);
  12336. * // => true
  12337. *
  12338. * _.isObjectLike(_.noop);
  12339. * // => false
  12340. *
  12341. * _.isObjectLike(null);
  12342. * // => false
  12343. */
  12344. function isObjectLike(value) {
  12345. return value != null && typeof value == 'object';
  12346. }
  12347. /**
  12348. * Checks if `value` is classified as a `Map` object.
  12349. *
  12350. * @static
  12351. * @memberOf _
  12352. * @since 4.3.0
  12353. * @category Lang
  12354. * @param {*} value The value to check.
  12355. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12356. * @example
  12357. *
  12358. * _.isMap(new Map);
  12359. * // => true
  12360. *
  12361. * _.isMap(new WeakMap);
  12362. * // => false
  12363. */
  12364. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12365. /**
  12366. * Performs a partial deep comparison between `object` and `source` to
  12367. * determine if `object` contains equivalent property values.
  12368. *
  12369. * **Note:** This method is equivalent to `_.matches` when `source` is
  12370. * partially applied.
  12371. *
  12372. * Partial comparisons will match empty array and empty object `source`
  12373. * values against any array or object value, respectively. See `_.isEqual`
  12374. * for a list of supported value comparisons.
  12375. *
  12376. * @static
  12377. * @memberOf _
  12378. * @since 3.0.0
  12379. * @category Lang
  12380. * @param {Object} object The object to inspect.
  12381. * @param {Object} source The object of property values to match.
  12382. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12383. * @example
  12384. *
  12385. * var object = { 'a': 1, 'b': 2 };
  12386. *
  12387. * _.isMatch(object, { 'b': 2 });
  12388. * // => true
  12389. *
  12390. * _.isMatch(object, { 'b': 1 });
  12391. * // => false
  12392. */
  12393. function isMatch(object, source) {
  12394. return object === source || baseIsMatch(object, source, getMatchData(source));
  12395. }
  12396. /**
  12397. * This method is like `_.isMatch` except that it accepts `customizer` which
  12398. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12399. * are handled by the method instead. The `customizer` is invoked with five
  12400. * arguments: (objValue, srcValue, index|key, object, source).
  12401. *
  12402. * @static
  12403. * @memberOf _
  12404. * @since 4.0.0
  12405. * @category Lang
  12406. * @param {Object} object The object to inspect.
  12407. * @param {Object} source The object of property values to match.
  12408. * @param {Function} [customizer] The function to customize comparisons.
  12409. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12410. * @example
  12411. *
  12412. * function isGreeting(value) {
  12413. * return /^h(?:i|ello)$/.test(value);
  12414. * }
  12415. *
  12416. * function customizer(objValue, srcValue) {
  12417. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12418. * return true;
  12419. * }
  12420. * }
  12421. *
  12422. * var object = { 'greeting': 'hello' };
  12423. * var source = { 'greeting': 'hi' };
  12424. *
  12425. * _.isMatchWith(object, source, customizer);
  12426. * // => true
  12427. */
  12428. function isMatchWith(object, source, customizer) {
  12429. customizer = typeof customizer == 'function' ? customizer : undefined;
  12430. return baseIsMatch(object, source, getMatchData(source), customizer);
  12431. }
  12432. /**
  12433. * Checks if `value` is `NaN`.
  12434. *
  12435. * **Note:** This method is based on
  12436. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12437. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12438. * `undefined` and other non-number values.
  12439. *
  12440. * @static
  12441. * @memberOf _
  12442. * @since 0.1.0
  12443. * @category Lang
  12444. * @param {*} value The value to check.
  12445. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12446. * @example
  12447. *
  12448. * _.isNaN(NaN);
  12449. * // => true
  12450. *
  12451. * _.isNaN(new Number(NaN));
  12452. * // => true
  12453. *
  12454. * isNaN(undefined);
  12455. * // => true
  12456. *
  12457. * _.isNaN(undefined);
  12458. * // => false
  12459. */
  12460. function isNaN(value) {
  12461. // An `NaN` primitive is the only value that is not equal to itself.
  12462. // Perform the `toStringTag` check first to avoid errors with some
  12463. // ActiveX objects in IE.
  12464. return isNumber(value) && value != +value;
  12465. }
  12466. /**
  12467. * Checks if `value` is a pristine native function.
  12468. *
  12469. * **Note:** This method can't reliably detect native functions in the presence
  12470. * of the core-js package because core-js circumvents this kind of detection.
  12471. * Despite multiple requests, the core-js maintainer has made it clear: any
  12472. * attempt to fix the detection will be obstructed. As a result, we're left
  12473. * with little choice but to throw an error. Unfortunately, this also affects
  12474. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12475. * which rely on core-js.
  12476. *
  12477. * @static
  12478. * @memberOf _
  12479. * @since 3.0.0
  12480. * @category Lang
  12481. * @param {*} value The value to check.
  12482. * @returns {boolean} Returns `true` if `value` is a native function,
  12483. * else `false`.
  12484. * @example
  12485. *
  12486. * _.isNative(Array.prototype.push);
  12487. * // => true
  12488. *
  12489. * _.isNative(_);
  12490. * // => false
  12491. */
  12492. function isNative(value) {
  12493. if (isMaskable(value)) {
  12494. throw new Error(CORE_ERROR_TEXT);
  12495. }
  12496. return baseIsNative(value);
  12497. }
  12498. /**
  12499. * Checks if `value` is `null`.
  12500. *
  12501. * @static
  12502. * @memberOf _
  12503. * @since 0.1.0
  12504. * @category Lang
  12505. * @param {*} value The value to check.
  12506. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12507. * @example
  12508. *
  12509. * _.isNull(null);
  12510. * // => true
  12511. *
  12512. * _.isNull(void 0);
  12513. * // => false
  12514. */
  12515. function isNull(value) {
  12516. return value === null;
  12517. }
  12518. /**
  12519. * Checks if `value` is `null` or `undefined`.
  12520. *
  12521. * @static
  12522. * @memberOf _
  12523. * @since 4.0.0
  12524. * @category Lang
  12525. * @param {*} value The value to check.
  12526. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12527. * @example
  12528. *
  12529. * _.isNil(null);
  12530. * // => true
  12531. *
  12532. * _.isNil(void 0);
  12533. * // => true
  12534. *
  12535. * _.isNil(NaN);
  12536. * // => false
  12537. */
  12538. function isNil(value) {
  12539. return value == null;
  12540. }
  12541. /**
  12542. * Checks if `value` is classified as a `Number` primitive or object.
  12543. *
  12544. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12545. * classified as numbers, use the `_.isFinite` method.
  12546. *
  12547. * @static
  12548. * @memberOf _
  12549. * @since 0.1.0
  12550. * @category Lang
  12551. * @param {*} value The value to check.
  12552. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12553. * @example
  12554. *
  12555. * _.isNumber(3);
  12556. * // => true
  12557. *
  12558. * _.isNumber(Number.MIN_VALUE);
  12559. * // => true
  12560. *
  12561. * _.isNumber(Infinity);
  12562. * // => true
  12563. *
  12564. * _.isNumber('3');
  12565. * // => false
  12566. */
  12567. function isNumber(value) {
  12568. return typeof value == 'number' ||
  12569. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12570. }
  12571. /**
  12572. * Checks if `value` is a plain object, that is, an object created by the
  12573. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12574. *
  12575. * @static
  12576. * @memberOf _
  12577. * @since 0.8.0
  12578. * @category Lang
  12579. * @param {*} value The value to check.
  12580. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12581. * @example
  12582. *
  12583. * function Foo() {
  12584. * this.a = 1;
  12585. * }
  12586. *
  12587. * _.isPlainObject(new Foo);
  12588. * // => false
  12589. *
  12590. * _.isPlainObject([1, 2, 3]);
  12591. * // => false
  12592. *
  12593. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12594. * // => true
  12595. *
  12596. * _.isPlainObject(Object.create(null));
  12597. * // => true
  12598. */
  12599. function isPlainObject(value) {
  12600. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12601. return false;
  12602. }
  12603. var proto = getPrototype(value);
  12604. if (proto === null) {
  12605. return true;
  12606. }
  12607. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12608. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12609. funcToString.call(Ctor) == objectCtorString;
  12610. }
  12611. /**
  12612. * Checks if `value` is classified as a `RegExp` object.
  12613. *
  12614. * @static
  12615. * @memberOf _
  12616. * @since 0.1.0
  12617. * @category Lang
  12618. * @param {*} value The value to check.
  12619. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12620. * @example
  12621. *
  12622. * _.isRegExp(/abc/);
  12623. * // => true
  12624. *
  12625. * _.isRegExp('/abc/');
  12626. * // => false
  12627. */
  12628. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12629. /**
  12630. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12631. * double precision number which isn't the result of a rounded unsafe integer.
  12632. *
  12633. * **Note:** This method is based on
  12634. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12635. *
  12636. * @static
  12637. * @memberOf _
  12638. * @since 4.0.0
  12639. * @category Lang
  12640. * @param {*} value The value to check.
  12641. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12642. * @example
  12643. *
  12644. * _.isSafeInteger(3);
  12645. * // => true
  12646. *
  12647. * _.isSafeInteger(Number.MIN_VALUE);
  12648. * // => false
  12649. *
  12650. * _.isSafeInteger(Infinity);
  12651. * // => false
  12652. *
  12653. * _.isSafeInteger('3');
  12654. * // => false
  12655. */
  12656. function isSafeInteger(value) {
  12657. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12658. }
  12659. /**
  12660. * Checks if `value` is classified as a `Set` object.
  12661. *
  12662. * @static
  12663. * @memberOf _
  12664. * @since 4.3.0
  12665. * @category Lang
  12666. * @param {*} value The value to check.
  12667. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12668. * @example
  12669. *
  12670. * _.isSet(new Set);
  12671. * // => true
  12672. *
  12673. * _.isSet(new WeakSet);
  12674. * // => false
  12675. */
  12676. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12677. /**
  12678. * Checks if `value` is classified as a `String` primitive or object.
  12679. *
  12680. * @static
  12681. * @since 0.1.0
  12682. * @memberOf _
  12683. * @category Lang
  12684. * @param {*} value The value to check.
  12685. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12686. * @example
  12687. *
  12688. * _.isString('abc');
  12689. * // => true
  12690. *
  12691. * _.isString(1);
  12692. * // => false
  12693. */
  12694. function isString(value) {
  12695. return typeof value == 'string' ||
  12696. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12697. }
  12698. /**
  12699. * Checks if `value` is classified as a `Symbol` primitive or object.
  12700. *
  12701. * @static
  12702. * @memberOf _
  12703. * @since 4.0.0
  12704. * @category Lang
  12705. * @param {*} value The value to check.
  12706. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12707. * @example
  12708. *
  12709. * _.isSymbol(Symbol.iterator);
  12710. * // => true
  12711. *
  12712. * _.isSymbol('abc');
  12713. * // => false
  12714. */
  12715. function isSymbol(value) {
  12716. return typeof value == 'symbol' ||
  12717. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12718. }
  12719. /**
  12720. * Checks if `value` is classified as a typed array.
  12721. *
  12722. * @static
  12723. * @memberOf _
  12724. * @since 3.0.0
  12725. * @category Lang
  12726. * @param {*} value The value to check.
  12727. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12728. * @example
  12729. *
  12730. * _.isTypedArray(new Uint8Array);
  12731. * // => true
  12732. *
  12733. * _.isTypedArray([]);
  12734. * // => false
  12735. */
  12736. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12737. /**
  12738. * Checks if `value` is `undefined`.
  12739. *
  12740. * @static
  12741. * @since 0.1.0
  12742. * @memberOf _
  12743. * @category Lang
  12744. * @param {*} value The value to check.
  12745. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12746. * @example
  12747. *
  12748. * _.isUndefined(void 0);
  12749. * // => true
  12750. *
  12751. * _.isUndefined(null);
  12752. * // => false
  12753. */
  12754. function isUndefined(value) {
  12755. return value === undefined;
  12756. }
  12757. /**
  12758. * Checks if `value` is classified as a `WeakMap` object.
  12759. *
  12760. * @static
  12761. * @memberOf _
  12762. * @since 4.3.0
  12763. * @category Lang
  12764. * @param {*} value The value to check.
  12765. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12766. * @example
  12767. *
  12768. * _.isWeakMap(new WeakMap);
  12769. * // => true
  12770. *
  12771. * _.isWeakMap(new Map);
  12772. * // => false
  12773. */
  12774. function isWeakMap(value) {
  12775. return isObjectLike(value) && getTag(value) == weakMapTag;
  12776. }
  12777. /**
  12778. * Checks if `value` is classified as a `WeakSet` object.
  12779. *
  12780. * @static
  12781. * @memberOf _
  12782. * @since 4.3.0
  12783. * @category Lang
  12784. * @param {*} value The value to check.
  12785. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12786. * @example
  12787. *
  12788. * _.isWeakSet(new WeakSet);
  12789. * // => true
  12790. *
  12791. * _.isWeakSet(new Set);
  12792. * // => false
  12793. */
  12794. function isWeakSet(value) {
  12795. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12796. }
  12797. /**
  12798. * Checks if `value` is less than `other`.
  12799. *
  12800. * @static
  12801. * @memberOf _
  12802. * @since 3.9.0
  12803. * @category Lang
  12804. * @param {*} value The value to compare.
  12805. * @param {*} other The other value to compare.
  12806. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12807. * else `false`.
  12808. * @see _.gt
  12809. * @example
  12810. *
  12811. * _.lt(1, 3);
  12812. * // => true
  12813. *
  12814. * _.lt(3, 3);
  12815. * // => false
  12816. *
  12817. * _.lt(3, 1);
  12818. * // => false
  12819. */
  12820. var lt = createRelationalOperation(baseLt);
  12821. /**
  12822. * Checks if `value` is less than or equal to `other`.
  12823. *
  12824. * @static
  12825. * @memberOf _
  12826. * @since 3.9.0
  12827. * @category Lang
  12828. * @param {*} value The value to compare.
  12829. * @param {*} other The other value to compare.
  12830. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12831. * `other`, else `false`.
  12832. * @see _.gte
  12833. * @example
  12834. *
  12835. * _.lte(1, 3);
  12836. * // => true
  12837. *
  12838. * _.lte(3, 3);
  12839. * // => true
  12840. *
  12841. * _.lte(3, 1);
  12842. * // => false
  12843. */
  12844. var lte = createRelationalOperation(function(value, other) {
  12845. return value <= other;
  12846. });
  12847. /**
  12848. * Converts `value` to an array.
  12849. *
  12850. * @static
  12851. * @since 0.1.0
  12852. * @memberOf _
  12853. * @category Lang
  12854. * @param {*} value The value to convert.
  12855. * @returns {Array} Returns the converted array.
  12856. * @example
  12857. *
  12858. * _.toArray({ 'a': 1, 'b': 2 });
  12859. * // => [1, 2]
  12860. *
  12861. * _.toArray('abc');
  12862. * // => ['a', 'b', 'c']
  12863. *
  12864. * _.toArray(1);
  12865. * // => []
  12866. *
  12867. * _.toArray(null);
  12868. * // => []
  12869. */
  12870. function toArray(value) {
  12871. if (!value) {
  12872. return [];
  12873. }
  12874. if (isArrayLike(value)) {
  12875. return isString(value) ? stringToArray(value) : copyArray(value);
  12876. }
  12877. if (symIterator && value[symIterator]) {
  12878. return iteratorToArray(value[symIterator]());
  12879. }
  12880. var tag = getTag(value),
  12881. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12882. return func(value);
  12883. }
  12884. /**
  12885. * Converts `value` to a finite number.
  12886. *
  12887. * @static
  12888. * @memberOf _
  12889. * @since 4.12.0
  12890. * @category Lang
  12891. * @param {*} value The value to convert.
  12892. * @returns {number} Returns the converted number.
  12893. * @example
  12894. *
  12895. * _.toFinite(3.2);
  12896. * // => 3.2
  12897. *
  12898. * _.toFinite(Number.MIN_VALUE);
  12899. * // => 5e-324
  12900. *
  12901. * _.toFinite(Infinity);
  12902. * // => 1.7976931348623157e+308
  12903. *
  12904. * _.toFinite('3.2');
  12905. * // => 3.2
  12906. */
  12907. function toFinite(value) {
  12908. if (!value) {
  12909. return value === 0 ? value : 0;
  12910. }
  12911. value = toNumber(value);
  12912. if (value === INFINITY || value === -INFINITY) {
  12913. var sign = (value < 0 ? -1 : 1);
  12914. return sign * MAX_INTEGER;
  12915. }
  12916. return value === value ? value : 0;
  12917. }
  12918. /**
  12919. * Converts `value` to an integer.
  12920. *
  12921. * **Note:** This method is loosely based on
  12922. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12923. *
  12924. * @static
  12925. * @memberOf _
  12926. * @since 4.0.0
  12927. * @category Lang
  12928. * @param {*} value The value to convert.
  12929. * @returns {number} Returns the converted integer.
  12930. * @example
  12931. *
  12932. * _.toInteger(3.2);
  12933. * // => 3
  12934. *
  12935. * _.toInteger(Number.MIN_VALUE);
  12936. * // => 0
  12937. *
  12938. * _.toInteger(Infinity);
  12939. * // => 1.7976931348623157e+308
  12940. *
  12941. * _.toInteger('3.2');
  12942. * // => 3
  12943. */
  12944. function toInteger(value) {
  12945. var result = toFinite(value),
  12946. remainder = result % 1;
  12947. return result === result ? (remainder ? result - remainder : result) : 0;
  12948. }
  12949. /**
  12950. * Converts `value` to an integer suitable for use as the length of an
  12951. * array-like object.
  12952. *
  12953. * **Note:** This method is based on
  12954. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12955. *
  12956. * @static
  12957. * @memberOf _
  12958. * @since 4.0.0
  12959. * @category Lang
  12960. * @param {*} value The value to convert.
  12961. * @returns {number} Returns the converted integer.
  12962. * @example
  12963. *
  12964. * _.toLength(3.2);
  12965. * // => 3
  12966. *
  12967. * _.toLength(Number.MIN_VALUE);
  12968. * // => 0
  12969. *
  12970. * _.toLength(Infinity);
  12971. * // => 4294967295
  12972. *
  12973. * _.toLength('3.2');
  12974. * // => 3
  12975. */
  12976. function toLength(value) {
  12977. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12978. }
  12979. /**
  12980. * Converts `value` to a number.
  12981. *
  12982. * @static
  12983. * @memberOf _
  12984. * @since 4.0.0
  12985. * @category Lang
  12986. * @param {*} value The value to process.
  12987. * @returns {number} Returns the number.
  12988. * @example
  12989. *
  12990. * _.toNumber(3.2);
  12991. * // => 3.2
  12992. *
  12993. * _.toNumber(Number.MIN_VALUE);
  12994. * // => 5e-324
  12995. *
  12996. * _.toNumber(Infinity);
  12997. * // => Infinity
  12998. *
  12999. * _.toNumber('3.2');
  13000. * // => 3.2
  13001. */
  13002. function toNumber(value) {
  13003. if (typeof value == 'number') {
  13004. return value;
  13005. }
  13006. if (isSymbol(value)) {
  13007. return NAN;
  13008. }
  13009. if (isObject(value)) {
  13010. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13011. value = isObject(other) ? (other + '') : other;
  13012. }
  13013. if (typeof value != 'string') {
  13014. return value === 0 ? value : +value;
  13015. }
  13016. value = baseTrim(value);
  13017. var isBinary = reIsBinary.test(value);
  13018. return (isBinary || reIsOctal.test(value))
  13019. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13020. : (reIsBadHex.test(value) ? NAN : +value);
  13021. }
  13022. /**
  13023. * Converts `value` to a plain object flattening inherited enumerable string
  13024. * keyed properties of `value` to own properties of the plain object.
  13025. *
  13026. * @static
  13027. * @memberOf _
  13028. * @since 3.0.0
  13029. * @category Lang
  13030. * @param {*} value The value to convert.
  13031. * @returns {Object} Returns the converted plain object.
  13032. * @example
  13033. *
  13034. * function Foo() {
  13035. * this.b = 2;
  13036. * }
  13037. *
  13038. * Foo.prototype.c = 3;
  13039. *
  13040. * _.assign({ 'a': 1 }, new Foo);
  13041. * // => { 'a': 1, 'b': 2 }
  13042. *
  13043. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13044. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13045. */
  13046. function toPlainObject(value) {
  13047. return copyObject(value, keysIn(value));
  13048. }
  13049. /**
  13050. * Converts `value` to a safe integer. A safe integer can be compared and
  13051. * represented correctly.
  13052. *
  13053. * @static
  13054. * @memberOf _
  13055. * @since 4.0.0
  13056. * @category Lang
  13057. * @param {*} value The value to convert.
  13058. * @returns {number} Returns the converted integer.
  13059. * @example
  13060. *
  13061. * _.toSafeInteger(3.2);
  13062. * // => 3
  13063. *
  13064. * _.toSafeInteger(Number.MIN_VALUE);
  13065. * // => 0
  13066. *
  13067. * _.toSafeInteger(Infinity);
  13068. * // => 9007199254740991
  13069. *
  13070. * _.toSafeInteger('3.2');
  13071. * // => 3
  13072. */
  13073. function toSafeInteger(value) {
  13074. return value
  13075. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13076. : (value === 0 ? value : 0);
  13077. }
  13078. /**
  13079. * Converts `value` to a string. An empty string is returned for `null`
  13080. * and `undefined` values. The sign of `-0` is preserved.
  13081. *
  13082. * @static
  13083. * @memberOf _
  13084. * @since 4.0.0
  13085. * @category Lang
  13086. * @param {*} value The value to convert.
  13087. * @returns {string} Returns the converted string.
  13088. * @example
  13089. *
  13090. * _.toString(null);
  13091. * // => ''
  13092. *
  13093. * _.toString(-0);
  13094. * // => '-0'
  13095. *
  13096. * _.toString([1, 2, 3]);
  13097. * // => '1,2,3'
  13098. */
  13099. function toString(value) {
  13100. return value == null ? '' : baseToString(value);
  13101. }
  13102. /*------------------------------------------------------------------------*/
  13103. /**
  13104. * Assigns own enumerable string keyed properties of source objects to the
  13105. * destination object. Source objects are applied from left to right.
  13106. * Subsequent sources overwrite property assignments of previous sources.
  13107. *
  13108. * **Note:** This method mutates `object` and is loosely based on
  13109. * [`Object.assign`](https://mdn.io/Object/assign).
  13110. *
  13111. * @static
  13112. * @memberOf _
  13113. * @since 0.10.0
  13114. * @category Object
  13115. * @param {Object} object The destination object.
  13116. * @param {...Object} [sources] The source objects.
  13117. * @returns {Object} Returns `object`.
  13118. * @see _.assignIn
  13119. * @example
  13120. *
  13121. * function Foo() {
  13122. * this.a = 1;
  13123. * }
  13124. *
  13125. * function Bar() {
  13126. * this.c = 3;
  13127. * }
  13128. *
  13129. * Foo.prototype.b = 2;
  13130. * Bar.prototype.d = 4;
  13131. *
  13132. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13133. * // => { 'a': 1, 'c': 3 }
  13134. */
  13135. var assign = createAssigner(function(object, source) {
  13136. if (isPrototype(source) || isArrayLike(source)) {
  13137. copyObject(source, keys(source), object);
  13138. return;
  13139. }
  13140. for (var key in source) {
  13141. if (hasOwnProperty.call(source, key)) {
  13142. assignValue(object, key, source[key]);
  13143. }
  13144. }
  13145. });
  13146. /**
  13147. * This method is like `_.assign` except that it iterates over own and
  13148. * inherited source properties.
  13149. *
  13150. * **Note:** This method mutates `object`.
  13151. *
  13152. * @static
  13153. * @memberOf _
  13154. * @since 4.0.0
  13155. * @alias extend
  13156. * @category Object
  13157. * @param {Object} object The destination object.
  13158. * @param {...Object} [sources] The source objects.
  13159. * @returns {Object} Returns `object`.
  13160. * @see _.assign
  13161. * @example
  13162. *
  13163. * function Foo() {
  13164. * this.a = 1;
  13165. * }
  13166. *
  13167. * function Bar() {
  13168. * this.c = 3;
  13169. * }
  13170. *
  13171. * Foo.prototype.b = 2;
  13172. * Bar.prototype.d = 4;
  13173. *
  13174. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13175. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13176. */
  13177. var assignIn = createAssigner(function(object, source) {
  13178. copyObject(source, keysIn(source), object);
  13179. });
  13180. /**
  13181. * This method is like `_.assignIn` except that it accepts `customizer`
  13182. * which is invoked to produce the assigned values. If `customizer` returns
  13183. * `undefined`, assignment is handled by the method instead. The `customizer`
  13184. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13185. *
  13186. * **Note:** This method mutates `object`.
  13187. *
  13188. * @static
  13189. * @memberOf _
  13190. * @since 4.0.0
  13191. * @alias extendWith
  13192. * @category Object
  13193. * @param {Object} object The destination object.
  13194. * @param {...Object} sources The source objects.
  13195. * @param {Function} [customizer] The function to customize assigned values.
  13196. * @returns {Object} Returns `object`.
  13197. * @see _.assignWith
  13198. * @example
  13199. *
  13200. * function customizer(objValue, srcValue) {
  13201. * return _.isUndefined(objValue) ? srcValue : objValue;
  13202. * }
  13203. *
  13204. * var defaults = _.partialRight(_.assignInWith, customizer);
  13205. *
  13206. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13207. * // => { 'a': 1, 'b': 2 }
  13208. */
  13209. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13210. copyObject(source, keysIn(source), object, customizer);
  13211. });
  13212. /**
  13213. * This method is like `_.assign` except that it accepts `customizer`
  13214. * which is invoked to produce the assigned values. If `customizer` returns
  13215. * `undefined`, assignment is handled by the method instead. The `customizer`
  13216. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13217. *
  13218. * **Note:** This method mutates `object`.
  13219. *
  13220. * @static
  13221. * @memberOf _
  13222. * @since 4.0.0
  13223. * @category Object
  13224. * @param {Object} object The destination object.
  13225. * @param {...Object} sources The source objects.
  13226. * @param {Function} [customizer] The function to customize assigned values.
  13227. * @returns {Object} Returns `object`.
  13228. * @see _.assignInWith
  13229. * @example
  13230. *
  13231. * function customizer(objValue, srcValue) {
  13232. * return _.isUndefined(objValue) ? srcValue : objValue;
  13233. * }
  13234. *
  13235. * var defaults = _.partialRight(_.assignWith, customizer);
  13236. *
  13237. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13238. * // => { 'a': 1, 'b': 2 }
  13239. */
  13240. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13241. copyObject(source, keys(source), object, customizer);
  13242. });
  13243. /**
  13244. * Creates an array of values corresponding to `paths` of `object`.
  13245. *
  13246. * @static
  13247. * @memberOf _
  13248. * @since 1.0.0
  13249. * @category Object
  13250. * @param {Object} object The object to iterate over.
  13251. * @param {...(string|string[])} [paths] The property paths to pick.
  13252. * @returns {Array} Returns the picked values.
  13253. * @example
  13254. *
  13255. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13256. *
  13257. * _.at(object, ['a[0].b.c', 'a[1]']);
  13258. * // => [3, 4]
  13259. */
  13260. var at = flatRest(baseAt);
  13261. /**
  13262. * Creates an object that inherits from the `prototype` object. If a
  13263. * `properties` object is given, its own enumerable string keyed properties
  13264. * are assigned to the created object.
  13265. *
  13266. * @static
  13267. * @memberOf _
  13268. * @since 2.3.0
  13269. * @category Object
  13270. * @param {Object} prototype The object to inherit from.
  13271. * @param {Object} [properties] The properties to assign to the object.
  13272. * @returns {Object} Returns the new object.
  13273. * @example
  13274. *
  13275. * function Shape() {
  13276. * this.x = 0;
  13277. * this.y = 0;
  13278. * }
  13279. *
  13280. * function Circle() {
  13281. * Shape.call(this);
  13282. * }
  13283. *
  13284. * Circle.prototype = _.create(Shape.prototype, {
  13285. * 'constructor': Circle
  13286. * });
  13287. *
  13288. * var circle = new Circle;
  13289. * circle instanceof Circle;
  13290. * // => true
  13291. *
  13292. * circle instanceof Shape;
  13293. * // => true
  13294. */
  13295. function create(prototype, properties) {
  13296. var result = baseCreate(prototype);
  13297. return properties == null ? result : baseAssign(result, properties);
  13298. }
  13299. /**
  13300. * Assigns own and inherited enumerable string keyed properties of source
  13301. * objects to the destination object for all destination properties that
  13302. * resolve to `undefined`. Source objects are applied from left to right.
  13303. * Once a property is set, additional values of the same property are ignored.
  13304. *
  13305. * **Note:** This method mutates `object`.
  13306. *
  13307. * @static
  13308. * @since 0.1.0
  13309. * @memberOf _
  13310. * @category Object
  13311. * @param {Object} object The destination object.
  13312. * @param {...Object} [sources] The source objects.
  13313. * @returns {Object} Returns `object`.
  13314. * @see _.defaultsDeep
  13315. * @example
  13316. *
  13317. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13318. * // => { 'a': 1, 'b': 2 }
  13319. */
  13320. var defaults = baseRest(function(object, sources) {
  13321. object = Object(object);
  13322. var index = -1;
  13323. var length = sources.length;
  13324. var guard = length > 2 ? sources[2] : undefined;
  13325. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13326. length = 1;
  13327. }
  13328. while (++index < length) {
  13329. var source = sources[index];
  13330. var props = keysIn(source);
  13331. var propsIndex = -1;
  13332. var propsLength = props.length;
  13333. while (++propsIndex < propsLength) {
  13334. var key = props[propsIndex];
  13335. var value = object[key];
  13336. if (value === undefined ||
  13337. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13338. object[key] = source[key];
  13339. }
  13340. }
  13341. }
  13342. return object;
  13343. });
  13344. /**
  13345. * This method is like `_.defaults` except that it recursively assigns
  13346. * default properties.
  13347. *
  13348. * **Note:** This method mutates `object`.
  13349. *
  13350. * @static
  13351. * @memberOf _
  13352. * @since 3.10.0
  13353. * @category Object
  13354. * @param {Object} object The destination object.
  13355. * @param {...Object} [sources] The source objects.
  13356. * @returns {Object} Returns `object`.
  13357. * @see _.defaults
  13358. * @example
  13359. *
  13360. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13361. * // => { 'a': { 'b': 2, 'c': 3 } }
  13362. */
  13363. var defaultsDeep = baseRest(function(args) {
  13364. args.push(undefined, customDefaultsMerge);
  13365. return apply(mergeWith, undefined, args);
  13366. });
  13367. /**
  13368. * This method is like `_.find` except that it returns the key of the first
  13369. * element `predicate` returns truthy for instead of the element itself.
  13370. *
  13371. * @static
  13372. * @memberOf _
  13373. * @since 1.1.0
  13374. * @category Object
  13375. * @param {Object} object The object to inspect.
  13376. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13377. * @returns {string|undefined} Returns the key of the matched element,
  13378. * else `undefined`.
  13379. * @example
  13380. *
  13381. * var users = {
  13382. * 'barney': { 'age': 36, 'active': true },
  13383. * 'fred': { 'age': 40, 'active': false },
  13384. * 'pebbles': { 'age': 1, 'active': true }
  13385. * };
  13386. *
  13387. * _.findKey(users, function(o) { return o.age < 40; });
  13388. * // => 'barney' (iteration order is not guaranteed)
  13389. *
  13390. * // The `_.matches` iteratee shorthand.
  13391. * _.findKey(users, { 'age': 1, 'active': true });
  13392. * // => 'pebbles'
  13393. *
  13394. * // The `_.matchesProperty` iteratee shorthand.
  13395. * _.findKey(users, ['active', false]);
  13396. * // => 'fred'
  13397. *
  13398. * // The `_.property` iteratee shorthand.
  13399. * _.findKey(users, 'active');
  13400. * // => 'barney'
  13401. */
  13402. function findKey(object, predicate) {
  13403. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13404. }
  13405. /**
  13406. * This method is like `_.findKey` except that it iterates over elements of
  13407. * a collection in the opposite order.
  13408. *
  13409. * @static
  13410. * @memberOf _
  13411. * @since 2.0.0
  13412. * @category Object
  13413. * @param {Object} object The object to inspect.
  13414. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13415. * @returns {string|undefined} Returns the key of the matched element,
  13416. * else `undefined`.
  13417. * @example
  13418. *
  13419. * var users = {
  13420. * 'barney': { 'age': 36, 'active': true },
  13421. * 'fred': { 'age': 40, 'active': false },
  13422. * 'pebbles': { 'age': 1, 'active': true }
  13423. * };
  13424. *
  13425. * _.findLastKey(users, function(o) { return o.age < 40; });
  13426. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13427. *
  13428. * // The `_.matches` iteratee shorthand.
  13429. * _.findLastKey(users, { 'age': 36, 'active': true });
  13430. * // => 'barney'
  13431. *
  13432. * // The `_.matchesProperty` iteratee shorthand.
  13433. * _.findLastKey(users, ['active', false]);
  13434. * // => 'fred'
  13435. *
  13436. * // The `_.property` iteratee shorthand.
  13437. * _.findLastKey(users, 'active');
  13438. * // => 'pebbles'
  13439. */
  13440. function findLastKey(object, predicate) {
  13441. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13442. }
  13443. /**
  13444. * Iterates over own and inherited enumerable string keyed properties of an
  13445. * object and invokes `iteratee` for each property. The iteratee is invoked
  13446. * with three arguments: (value, key, object). Iteratee functions may exit
  13447. * iteration early by explicitly returning `false`.
  13448. *
  13449. * @static
  13450. * @memberOf _
  13451. * @since 0.3.0
  13452. * @category Object
  13453. * @param {Object} object The object to iterate over.
  13454. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13455. * @returns {Object} Returns `object`.
  13456. * @see _.forInRight
  13457. * @example
  13458. *
  13459. * function Foo() {
  13460. * this.a = 1;
  13461. * this.b = 2;
  13462. * }
  13463. *
  13464. * Foo.prototype.c = 3;
  13465. *
  13466. * _.forIn(new Foo, function(value, key) {
  13467. * console.log(key);
  13468. * });
  13469. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13470. */
  13471. function forIn(object, iteratee) {
  13472. return object == null
  13473. ? object
  13474. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13475. }
  13476. /**
  13477. * This method is like `_.forIn` except that it iterates over properties of
  13478. * `object` in the opposite order.
  13479. *
  13480. * @static
  13481. * @memberOf _
  13482. * @since 2.0.0
  13483. * @category Object
  13484. * @param {Object} object The object to iterate over.
  13485. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13486. * @returns {Object} Returns `object`.
  13487. * @see _.forIn
  13488. * @example
  13489. *
  13490. * function Foo() {
  13491. * this.a = 1;
  13492. * this.b = 2;
  13493. * }
  13494. *
  13495. * Foo.prototype.c = 3;
  13496. *
  13497. * _.forInRight(new Foo, function(value, key) {
  13498. * console.log(key);
  13499. * });
  13500. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13501. */
  13502. function forInRight(object, iteratee) {
  13503. return object == null
  13504. ? object
  13505. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13506. }
  13507. /**
  13508. * Iterates over own enumerable string keyed properties of an object and
  13509. * invokes `iteratee` for each property. The iteratee is invoked with three
  13510. * arguments: (value, key, object). Iteratee functions may exit iteration
  13511. * early by explicitly returning `false`.
  13512. *
  13513. * @static
  13514. * @memberOf _
  13515. * @since 0.3.0
  13516. * @category Object
  13517. * @param {Object} object The object to iterate over.
  13518. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13519. * @returns {Object} Returns `object`.
  13520. * @see _.forOwnRight
  13521. * @example
  13522. *
  13523. * function Foo() {
  13524. * this.a = 1;
  13525. * this.b = 2;
  13526. * }
  13527. *
  13528. * Foo.prototype.c = 3;
  13529. *
  13530. * _.forOwn(new Foo, function(value, key) {
  13531. * console.log(key);
  13532. * });
  13533. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13534. */
  13535. function forOwn(object, iteratee) {
  13536. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13537. }
  13538. /**
  13539. * This method is like `_.forOwn` except that it iterates over properties of
  13540. * `object` in the opposite order.
  13541. *
  13542. * @static
  13543. * @memberOf _
  13544. * @since 2.0.0
  13545. * @category Object
  13546. * @param {Object} object The object to iterate over.
  13547. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13548. * @returns {Object} Returns `object`.
  13549. * @see _.forOwn
  13550. * @example
  13551. *
  13552. * function Foo() {
  13553. * this.a = 1;
  13554. * this.b = 2;
  13555. * }
  13556. *
  13557. * Foo.prototype.c = 3;
  13558. *
  13559. * _.forOwnRight(new Foo, function(value, key) {
  13560. * console.log(key);
  13561. * });
  13562. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13563. */
  13564. function forOwnRight(object, iteratee) {
  13565. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13566. }
  13567. /**
  13568. * Creates an array of function property names from own enumerable properties
  13569. * of `object`.
  13570. *
  13571. * @static
  13572. * @since 0.1.0
  13573. * @memberOf _
  13574. * @category Object
  13575. * @param {Object} object The object to inspect.
  13576. * @returns {Array} Returns the function names.
  13577. * @see _.functionsIn
  13578. * @example
  13579. *
  13580. * function Foo() {
  13581. * this.a = _.constant('a');
  13582. * this.b = _.constant('b');
  13583. * }
  13584. *
  13585. * Foo.prototype.c = _.constant('c');
  13586. *
  13587. * _.functions(new Foo);
  13588. * // => ['a', 'b']
  13589. */
  13590. function functions(object) {
  13591. return object == null ? [] : baseFunctions(object, keys(object));
  13592. }
  13593. /**
  13594. * Creates an array of function property names from own and inherited
  13595. * enumerable properties of `object`.
  13596. *
  13597. * @static
  13598. * @memberOf _
  13599. * @since 4.0.0
  13600. * @category Object
  13601. * @param {Object} object The object to inspect.
  13602. * @returns {Array} Returns the function names.
  13603. * @see _.functions
  13604. * @example
  13605. *
  13606. * function Foo() {
  13607. * this.a = _.constant('a');
  13608. * this.b = _.constant('b');
  13609. * }
  13610. *
  13611. * Foo.prototype.c = _.constant('c');
  13612. *
  13613. * _.functionsIn(new Foo);
  13614. * // => ['a', 'b', 'c']
  13615. */
  13616. function functionsIn(object) {
  13617. return object == null ? [] : baseFunctions(object, keysIn(object));
  13618. }
  13619. /**
  13620. * Gets the value at `path` of `object`. If the resolved value is
  13621. * `undefined`, the `defaultValue` is returned in its place.
  13622. *
  13623. * @static
  13624. * @memberOf _
  13625. * @since 3.7.0
  13626. * @category Object
  13627. * @param {Object} object The object to query.
  13628. * @param {Array|string} path The path of the property to get.
  13629. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13630. * @returns {*} Returns the resolved value.
  13631. * @example
  13632. *
  13633. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13634. *
  13635. * _.get(object, 'a[0].b.c');
  13636. * // => 3
  13637. *
  13638. * _.get(object, ['a', '0', 'b', 'c']);
  13639. * // => 3
  13640. *
  13641. * _.get(object, 'a.b.c', 'default');
  13642. * // => 'default'
  13643. */
  13644. function get(object, path, defaultValue) {
  13645. var result = object == null ? undefined : baseGet(object, path);
  13646. return result === undefined ? defaultValue : result;
  13647. }
  13648. /**
  13649. * Checks if `path` is a direct property of `object`.
  13650. *
  13651. * @static
  13652. * @since 0.1.0
  13653. * @memberOf _
  13654. * @category Object
  13655. * @param {Object} object The object to query.
  13656. * @param {Array|string} path The path to check.
  13657. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13658. * @example
  13659. *
  13660. * var object = { 'a': { 'b': 2 } };
  13661. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13662. *
  13663. * _.has(object, 'a');
  13664. * // => true
  13665. *
  13666. * _.has(object, 'a.b');
  13667. * // => true
  13668. *
  13669. * _.has(object, ['a', 'b']);
  13670. * // => true
  13671. *
  13672. * _.has(other, 'a');
  13673. * // => false
  13674. */
  13675. function has(object, path) {
  13676. return object != null && hasPath(object, path, baseHas);
  13677. }
  13678. /**
  13679. * Checks if `path` is a direct or inherited property of `object`.
  13680. *
  13681. * @static
  13682. * @memberOf _
  13683. * @since 4.0.0
  13684. * @category Object
  13685. * @param {Object} object The object to query.
  13686. * @param {Array|string} path The path to check.
  13687. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13688. * @example
  13689. *
  13690. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13691. *
  13692. * _.hasIn(object, 'a');
  13693. * // => true
  13694. *
  13695. * _.hasIn(object, 'a.b');
  13696. * // => true
  13697. *
  13698. * _.hasIn(object, ['a', 'b']);
  13699. * // => true
  13700. *
  13701. * _.hasIn(object, 'b');
  13702. * // => false
  13703. */
  13704. function hasIn(object, path) {
  13705. return object != null && hasPath(object, path, baseHasIn);
  13706. }
  13707. /**
  13708. * Creates an object composed of the inverted keys and values of `object`.
  13709. * If `object` contains duplicate values, subsequent values overwrite
  13710. * property assignments of previous values.
  13711. *
  13712. * @static
  13713. * @memberOf _
  13714. * @since 0.7.0
  13715. * @category Object
  13716. * @param {Object} object The object to invert.
  13717. * @returns {Object} Returns the new inverted object.
  13718. * @example
  13719. *
  13720. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13721. *
  13722. * _.invert(object);
  13723. * // => { '1': 'c', '2': 'b' }
  13724. */
  13725. var invert = createInverter(function(result, value, key) {
  13726. if (value != null &&
  13727. typeof value.toString != 'function') {
  13728. value = nativeObjectToString.call(value);
  13729. }
  13730. result[value] = key;
  13731. }, constant(identity));
  13732. /**
  13733. * This method is like `_.invert` except that the inverted object is generated
  13734. * from the results of running each element of `object` thru `iteratee`. The
  13735. * corresponding inverted value of each inverted key is an array of keys
  13736. * responsible for generating the inverted value. The iteratee is invoked
  13737. * with one argument: (value).
  13738. *
  13739. * @static
  13740. * @memberOf _
  13741. * @since 4.1.0
  13742. * @category Object
  13743. * @param {Object} object The object to invert.
  13744. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13745. * @returns {Object} Returns the new inverted object.
  13746. * @example
  13747. *
  13748. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13749. *
  13750. * _.invertBy(object);
  13751. * // => { '1': ['a', 'c'], '2': ['b'] }
  13752. *
  13753. * _.invertBy(object, function(value) {
  13754. * return 'group' + value;
  13755. * });
  13756. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13757. */
  13758. var invertBy = createInverter(function(result, value, key) {
  13759. if (value != null &&
  13760. typeof value.toString != 'function') {
  13761. value = nativeObjectToString.call(value);
  13762. }
  13763. if (hasOwnProperty.call(result, value)) {
  13764. result[value].push(key);
  13765. } else {
  13766. result[value] = [key];
  13767. }
  13768. }, getIteratee);
  13769. /**
  13770. * Invokes the method at `path` of `object`.
  13771. *
  13772. * @static
  13773. * @memberOf _
  13774. * @since 4.0.0
  13775. * @category Object
  13776. * @param {Object} object The object to query.
  13777. * @param {Array|string} path The path of the method to invoke.
  13778. * @param {...*} [args] The arguments to invoke the method with.
  13779. * @returns {*} Returns the result of the invoked method.
  13780. * @example
  13781. *
  13782. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13783. *
  13784. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13785. * // => [2, 3]
  13786. */
  13787. var invoke = baseRest(baseInvoke);
  13788. /**
  13789. * Creates an array of the own enumerable property names of `object`.
  13790. *
  13791. * **Note:** Non-object values are coerced to objects. See the
  13792. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13793. * for more details.
  13794. *
  13795. * @static
  13796. * @since 0.1.0
  13797. * @memberOf _
  13798. * @category Object
  13799. * @param {Object} object The object to query.
  13800. * @returns {Array} Returns the array of property names.
  13801. * @example
  13802. *
  13803. * function Foo() {
  13804. * this.a = 1;
  13805. * this.b = 2;
  13806. * }
  13807. *
  13808. * Foo.prototype.c = 3;
  13809. *
  13810. * _.keys(new Foo);
  13811. * // => ['a', 'b'] (iteration order is not guaranteed)
  13812. *
  13813. * _.keys('hi');
  13814. * // => ['0', '1']
  13815. */
  13816. function keys(object) {
  13817. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13818. }
  13819. /**
  13820. * Creates an array of the own and inherited enumerable property names of `object`.
  13821. *
  13822. * **Note:** Non-object values are coerced to objects.
  13823. *
  13824. * @static
  13825. * @memberOf _
  13826. * @since 3.0.0
  13827. * @category Object
  13828. * @param {Object} object The object to query.
  13829. * @returns {Array} Returns the array of property names.
  13830. * @example
  13831. *
  13832. * function Foo() {
  13833. * this.a = 1;
  13834. * this.b = 2;
  13835. * }
  13836. *
  13837. * Foo.prototype.c = 3;
  13838. *
  13839. * _.keysIn(new Foo);
  13840. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13841. */
  13842. function keysIn(object) {
  13843. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13844. }
  13845. /**
  13846. * The opposite of `_.mapValues`; this method creates an object with the
  13847. * same values as `object` and keys generated by running each own enumerable
  13848. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13849. * with three arguments: (value, key, object).
  13850. *
  13851. * @static
  13852. * @memberOf _
  13853. * @since 3.8.0
  13854. * @category Object
  13855. * @param {Object} object The object to iterate over.
  13856. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13857. * @returns {Object} Returns the new mapped object.
  13858. * @see _.mapValues
  13859. * @example
  13860. *
  13861. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13862. * return key + value;
  13863. * });
  13864. * // => { 'a1': 1, 'b2': 2 }
  13865. */
  13866. function mapKeys(object, iteratee) {
  13867. var result = {};
  13868. iteratee = getIteratee(iteratee, 3);
  13869. baseForOwn(object, function(value, key, object) {
  13870. baseAssignValue(result, iteratee(value, key, object), value);
  13871. });
  13872. return result;
  13873. }
  13874. /**
  13875. * Creates an object with the same keys as `object` and values generated
  13876. * by running each own enumerable string keyed property of `object` thru
  13877. * `iteratee`. The iteratee is invoked with three arguments:
  13878. * (value, key, object).
  13879. *
  13880. * @static
  13881. * @memberOf _
  13882. * @since 2.4.0
  13883. * @category Object
  13884. * @param {Object} object The object to iterate over.
  13885. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13886. * @returns {Object} Returns the new mapped object.
  13887. * @see _.mapKeys
  13888. * @example
  13889. *
  13890. * var users = {
  13891. * 'fred': { 'user': 'fred', 'age': 40 },
  13892. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13893. * };
  13894. *
  13895. * _.mapValues(users, function(o) { return o.age; });
  13896. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13897. *
  13898. * // The `_.property` iteratee shorthand.
  13899. * _.mapValues(users, 'age');
  13900. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13901. */
  13902. function mapValues(object, iteratee) {
  13903. var result = {};
  13904. iteratee = getIteratee(iteratee, 3);
  13905. baseForOwn(object, function(value, key, object) {
  13906. baseAssignValue(result, key, iteratee(value, key, object));
  13907. });
  13908. return result;
  13909. }
  13910. /**
  13911. * This method is like `_.assign` except that it recursively merges own and
  13912. * inherited enumerable string keyed properties of source objects into the
  13913. * destination object. Source properties that resolve to `undefined` are
  13914. * skipped if a destination value exists. Array and plain object properties
  13915. * are merged recursively. Other objects and value types are overridden by
  13916. * assignment. Source objects are applied from left to right. Subsequent
  13917. * sources overwrite property assignments of previous sources.
  13918. *
  13919. * **Note:** This method mutates `object`.
  13920. *
  13921. * @static
  13922. * @memberOf _
  13923. * @since 0.5.0
  13924. * @category Object
  13925. * @param {Object} object The destination object.
  13926. * @param {...Object} [sources] The source objects.
  13927. * @returns {Object} Returns `object`.
  13928. * @example
  13929. *
  13930. * var object = {
  13931. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13932. * };
  13933. *
  13934. * var other = {
  13935. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13936. * };
  13937. *
  13938. * _.merge(object, other);
  13939. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13940. */
  13941. var merge = createAssigner(function(object, source, srcIndex) {
  13942. baseMerge(object, source, srcIndex);
  13943. });
  13944. /**
  13945. * This method is like `_.merge` except that it accepts `customizer` which
  13946. * is invoked to produce the merged values of the destination and source
  13947. * properties. If `customizer` returns `undefined`, merging is handled by the
  13948. * method instead. The `customizer` is invoked with six arguments:
  13949. * (objValue, srcValue, key, object, source, stack).
  13950. *
  13951. * **Note:** This method mutates `object`.
  13952. *
  13953. * @static
  13954. * @memberOf _
  13955. * @since 4.0.0
  13956. * @category Object
  13957. * @param {Object} object The destination object.
  13958. * @param {...Object} sources The source objects.
  13959. * @param {Function} customizer The function to customize assigned values.
  13960. * @returns {Object} Returns `object`.
  13961. * @example
  13962. *
  13963. * function customizer(objValue, srcValue) {
  13964. * if (_.isArray(objValue)) {
  13965. * return objValue.concat(srcValue);
  13966. * }
  13967. * }
  13968. *
  13969. * var object = { 'a': [1], 'b': [2] };
  13970. * var other = { 'a': [3], 'b': [4] };
  13971. *
  13972. * _.mergeWith(object, other, customizer);
  13973. * // => { 'a': [1, 3], 'b': [2, 4] }
  13974. */
  13975. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13976. baseMerge(object, source, srcIndex, customizer);
  13977. });
  13978. /**
  13979. * The opposite of `_.pick`; this method creates an object composed of the
  13980. * own and inherited enumerable property paths of `object` that are not omitted.
  13981. *
  13982. * **Note:** This method is considerably slower than `_.pick`.
  13983. *
  13984. * @static
  13985. * @since 0.1.0
  13986. * @memberOf _
  13987. * @category Object
  13988. * @param {Object} object The source object.
  13989. * @param {...(string|string[])} [paths] The property paths to omit.
  13990. * @returns {Object} Returns the new object.
  13991. * @example
  13992. *
  13993. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13994. *
  13995. * _.omit(object, ['a', 'c']);
  13996. * // => { 'b': '2' }
  13997. */
  13998. var omit = flatRest(function(object, paths) {
  13999. var result = {};
  14000. if (object == null) {
  14001. return result;
  14002. }
  14003. var isDeep = false;
  14004. paths = arrayMap(paths, function(path) {
  14005. path = castPath(path, object);
  14006. isDeep || (isDeep = path.length > 1);
  14007. return path;
  14008. });
  14009. copyObject(object, getAllKeysIn(object), result);
  14010. if (isDeep) {
  14011. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14012. }
  14013. var length = paths.length;
  14014. while (length--) {
  14015. baseUnset(result, paths[length]);
  14016. }
  14017. return result;
  14018. });
  14019. /**
  14020. * The opposite of `_.pickBy`; this method creates an object composed of
  14021. * the own and inherited enumerable string keyed properties of `object` that
  14022. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14023. * arguments: (value, key).
  14024. *
  14025. * @static
  14026. * @memberOf _
  14027. * @since 4.0.0
  14028. * @category Object
  14029. * @param {Object} object The source object.
  14030. * @param {Function} [predicate=_.identity] The function invoked per property.
  14031. * @returns {Object} Returns the new object.
  14032. * @example
  14033. *
  14034. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14035. *
  14036. * _.omitBy(object, _.isNumber);
  14037. * // => { 'b': '2' }
  14038. */
  14039. function omitBy(object, predicate) {
  14040. return pickBy(object, negate(getIteratee(predicate)));
  14041. }
  14042. /**
  14043. * Creates an object composed of the picked `object` properties.
  14044. *
  14045. * @static
  14046. * @since 0.1.0
  14047. * @memberOf _
  14048. * @category Object
  14049. * @param {Object} object The source object.
  14050. * @param {...(string|string[])} [paths] The property paths to pick.
  14051. * @returns {Object} Returns the new object.
  14052. * @example
  14053. *
  14054. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14055. *
  14056. * _.pick(object, ['a', 'c']);
  14057. * // => { 'a': 1, 'c': 3 }
  14058. */
  14059. var pick = flatRest(function(object, paths) {
  14060. return object == null ? {} : basePick(object, paths);
  14061. });
  14062. /**
  14063. * Creates an object composed of the `object` properties `predicate` returns
  14064. * truthy for. The predicate is invoked with two arguments: (value, key).
  14065. *
  14066. * @static
  14067. * @memberOf _
  14068. * @since 4.0.0
  14069. * @category Object
  14070. * @param {Object} object The source object.
  14071. * @param {Function} [predicate=_.identity] The function invoked per property.
  14072. * @returns {Object} Returns the new object.
  14073. * @example
  14074. *
  14075. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14076. *
  14077. * _.pickBy(object, _.isNumber);
  14078. * // => { 'a': 1, 'c': 3 }
  14079. */
  14080. function pickBy(object, predicate) {
  14081. if (object == null) {
  14082. return {};
  14083. }
  14084. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14085. return [prop];
  14086. });
  14087. predicate = getIteratee(predicate);
  14088. return basePickBy(object, props, function(value, path) {
  14089. return predicate(value, path[0]);
  14090. });
  14091. }
  14092. /**
  14093. * This method is like `_.get` except that if the resolved value is a
  14094. * function it's invoked with the `this` binding of its parent object and
  14095. * its result is returned.
  14096. *
  14097. * @static
  14098. * @since 0.1.0
  14099. * @memberOf _
  14100. * @category Object
  14101. * @param {Object} object The object to query.
  14102. * @param {Array|string} path The path of the property to resolve.
  14103. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14104. * @returns {*} Returns the resolved value.
  14105. * @example
  14106. *
  14107. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14108. *
  14109. * _.result(object, 'a[0].b.c1');
  14110. * // => 3
  14111. *
  14112. * _.result(object, 'a[0].b.c2');
  14113. * // => 4
  14114. *
  14115. * _.result(object, 'a[0].b.c3', 'default');
  14116. * // => 'default'
  14117. *
  14118. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14119. * // => 'default'
  14120. */
  14121. function result(object, path, defaultValue) {
  14122. path = castPath(path, object);
  14123. var index = -1,
  14124. length = path.length;
  14125. // Ensure the loop is entered when path is empty.
  14126. if (!length) {
  14127. length = 1;
  14128. object = undefined;
  14129. }
  14130. while (++index < length) {
  14131. var value = object == null ? undefined : object[toKey(path[index])];
  14132. if (value === undefined) {
  14133. index = length;
  14134. value = defaultValue;
  14135. }
  14136. object = isFunction(value) ? value.call(object) : value;
  14137. }
  14138. return object;
  14139. }
  14140. /**
  14141. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14142. * it's created. Arrays are created for missing index properties while objects
  14143. * are created for all other missing properties. Use `_.setWith` to customize
  14144. * `path` creation.
  14145. *
  14146. * **Note:** This method mutates `object`.
  14147. *
  14148. * @static
  14149. * @memberOf _
  14150. * @since 3.7.0
  14151. * @category Object
  14152. * @param {Object} object The object to modify.
  14153. * @param {Array|string} path The path of the property to set.
  14154. * @param {*} value The value to set.
  14155. * @returns {Object} Returns `object`.
  14156. * @example
  14157. *
  14158. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14159. *
  14160. * _.set(object, 'a[0].b.c', 4);
  14161. * console.log(object.a[0].b.c);
  14162. * // => 4
  14163. *
  14164. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14165. * console.log(object.x[0].y.z);
  14166. * // => 5
  14167. */
  14168. function set(object, path, value) {
  14169. return object == null ? object : baseSet(object, path, value);
  14170. }
  14171. /**
  14172. * This method is like `_.set` except that it accepts `customizer` which is
  14173. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14174. * path creation is handled by the method instead. The `customizer` is invoked
  14175. * with three arguments: (nsValue, key, nsObject).
  14176. *
  14177. * **Note:** This method mutates `object`.
  14178. *
  14179. * @static
  14180. * @memberOf _
  14181. * @since 4.0.0
  14182. * @category Object
  14183. * @param {Object} object The object to modify.
  14184. * @param {Array|string} path The path of the property to set.
  14185. * @param {*} value The value to set.
  14186. * @param {Function} [customizer] The function to customize assigned values.
  14187. * @returns {Object} Returns `object`.
  14188. * @example
  14189. *
  14190. * var object = {};
  14191. *
  14192. * _.setWith(object, '[0][1]', 'a', Object);
  14193. * // => { '0': { '1': 'a' } }
  14194. */
  14195. function setWith(object, path, value, customizer) {
  14196. customizer = typeof customizer == 'function' ? customizer : undefined;
  14197. return object == null ? object : baseSet(object, path, value, customizer);
  14198. }
  14199. /**
  14200. * Creates an array of own enumerable string keyed-value pairs for `object`
  14201. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14202. * entries are returned.
  14203. *
  14204. * @static
  14205. * @memberOf _
  14206. * @since 4.0.0
  14207. * @alias entries
  14208. * @category Object
  14209. * @param {Object} object The object to query.
  14210. * @returns {Array} Returns the key-value pairs.
  14211. * @example
  14212. *
  14213. * function Foo() {
  14214. * this.a = 1;
  14215. * this.b = 2;
  14216. * }
  14217. *
  14218. * Foo.prototype.c = 3;
  14219. *
  14220. * _.toPairs(new Foo);
  14221. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14222. */
  14223. var toPairs = createToPairs(keys);
  14224. /**
  14225. * Creates an array of own and inherited enumerable string keyed-value pairs
  14226. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14227. * or set, its entries are returned.
  14228. *
  14229. * @static
  14230. * @memberOf _
  14231. * @since 4.0.0
  14232. * @alias entriesIn
  14233. * @category Object
  14234. * @param {Object} object The object to query.
  14235. * @returns {Array} Returns the key-value pairs.
  14236. * @example
  14237. *
  14238. * function Foo() {
  14239. * this.a = 1;
  14240. * this.b = 2;
  14241. * }
  14242. *
  14243. * Foo.prototype.c = 3;
  14244. *
  14245. * _.toPairsIn(new Foo);
  14246. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14247. */
  14248. var toPairsIn = createToPairs(keysIn);
  14249. /**
  14250. * An alternative to `_.reduce`; this method transforms `object` to a new
  14251. * `accumulator` object which is the result of running each of its own
  14252. * enumerable string keyed properties thru `iteratee`, with each invocation
  14253. * potentially mutating the `accumulator` object. If `accumulator` is not
  14254. * provided, a new object with the same `[[Prototype]]` will be used. The
  14255. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14256. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14257. *
  14258. * @static
  14259. * @memberOf _
  14260. * @since 1.3.0
  14261. * @category Object
  14262. * @param {Object} object The object to iterate over.
  14263. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14264. * @param {*} [accumulator] The custom accumulator value.
  14265. * @returns {*} Returns the accumulated value.
  14266. * @example
  14267. *
  14268. * _.transform([2, 3, 4], function(result, n) {
  14269. * result.push(n *= n);
  14270. * return n % 2 == 0;
  14271. * }, []);
  14272. * // => [4, 9]
  14273. *
  14274. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14275. * (result[value] || (result[value] = [])).push(key);
  14276. * }, {});
  14277. * // => { '1': ['a', 'c'], '2': ['b'] }
  14278. */
  14279. function transform(object, iteratee, accumulator) {
  14280. var isArr = isArray(object),
  14281. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14282. iteratee = getIteratee(iteratee, 4);
  14283. if (accumulator == null) {
  14284. var Ctor = object && object.constructor;
  14285. if (isArrLike) {
  14286. accumulator = isArr ? new Ctor : [];
  14287. }
  14288. else if (isObject(object)) {
  14289. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14290. }
  14291. else {
  14292. accumulator = {};
  14293. }
  14294. }
  14295. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14296. return iteratee(accumulator, value, index, object);
  14297. });
  14298. return accumulator;
  14299. }
  14300. /**
  14301. * Removes the property at `path` of `object`.
  14302. *
  14303. * **Note:** This method mutates `object`.
  14304. *
  14305. * @static
  14306. * @memberOf _
  14307. * @since 4.0.0
  14308. * @category Object
  14309. * @param {Object} object The object to modify.
  14310. * @param {Array|string} path The path of the property to unset.
  14311. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14312. * @example
  14313. *
  14314. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14315. * _.unset(object, 'a[0].b.c');
  14316. * // => true
  14317. *
  14318. * console.log(object);
  14319. * // => { 'a': [{ 'b': {} }] };
  14320. *
  14321. * _.unset(object, ['a', '0', 'b', 'c']);
  14322. * // => true
  14323. *
  14324. * console.log(object);
  14325. * // => { 'a': [{ 'b': {} }] };
  14326. */
  14327. function unset(object, path) {
  14328. return object == null ? true : baseUnset(object, path);
  14329. }
  14330. /**
  14331. * This method is like `_.set` except that accepts `updater` to produce the
  14332. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14333. * is invoked with one argument: (value).
  14334. *
  14335. * **Note:** This method mutates `object`.
  14336. *
  14337. * @static
  14338. * @memberOf _
  14339. * @since 4.6.0
  14340. * @category Object
  14341. * @param {Object} object The object to modify.
  14342. * @param {Array|string} path The path of the property to set.
  14343. * @param {Function} updater The function to produce the updated value.
  14344. * @returns {Object} Returns `object`.
  14345. * @example
  14346. *
  14347. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14348. *
  14349. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14350. * console.log(object.a[0].b.c);
  14351. * // => 9
  14352. *
  14353. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14354. * console.log(object.x[0].y.z);
  14355. * // => 0
  14356. */
  14357. function update(object, path, updater) {
  14358. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14359. }
  14360. /**
  14361. * This method is like `_.update` except that it accepts `customizer` which is
  14362. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14363. * path creation is handled by the method instead. The `customizer` is invoked
  14364. * with three arguments: (nsValue, key, nsObject).
  14365. *
  14366. * **Note:** This method mutates `object`.
  14367. *
  14368. * @static
  14369. * @memberOf _
  14370. * @since 4.6.0
  14371. * @category Object
  14372. * @param {Object} object The object to modify.
  14373. * @param {Array|string} path The path of the property to set.
  14374. * @param {Function} updater The function to produce the updated value.
  14375. * @param {Function} [customizer] The function to customize assigned values.
  14376. * @returns {Object} Returns `object`.
  14377. * @example
  14378. *
  14379. * var object = {};
  14380. *
  14381. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14382. * // => { '0': { '1': 'a' } }
  14383. */
  14384. function updateWith(object, path, updater, customizer) {
  14385. customizer = typeof customizer == 'function' ? customizer : undefined;
  14386. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14387. }
  14388. /**
  14389. * Creates an array of the own enumerable string keyed property values of `object`.
  14390. *
  14391. * **Note:** Non-object values are coerced to objects.
  14392. *
  14393. * @static
  14394. * @since 0.1.0
  14395. * @memberOf _
  14396. * @category Object
  14397. * @param {Object} object The object to query.
  14398. * @returns {Array} Returns the array of property values.
  14399. * @example
  14400. *
  14401. * function Foo() {
  14402. * this.a = 1;
  14403. * this.b = 2;
  14404. * }
  14405. *
  14406. * Foo.prototype.c = 3;
  14407. *
  14408. * _.values(new Foo);
  14409. * // => [1, 2] (iteration order is not guaranteed)
  14410. *
  14411. * _.values('hi');
  14412. * // => ['h', 'i']
  14413. */
  14414. function values(object) {
  14415. return object == null ? [] : baseValues(object, keys(object));
  14416. }
  14417. /**
  14418. * Creates an array of the own and inherited enumerable string keyed property
  14419. * values of `object`.
  14420. *
  14421. * **Note:** Non-object values are coerced to objects.
  14422. *
  14423. * @static
  14424. * @memberOf _
  14425. * @since 3.0.0
  14426. * @category Object
  14427. * @param {Object} object The object to query.
  14428. * @returns {Array} Returns the array of property values.
  14429. * @example
  14430. *
  14431. * function Foo() {
  14432. * this.a = 1;
  14433. * this.b = 2;
  14434. * }
  14435. *
  14436. * Foo.prototype.c = 3;
  14437. *
  14438. * _.valuesIn(new Foo);
  14439. * // => [1, 2, 3] (iteration order is not guaranteed)
  14440. */
  14441. function valuesIn(object) {
  14442. return object == null ? [] : baseValues(object, keysIn(object));
  14443. }
  14444. /*------------------------------------------------------------------------*/
  14445. /**
  14446. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14447. *
  14448. * @static
  14449. * @memberOf _
  14450. * @since 4.0.0
  14451. * @category Number
  14452. * @param {number} number The number to clamp.
  14453. * @param {number} [lower] The lower bound.
  14454. * @param {number} upper The upper bound.
  14455. * @returns {number} Returns the clamped number.
  14456. * @example
  14457. *
  14458. * _.clamp(-10, -5, 5);
  14459. * // => -5
  14460. *
  14461. * _.clamp(10, -5, 5);
  14462. * // => 5
  14463. */
  14464. function clamp(number, lower, upper) {
  14465. if (upper === undefined) {
  14466. upper = lower;
  14467. lower = undefined;
  14468. }
  14469. if (upper !== undefined) {
  14470. upper = toNumber(upper);
  14471. upper = upper === upper ? upper : 0;
  14472. }
  14473. if (lower !== undefined) {
  14474. lower = toNumber(lower);
  14475. lower = lower === lower ? lower : 0;
  14476. }
  14477. return baseClamp(toNumber(number), lower, upper);
  14478. }
  14479. /**
  14480. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14481. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14482. * If `start` is greater than `end` the params are swapped to support
  14483. * negative ranges.
  14484. *
  14485. * @static
  14486. * @memberOf _
  14487. * @since 3.3.0
  14488. * @category Number
  14489. * @param {number} number The number to check.
  14490. * @param {number} [start=0] The start of the range.
  14491. * @param {number} end The end of the range.
  14492. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14493. * @see _.range, _.rangeRight
  14494. * @example
  14495. *
  14496. * _.inRange(3, 2, 4);
  14497. * // => true
  14498. *
  14499. * _.inRange(4, 8);
  14500. * // => true
  14501. *
  14502. * _.inRange(4, 2);
  14503. * // => false
  14504. *
  14505. * _.inRange(2, 2);
  14506. * // => false
  14507. *
  14508. * _.inRange(1.2, 2);
  14509. * // => true
  14510. *
  14511. * _.inRange(5.2, 4);
  14512. * // => false
  14513. *
  14514. * _.inRange(-3, -2, -6);
  14515. * // => true
  14516. */
  14517. function inRange(number, start, end) {
  14518. start = toFinite(start);
  14519. if (end === undefined) {
  14520. end = start;
  14521. start = 0;
  14522. } else {
  14523. end = toFinite(end);
  14524. }
  14525. number = toNumber(number);
  14526. return baseInRange(number, start, end);
  14527. }
  14528. /**
  14529. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14530. * If only one argument is provided a number between `0` and the given number
  14531. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14532. * floats, a floating-point number is returned instead of an integer.
  14533. *
  14534. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14535. * floating-point values which can produce unexpected results.
  14536. *
  14537. * @static
  14538. * @memberOf _
  14539. * @since 0.7.0
  14540. * @category Number
  14541. * @param {number} [lower=0] The lower bound.
  14542. * @param {number} [upper=1] The upper bound.
  14543. * @param {boolean} [floating] Specify returning a floating-point number.
  14544. * @returns {number} Returns the random number.
  14545. * @example
  14546. *
  14547. * _.random(0, 5);
  14548. * // => an integer between 0 and 5
  14549. *
  14550. * _.random(5);
  14551. * // => also an integer between 0 and 5
  14552. *
  14553. * _.random(5, true);
  14554. * // => a floating-point number between 0 and 5
  14555. *
  14556. * _.random(1.2, 5.2);
  14557. * // => a floating-point number between 1.2 and 5.2
  14558. */
  14559. function random(lower, upper, floating) {
  14560. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14561. upper = floating = undefined;
  14562. }
  14563. if (floating === undefined) {
  14564. if (typeof upper == 'boolean') {
  14565. floating = upper;
  14566. upper = undefined;
  14567. }
  14568. else if (typeof lower == 'boolean') {
  14569. floating = lower;
  14570. lower = undefined;
  14571. }
  14572. }
  14573. if (lower === undefined && upper === undefined) {
  14574. lower = 0;
  14575. upper = 1;
  14576. }
  14577. else {
  14578. lower = toFinite(lower);
  14579. if (upper === undefined) {
  14580. upper = lower;
  14581. lower = 0;
  14582. } else {
  14583. upper = toFinite(upper);
  14584. }
  14585. }
  14586. if (lower > upper) {
  14587. var temp = lower;
  14588. lower = upper;
  14589. upper = temp;
  14590. }
  14591. if (floating || lower % 1 || upper % 1) {
  14592. var rand = nativeRandom();
  14593. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14594. }
  14595. return baseRandom(lower, upper);
  14596. }
  14597. /*------------------------------------------------------------------------*/
  14598. /**
  14599. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14600. *
  14601. * @static
  14602. * @memberOf _
  14603. * @since 3.0.0
  14604. * @category String
  14605. * @param {string} [string=''] The string to convert.
  14606. * @returns {string} Returns the camel cased string.
  14607. * @example
  14608. *
  14609. * _.camelCase('Foo Bar');
  14610. * // => 'fooBar'
  14611. *
  14612. * _.camelCase('--foo-bar--');
  14613. * // => 'fooBar'
  14614. *
  14615. * _.camelCase('__FOO_BAR__');
  14616. * // => 'fooBar'
  14617. */
  14618. var camelCase = createCompounder(function(result, word, index) {
  14619. word = word.toLowerCase();
  14620. return result + (index ? capitalize(word) : word);
  14621. });
  14622. /**
  14623. * Converts the first character of `string` to upper case and the remaining
  14624. * to lower case.
  14625. *
  14626. * @static
  14627. * @memberOf _
  14628. * @since 3.0.0
  14629. * @category String
  14630. * @param {string} [string=''] The string to capitalize.
  14631. * @returns {string} Returns the capitalized string.
  14632. * @example
  14633. *
  14634. * _.capitalize('FRED');
  14635. * // => 'Fred'
  14636. */
  14637. function capitalize(string) {
  14638. return upperFirst(toString(string).toLowerCase());
  14639. }
  14640. /**
  14641. * Deburrs `string` by converting
  14642. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14643. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14644. * letters to basic Latin letters and removing
  14645. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14646. *
  14647. * @static
  14648. * @memberOf _
  14649. * @since 3.0.0
  14650. * @category String
  14651. * @param {string} [string=''] The string to deburr.
  14652. * @returns {string} Returns the deburred string.
  14653. * @example
  14654. *
  14655. * _.deburr('déjà vu');
  14656. * // => 'deja vu'
  14657. */
  14658. function deburr(string) {
  14659. string = toString(string);
  14660. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14661. }
  14662. /**
  14663. * Checks if `string` ends with the given target string.
  14664. *
  14665. * @static
  14666. * @memberOf _
  14667. * @since 3.0.0
  14668. * @category String
  14669. * @param {string} [string=''] The string to inspect.
  14670. * @param {string} [target] The string to search for.
  14671. * @param {number} [position=string.length] The position to search up to.
  14672. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14673. * else `false`.
  14674. * @example
  14675. *
  14676. * _.endsWith('abc', 'c');
  14677. * // => true
  14678. *
  14679. * _.endsWith('abc', 'b');
  14680. * // => false
  14681. *
  14682. * _.endsWith('abc', 'b', 2);
  14683. * // => true
  14684. */
  14685. function endsWith(string, target, position) {
  14686. string = toString(string);
  14687. target = baseToString(target);
  14688. var length = string.length;
  14689. position = position === undefined
  14690. ? length
  14691. : baseClamp(toInteger(position), 0, length);
  14692. var end = position;
  14693. position -= target.length;
  14694. return position >= 0 && string.slice(position, end) == target;
  14695. }
  14696. /**
  14697. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14698. * corresponding HTML entities.
  14699. *
  14700. * **Note:** No other characters are escaped. To escape additional
  14701. * characters use a third-party library like [_he_](https://mths.be/he).
  14702. *
  14703. * Though the ">" character is escaped for symmetry, characters like
  14704. * ">" and "/" don't need escaping in HTML and have no special meaning
  14705. * unless they're part of a tag or unquoted attribute value. See
  14706. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14707. * (under "semi-related fun fact") for more details.
  14708. *
  14709. * When working with HTML you should always
  14710. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14711. * XSS vectors.
  14712. *
  14713. * @static
  14714. * @since 0.1.0
  14715. * @memberOf _
  14716. * @category String
  14717. * @param {string} [string=''] The string to escape.
  14718. * @returns {string} Returns the escaped string.
  14719. * @example
  14720. *
  14721. * _.escape('fred, barney, & pebbles');
  14722. * // => 'fred, barney, &amp; pebbles'
  14723. */
  14724. function escape(string) {
  14725. string = toString(string);
  14726. return (string && reHasUnescapedHtml.test(string))
  14727. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14728. : string;
  14729. }
  14730. /**
  14731. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14732. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14733. *
  14734. * @static
  14735. * @memberOf _
  14736. * @since 3.0.0
  14737. * @category String
  14738. * @param {string} [string=''] The string to escape.
  14739. * @returns {string} Returns the escaped string.
  14740. * @example
  14741. *
  14742. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14743. * // => '\[lodash\]\(https://lodash\.com/\)'
  14744. */
  14745. function escapeRegExp(string) {
  14746. string = toString(string);
  14747. return (string && reHasRegExpChar.test(string))
  14748. ? string.replace(reRegExpChar, '\\$&')
  14749. : string;
  14750. }
  14751. /**
  14752. * Converts `string` to
  14753. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14754. *
  14755. * @static
  14756. * @memberOf _
  14757. * @since 3.0.0
  14758. * @category String
  14759. * @param {string} [string=''] The string to convert.
  14760. * @returns {string} Returns the kebab cased string.
  14761. * @example
  14762. *
  14763. * _.kebabCase('Foo Bar');
  14764. * // => 'foo-bar'
  14765. *
  14766. * _.kebabCase('fooBar');
  14767. * // => 'foo-bar'
  14768. *
  14769. * _.kebabCase('__FOO_BAR__');
  14770. * // => 'foo-bar'
  14771. */
  14772. var kebabCase = createCompounder(function(result, word, index) {
  14773. return result + (index ? '-' : '') + word.toLowerCase();
  14774. });
  14775. /**
  14776. * Converts `string`, as space separated words, to lower case.
  14777. *
  14778. * @static
  14779. * @memberOf _
  14780. * @since 4.0.0
  14781. * @category String
  14782. * @param {string} [string=''] The string to convert.
  14783. * @returns {string} Returns the lower cased string.
  14784. * @example
  14785. *
  14786. * _.lowerCase('--Foo-Bar--');
  14787. * // => 'foo bar'
  14788. *
  14789. * _.lowerCase('fooBar');
  14790. * // => 'foo bar'
  14791. *
  14792. * _.lowerCase('__FOO_BAR__');
  14793. * // => 'foo bar'
  14794. */
  14795. var lowerCase = createCompounder(function(result, word, index) {
  14796. return result + (index ? ' ' : '') + word.toLowerCase();
  14797. });
  14798. /**
  14799. * Converts the first character of `string` to lower case.
  14800. *
  14801. * @static
  14802. * @memberOf _
  14803. * @since 4.0.0
  14804. * @category String
  14805. * @param {string} [string=''] The string to convert.
  14806. * @returns {string} Returns the converted string.
  14807. * @example
  14808. *
  14809. * _.lowerFirst('Fred');
  14810. * // => 'fred'
  14811. *
  14812. * _.lowerFirst('FRED');
  14813. * // => 'fRED'
  14814. */
  14815. var lowerFirst = createCaseFirst('toLowerCase');
  14816. /**
  14817. * Pads `string` on the left and right sides if it's shorter than `length`.
  14818. * Padding characters are truncated if they can't be evenly divided by `length`.
  14819. *
  14820. * @static
  14821. * @memberOf _
  14822. * @since 3.0.0
  14823. * @category String
  14824. * @param {string} [string=''] The string to pad.
  14825. * @param {number} [length=0] The padding length.
  14826. * @param {string} [chars=' '] The string used as padding.
  14827. * @returns {string} Returns the padded string.
  14828. * @example
  14829. *
  14830. * _.pad('abc', 8);
  14831. * // => ' abc '
  14832. *
  14833. * _.pad('abc', 8, '_-');
  14834. * // => '_-abc_-_'
  14835. *
  14836. * _.pad('abc', 3);
  14837. * // => 'abc'
  14838. */
  14839. function pad(string, length, chars) {
  14840. string = toString(string);
  14841. length = toInteger(length);
  14842. var strLength = length ? stringSize(string) : 0;
  14843. if (!length || strLength >= length) {
  14844. return string;
  14845. }
  14846. var mid = (length - strLength) / 2;
  14847. return (
  14848. createPadding(nativeFloor(mid), chars) +
  14849. string +
  14850. createPadding(nativeCeil(mid), chars)
  14851. );
  14852. }
  14853. /**
  14854. * Pads `string` on the right side if it's shorter than `length`. Padding
  14855. * characters are truncated if they exceed `length`.
  14856. *
  14857. * @static
  14858. * @memberOf _
  14859. * @since 4.0.0
  14860. * @category String
  14861. * @param {string} [string=''] The string to pad.
  14862. * @param {number} [length=0] The padding length.
  14863. * @param {string} [chars=' '] The string used as padding.
  14864. * @returns {string} Returns the padded string.
  14865. * @example
  14866. *
  14867. * _.padEnd('abc', 6);
  14868. * // => 'abc '
  14869. *
  14870. * _.padEnd('abc', 6, '_-');
  14871. * // => 'abc_-_'
  14872. *
  14873. * _.padEnd('abc', 3);
  14874. * // => 'abc'
  14875. */
  14876. function padEnd(string, length, chars) {
  14877. string = toString(string);
  14878. length = toInteger(length);
  14879. var strLength = length ? stringSize(string) : 0;
  14880. return (length && strLength < length)
  14881. ? (string + createPadding(length - strLength, chars))
  14882. : string;
  14883. }
  14884. /**
  14885. * Pads `string` on the left side if it's shorter than `length`. Padding
  14886. * characters are truncated if they exceed `length`.
  14887. *
  14888. * @static
  14889. * @memberOf _
  14890. * @since 4.0.0
  14891. * @category String
  14892. * @param {string} [string=''] The string to pad.
  14893. * @param {number} [length=0] The padding length.
  14894. * @param {string} [chars=' '] The string used as padding.
  14895. * @returns {string} Returns the padded string.
  14896. * @example
  14897. *
  14898. * _.padStart('abc', 6);
  14899. * // => ' abc'
  14900. *
  14901. * _.padStart('abc', 6, '_-');
  14902. * // => '_-_abc'
  14903. *
  14904. * _.padStart('abc', 3);
  14905. * // => 'abc'
  14906. */
  14907. function padStart(string, length, chars) {
  14908. string = toString(string);
  14909. length = toInteger(length);
  14910. var strLength = length ? stringSize(string) : 0;
  14911. return (length && strLength < length)
  14912. ? (createPadding(length - strLength, chars) + string)
  14913. : string;
  14914. }
  14915. /**
  14916. * Converts `string` to an integer of the specified radix. If `radix` is
  14917. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14918. * hexadecimal, in which case a `radix` of `16` is used.
  14919. *
  14920. * **Note:** This method aligns with the
  14921. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14922. *
  14923. * @static
  14924. * @memberOf _
  14925. * @since 1.1.0
  14926. * @category String
  14927. * @param {string} string The string to convert.
  14928. * @param {number} [radix=10] The radix to interpret `value` by.
  14929. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14930. * @returns {number} Returns the converted integer.
  14931. * @example
  14932. *
  14933. * _.parseInt('08');
  14934. * // => 8
  14935. *
  14936. * _.map(['6', '08', '10'], _.parseInt);
  14937. * // => [6, 8, 10]
  14938. */
  14939. function parseInt(string, radix, guard) {
  14940. if (guard || radix == null) {
  14941. radix = 0;
  14942. } else if (radix) {
  14943. radix = +radix;
  14944. }
  14945. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14946. }
  14947. /**
  14948. * Repeats the given string `n` times.
  14949. *
  14950. * @static
  14951. * @memberOf _
  14952. * @since 3.0.0
  14953. * @category String
  14954. * @param {string} [string=''] The string to repeat.
  14955. * @param {number} [n=1] The number of times to repeat the string.
  14956. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14957. * @returns {string} Returns the repeated string.
  14958. * @example
  14959. *
  14960. * _.repeat('*', 3);
  14961. * // => '***'
  14962. *
  14963. * _.repeat('abc', 2);
  14964. * // => 'abcabc'
  14965. *
  14966. * _.repeat('abc', 0);
  14967. * // => ''
  14968. */
  14969. function repeat(string, n, guard) {
  14970. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14971. n = 1;
  14972. } else {
  14973. n = toInteger(n);
  14974. }
  14975. return baseRepeat(toString(string), n);
  14976. }
  14977. /**
  14978. * Replaces matches for `pattern` in `string` with `replacement`.
  14979. *
  14980. * **Note:** This method is based on
  14981. * [`String#replace`](https://mdn.io/String/replace).
  14982. *
  14983. * @static
  14984. * @memberOf _
  14985. * @since 4.0.0
  14986. * @category String
  14987. * @param {string} [string=''] The string to modify.
  14988. * @param {RegExp|string} pattern The pattern to replace.
  14989. * @param {Function|string} replacement The match replacement.
  14990. * @returns {string} Returns the modified string.
  14991. * @example
  14992. *
  14993. * _.replace('Hi Fred', 'Fred', 'Barney');
  14994. * // => 'Hi Barney'
  14995. */
  14996. function replace() {
  14997. var args = arguments,
  14998. string = toString(args[0]);
  14999. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15000. }
  15001. /**
  15002. * Converts `string` to
  15003. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15004. *
  15005. * @static
  15006. * @memberOf _
  15007. * @since 3.0.0
  15008. * @category String
  15009. * @param {string} [string=''] The string to convert.
  15010. * @returns {string} Returns the snake cased string.
  15011. * @example
  15012. *
  15013. * _.snakeCase('Foo Bar');
  15014. * // => 'foo_bar'
  15015. *
  15016. * _.snakeCase('fooBar');
  15017. * // => 'foo_bar'
  15018. *
  15019. * _.snakeCase('--FOO-BAR--');
  15020. * // => 'foo_bar'
  15021. */
  15022. var snakeCase = createCompounder(function(result, word, index) {
  15023. return result + (index ? '_' : '') + word.toLowerCase();
  15024. });
  15025. /**
  15026. * Splits `string` by `separator`.
  15027. *
  15028. * **Note:** This method is based on
  15029. * [`String#split`](https://mdn.io/String/split).
  15030. *
  15031. * @static
  15032. * @memberOf _
  15033. * @since 4.0.0
  15034. * @category String
  15035. * @param {string} [string=''] The string to split.
  15036. * @param {RegExp|string} separator The separator pattern to split by.
  15037. * @param {number} [limit] The length to truncate results to.
  15038. * @returns {Array} Returns the string segments.
  15039. * @example
  15040. *
  15041. * _.split('a-b-c', '-', 2);
  15042. * // => ['a', 'b']
  15043. */
  15044. function split(string, separator, limit) {
  15045. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15046. separator = limit = undefined;
  15047. }
  15048. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15049. if (!limit) {
  15050. return [];
  15051. }
  15052. string = toString(string);
  15053. if (string && (
  15054. typeof separator == 'string' ||
  15055. (separator != null && !isRegExp(separator))
  15056. )) {
  15057. separator = baseToString(separator);
  15058. if (!separator && hasUnicode(string)) {
  15059. return castSlice(stringToArray(string), 0, limit);
  15060. }
  15061. }
  15062. return string.split(separator, limit);
  15063. }
  15064. /**
  15065. * Converts `string` to
  15066. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15067. *
  15068. * @static
  15069. * @memberOf _
  15070. * @since 3.1.0
  15071. * @category String
  15072. * @param {string} [string=''] The string to convert.
  15073. * @returns {string} Returns the start cased string.
  15074. * @example
  15075. *
  15076. * _.startCase('--foo-bar--');
  15077. * // => 'Foo Bar'
  15078. *
  15079. * _.startCase('fooBar');
  15080. * // => 'Foo Bar'
  15081. *
  15082. * _.startCase('__FOO_BAR__');
  15083. * // => 'FOO BAR'
  15084. */
  15085. var startCase = createCompounder(function(result, word, index) {
  15086. return result + (index ? ' ' : '') + upperFirst(word);
  15087. });
  15088. /**
  15089. * Checks if `string` starts with the given target string.
  15090. *
  15091. * @static
  15092. * @memberOf _
  15093. * @since 3.0.0
  15094. * @category String
  15095. * @param {string} [string=''] The string to inspect.
  15096. * @param {string} [target] The string to search for.
  15097. * @param {number} [position=0] The position to search from.
  15098. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15099. * else `false`.
  15100. * @example
  15101. *
  15102. * _.startsWith('abc', 'a');
  15103. * // => true
  15104. *
  15105. * _.startsWith('abc', 'b');
  15106. * // => false
  15107. *
  15108. * _.startsWith('abc', 'b', 1);
  15109. * // => true
  15110. */
  15111. function startsWith(string, target, position) {
  15112. string = toString(string);
  15113. position = position == null
  15114. ? 0
  15115. : baseClamp(toInteger(position), 0, string.length);
  15116. target = baseToString(target);
  15117. return string.slice(position, position + target.length) == target;
  15118. }
  15119. /**
  15120. * Creates a compiled template function that can interpolate data properties
  15121. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15122. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15123. * properties may be accessed as free variables in the template. If a setting
  15124. * object is given, it takes precedence over `_.templateSettings` values.
  15125. *
  15126. * **Note:** In the development build `_.template` utilizes
  15127. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15128. * for easier debugging.
  15129. *
  15130. * For more information on precompiling templates see
  15131. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15132. *
  15133. * For more information on Chrome extension sandboxes see
  15134. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15135. *
  15136. * @static
  15137. * @since 0.1.0
  15138. * @memberOf _
  15139. * @category String
  15140. * @param {string} [string=''] The template string.
  15141. * @param {Object} [options={}] The options object.
  15142. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15143. * The HTML "escape" delimiter.
  15144. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15145. * The "evaluate" delimiter.
  15146. * @param {Object} [options.imports=_.templateSettings.imports]
  15147. * An object to import into the template as free variables.
  15148. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15149. * The "interpolate" delimiter.
  15150. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15151. * The sourceURL of the compiled template.
  15152. * @param {string} [options.variable='obj']
  15153. * The data object variable name.
  15154. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15155. * @returns {Function} Returns the compiled template function.
  15156. * @example
  15157. *
  15158. * // Use the "interpolate" delimiter to create a compiled template.
  15159. * var compiled = _.template('hello <%= user %>!');
  15160. * compiled({ 'user': 'fred' });
  15161. * // => 'hello fred!'
  15162. *
  15163. * // Use the HTML "escape" delimiter to escape data property values.
  15164. * var compiled = _.template('<b><%- value %></b>');
  15165. * compiled({ 'value': '<script>' });
  15166. * // => '<b>&lt;script&gt;</b>'
  15167. *
  15168. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15169. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15170. * compiled({ 'users': ['fred', 'barney'] });
  15171. * // => '<li>fred</li><li>barney</li>'
  15172. *
  15173. * // Use the internal `print` function in "evaluate" delimiters.
  15174. * var compiled = _.template('<% print("hello " + user); %>!');
  15175. * compiled({ 'user': 'barney' });
  15176. * // => 'hello barney!'
  15177. *
  15178. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15179. * // Disable support by replacing the "interpolate" delimiter.
  15180. * var compiled = _.template('hello ${ user }!');
  15181. * compiled({ 'user': 'pebbles' });
  15182. * // => 'hello pebbles!'
  15183. *
  15184. * // Use backslashes to treat delimiters as plain text.
  15185. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15186. * compiled({ 'value': 'ignored' });
  15187. * // => '<%- value %>'
  15188. *
  15189. * // Use the `imports` option to import `jQuery` as `jq`.
  15190. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15191. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15192. * compiled({ 'users': ['fred', 'barney'] });
  15193. * // => '<li>fred</li><li>barney</li>'
  15194. *
  15195. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15196. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15197. * compiled(data);
  15198. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15199. *
  15200. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15201. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15202. * compiled.source;
  15203. * // => function(data) {
  15204. * // var __t, __p = '';
  15205. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15206. * // return __p;
  15207. * // }
  15208. *
  15209. * // Use custom template delimiters.
  15210. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15211. * var compiled = _.template('hello {{ user }}!');
  15212. * compiled({ 'user': 'mustache' });
  15213. * // => 'hello mustache!'
  15214. *
  15215. * // Use the `source` property to inline compiled templates for meaningful
  15216. * // line numbers in error messages and stack traces.
  15217. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15218. * var JST = {\
  15219. * "main": ' + _.template(mainText).source + '\
  15220. * };\
  15221. * ');
  15222. */
  15223. function template(string, options, guard) {
  15224. // Based on John Resig's `tmpl` implementation
  15225. // (http://ejohn.org/blog/javascript-micro-templating/)
  15226. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15227. var settings = lodash.templateSettings;
  15228. if (guard && isIterateeCall(string, options, guard)) {
  15229. options = undefined;
  15230. }
  15231. string = toString(string);
  15232. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15233. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15234. importsKeys = keys(imports),
  15235. importsValues = baseValues(imports, importsKeys);
  15236. var isEscaping,
  15237. isEvaluating,
  15238. index = 0,
  15239. interpolate = options.interpolate || reNoMatch,
  15240. source = "__p += '";
  15241. // Compile the regexp to match each delimiter.
  15242. var reDelimiters = RegExp(
  15243. (options.escape || reNoMatch).source + '|' +
  15244. interpolate.source + '|' +
  15245. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15246. (options.evaluate || reNoMatch).source + '|$'
  15247. , 'g');
  15248. // Use a sourceURL for easier debugging.
  15249. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15250. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15251. // and escape the comment, thus injecting code that gets evaled.
  15252. var sourceURL = '//# sourceURL=' +
  15253. (hasOwnProperty.call(options, 'sourceURL')
  15254. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15255. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15256. ) + '\n';
  15257. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15258. interpolateValue || (interpolateValue = esTemplateValue);
  15259. // Escape characters that can't be included in string literals.
  15260. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15261. // Replace delimiters with snippets.
  15262. if (escapeValue) {
  15263. isEscaping = true;
  15264. source += "' +\n__e(" + escapeValue + ") +\n'";
  15265. }
  15266. if (evaluateValue) {
  15267. isEvaluating = true;
  15268. source += "';\n" + evaluateValue + ";\n__p += '";
  15269. }
  15270. if (interpolateValue) {
  15271. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15272. }
  15273. index = offset + match.length;
  15274. // The JS engine embedded in Adobe products needs `match` returned in
  15275. // order to produce the correct `offset` value.
  15276. return match;
  15277. });
  15278. source += "';\n";
  15279. // If `variable` is not specified wrap a with-statement around the generated
  15280. // code to add the data object to the top of the scope chain.
  15281. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15282. if (!variable) {
  15283. source = 'with (obj) {\n' + source + '\n}\n';
  15284. }
  15285. // Throw an error if a forbidden character was found in `variable`, to prevent
  15286. // potential command injection attacks.
  15287. else if (reForbiddenIdentifierChars.test(variable)) {
  15288. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15289. }
  15290. // Cleanup code by stripping empty strings.
  15291. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15292. .replace(reEmptyStringMiddle, '$1')
  15293. .replace(reEmptyStringTrailing, '$1;');
  15294. // Frame code as the function body.
  15295. source = 'function(' + (variable || 'obj') + ') {\n' +
  15296. (variable
  15297. ? ''
  15298. : 'obj || (obj = {});\n'
  15299. ) +
  15300. "var __t, __p = ''" +
  15301. (isEscaping
  15302. ? ', __e = _.escape'
  15303. : ''
  15304. ) +
  15305. (isEvaluating
  15306. ? ', __j = Array.prototype.join;\n' +
  15307. "function print() { __p += __j.call(arguments, '') }\n"
  15308. : ';\n'
  15309. ) +
  15310. source +
  15311. 'return __p\n}';
  15312. var result = attempt(function() {
  15313. return Function(importsKeys, sourceURL + 'return ' + source)
  15314. .apply(undefined, importsValues);
  15315. });
  15316. // Provide the compiled function's source by its `toString` method or
  15317. // the `source` property as a convenience for inlining compiled templates.
  15318. result.source = source;
  15319. if (isError(result)) {
  15320. throw result;
  15321. }
  15322. return result;
  15323. }
  15324. /**
  15325. * Converts `string`, as a whole, to lower case just like
  15326. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15327. *
  15328. * @static
  15329. * @memberOf _
  15330. * @since 4.0.0
  15331. * @category String
  15332. * @param {string} [string=''] The string to convert.
  15333. * @returns {string} Returns the lower cased string.
  15334. * @example
  15335. *
  15336. * _.toLower('--Foo-Bar--');
  15337. * // => '--foo-bar--'
  15338. *
  15339. * _.toLower('fooBar');
  15340. * // => 'foobar'
  15341. *
  15342. * _.toLower('__FOO_BAR__');
  15343. * // => '__foo_bar__'
  15344. */
  15345. function toLower(value) {
  15346. return toString(value).toLowerCase();
  15347. }
  15348. /**
  15349. * Converts `string`, as a whole, to upper case just like
  15350. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15351. *
  15352. * @static
  15353. * @memberOf _
  15354. * @since 4.0.0
  15355. * @category String
  15356. * @param {string} [string=''] The string to convert.
  15357. * @returns {string} Returns the upper cased string.
  15358. * @example
  15359. *
  15360. * _.toUpper('--foo-bar--');
  15361. * // => '--FOO-BAR--'
  15362. *
  15363. * _.toUpper('fooBar');
  15364. * // => 'FOOBAR'
  15365. *
  15366. * _.toUpper('__foo_bar__');
  15367. * // => '__FOO_BAR__'
  15368. */
  15369. function toUpper(value) {
  15370. return toString(value).toUpperCase();
  15371. }
  15372. /**
  15373. * Removes leading and trailing whitespace or specified characters from `string`.
  15374. *
  15375. * @static
  15376. * @memberOf _
  15377. * @since 3.0.0
  15378. * @category String
  15379. * @param {string} [string=''] The string to trim.
  15380. * @param {string} [chars=whitespace] The characters to trim.
  15381. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15382. * @returns {string} Returns the trimmed string.
  15383. * @example
  15384. *
  15385. * _.trim(' abc ');
  15386. * // => 'abc'
  15387. *
  15388. * _.trim('-_-abc-_-', '_-');
  15389. * // => 'abc'
  15390. *
  15391. * _.map([' foo ', ' bar '], _.trim);
  15392. * // => ['foo', 'bar']
  15393. */
  15394. function trim(string, chars, guard) {
  15395. string = toString(string);
  15396. if (string && (guard || chars === undefined)) {
  15397. return baseTrim(string);
  15398. }
  15399. if (!string || !(chars = baseToString(chars))) {
  15400. return string;
  15401. }
  15402. var strSymbols = stringToArray(string),
  15403. chrSymbols = stringToArray(chars),
  15404. start = charsStartIndex(strSymbols, chrSymbols),
  15405. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15406. return castSlice(strSymbols, start, end).join('');
  15407. }
  15408. /**
  15409. * Removes trailing whitespace or specified characters from `string`.
  15410. *
  15411. * @static
  15412. * @memberOf _
  15413. * @since 4.0.0
  15414. * @category String
  15415. * @param {string} [string=''] The string to trim.
  15416. * @param {string} [chars=whitespace] The characters to trim.
  15417. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15418. * @returns {string} Returns the trimmed string.
  15419. * @example
  15420. *
  15421. * _.trimEnd(' abc ');
  15422. * // => ' abc'
  15423. *
  15424. * _.trimEnd('-_-abc-_-', '_-');
  15425. * // => '-_-abc'
  15426. */
  15427. function trimEnd(string, chars, guard) {
  15428. string = toString(string);
  15429. if (string && (guard || chars === undefined)) {
  15430. return string.slice(0, trimmedEndIndex(string) + 1);
  15431. }
  15432. if (!string || !(chars = baseToString(chars))) {
  15433. return string;
  15434. }
  15435. var strSymbols = stringToArray(string),
  15436. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15437. return castSlice(strSymbols, 0, end).join('');
  15438. }
  15439. /**
  15440. * Removes leading whitespace or specified characters from `string`.
  15441. *
  15442. * @static
  15443. * @memberOf _
  15444. * @since 4.0.0
  15445. * @category String
  15446. * @param {string} [string=''] The string to trim.
  15447. * @param {string} [chars=whitespace] The characters to trim.
  15448. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15449. * @returns {string} Returns the trimmed string.
  15450. * @example
  15451. *
  15452. * _.trimStart(' abc ');
  15453. * // => 'abc '
  15454. *
  15455. * _.trimStart('-_-abc-_-', '_-');
  15456. * // => 'abc-_-'
  15457. */
  15458. function trimStart(string, chars, guard) {
  15459. string = toString(string);
  15460. if (string && (guard || chars === undefined)) {
  15461. return string.replace(reTrimStart, '');
  15462. }
  15463. if (!string || !(chars = baseToString(chars))) {
  15464. return string;
  15465. }
  15466. var strSymbols = stringToArray(string),
  15467. start = charsStartIndex(strSymbols, stringToArray(chars));
  15468. return castSlice(strSymbols, start).join('');
  15469. }
  15470. /**
  15471. * Truncates `string` if it's longer than the given maximum string length.
  15472. * The last characters of the truncated string are replaced with the omission
  15473. * string which defaults to "...".
  15474. *
  15475. * @static
  15476. * @memberOf _
  15477. * @since 4.0.0
  15478. * @category String
  15479. * @param {string} [string=''] The string to truncate.
  15480. * @param {Object} [options={}] The options object.
  15481. * @param {number} [options.length=30] The maximum string length.
  15482. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15483. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15484. * @returns {string} Returns the truncated string.
  15485. * @example
  15486. *
  15487. * _.truncate('hi-diddly-ho there, neighborino');
  15488. * // => 'hi-diddly-ho there, neighbo...'
  15489. *
  15490. * _.truncate('hi-diddly-ho there, neighborino', {
  15491. * 'length': 24,
  15492. * 'separator': ' '
  15493. * });
  15494. * // => 'hi-diddly-ho there,...'
  15495. *
  15496. * _.truncate('hi-diddly-ho there, neighborino', {
  15497. * 'length': 24,
  15498. * 'separator': /,? +/
  15499. * });
  15500. * // => 'hi-diddly-ho there...'
  15501. *
  15502. * _.truncate('hi-diddly-ho there, neighborino', {
  15503. * 'omission': ' [...]'
  15504. * });
  15505. * // => 'hi-diddly-ho there, neig [...]'
  15506. */
  15507. function truncate(string, options) {
  15508. var length = DEFAULT_TRUNC_LENGTH,
  15509. omission = DEFAULT_TRUNC_OMISSION;
  15510. if (isObject(options)) {
  15511. var separator = 'separator' in options ? options.separator : separator;
  15512. length = 'length' in options ? toInteger(options.length) : length;
  15513. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15514. }
  15515. string = toString(string);
  15516. var strLength = string.length;
  15517. if (hasUnicode(string)) {
  15518. var strSymbols = stringToArray(string);
  15519. strLength = strSymbols.length;
  15520. }
  15521. if (length >= strLength) {
  15522. return string;
  15523. }
  15524. var end = length - stringSize(omission);
  15525. if (end < 1) {
  15526. return omission;
  15527. }
  15528. var result = strSymbols
  15529. ? castSlice(strSymbols, 0, end).join('')
  15530. : string.slice(0, end);
  15531. if (separator === undefined) {
  15532. return result + omission;
  15533. }
  15534. if (strSymbols) {
  15535. end += (result.length - end);
  15536. }
  15537. if (isRegExp(separator)) {
  15538. if (string.slice(end).search(separator)) {
  15539. var match,
  15540. substring = result;
  15541. if (!separator.global) {
  15542. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15543. }
  15544. separator.lastIndex = 0;
  15545. while ((match = separator.exec(substring))) {
  15546. var newEnd = match.index;
  15547. }
  15548. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15549. }
  15550. } else if (string.indexOf(baseToString(separator), end) != end) {
  15551. var index = result.lastIndexOf(separator);
  15552. if (index > -1) {
  15553. result = result.slice(0, index);
  15554. }
  15555. }
  15556. return result + omission;
  15557. }
  15558. /**
  15559. * The inverse of `_.escape`; this method converts the HTML entities
  15560. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15561. * their corresponding characters.
  15562. *
  15563. * **Note:** No other HTML entities are unescaped. To unescape additional
  15564. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15565. *
  15566. * @static
  15567. * @memberOf _
  15568. * @since 0.6.0
  15569. * @category String
  15570. * @param {string} [string=''] The string to unescape.
  15571. * @returns {string} Returns the unescaped string.
  15572. * @example
  15573. *
  15574. * _.unescape('fred, barney, &amp; pebbles');
  15575. * // => 'fred, barney, & pebbles'
  15576. */
  15577. function unescape(string) {
  15578. string = toString(string);
  15579. return (string && reHasEscapedHtml.test(string))
  15580. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15581. : string;
  15582. }
  15583. /**
  15584. * Converts `string`, as space separated words, to upper case.
  15585. *
  15586. * @static
  15587. * @memberOf _
  15588. * @since 4.0.0
  15589. * @category String
  15590. * @param {string} [string=''] The string to convert.
  15591. * @returns {string} Returns the upper cased string.
  15592. * @example
  15593. *
  15594. * _.upperCase('--foo-bar');
  15595. * // => 'FOO BAR'
  15596. *
  15597. * _.upperCase('fooBar');
  15598. * // => 'FOO BAR'
  15599. *
  15600. * _.upperCase('__foo_bar__');
  15601. * // => 'FOO BAR'
  15602. */
  15603. var upperCase = createCompounder(function(result, word, index) {
  15604. return result + (index ? ' ' : '') + word.toUpperCase();
  15605. });
  15606. /**
  15607. * Converts the first character of `string` to upper case.
  15608. *
  15609. * @static
  15610. * @memberOf _
  15611. * @since 4.0.0
  15612. * @category String
  15613. * @param {string} [string=''] The string to convert.
  15614. * @returns {string} Returns the converted string.
  15615. * @example
  15616. *
  15617. * _.upperFirst('fred');
  15618. * // => 'Fred'
  15619. *
  15620. * _.upperFirst('FRED');
  15621. * // => 'FRED'
  15622. */
  15623. var upperFirst = createCaseFirst('toUpperCase');
  15624. /**
  15625. * Splits `string` into an array of its words.
  15626. *
  15627. * @static
  15628. * @memberOf _
  15629. * @since 3.0.0
  15630. * @category String
  15631. * @param {string} [string=''] The string to inspect.
  15632. * @param {RegExp|string} [pattern] The pattern to match words.
  15633. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15634. * @returns {Array} Returns the words of `string`.
  15635. * @example
  15636. *
  15637. * _.words('fred, barney, & pebbles');
  15638. * // => ['fred', 'barney', 'pebbles']
  15639. *
  15640. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15641. * // => ['fred', 'barney', '&', 'pebbles']
  15642. */
  15643. function words(string, pattern, guard) {
  15644. string = toString(string);
  15645. pattern = guard ? undefined : pattern;
  15646. if (pattern === undefined) {
  15647. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15648. }
  15649. return string.match(pattern) || [];
  15650. }
  15651. /*------------------------------------------------------------------------*/
  15652. /**
  15653. * Attempts to invoke `func`, returning either the result or the caught error
  15654. * object. Any additional arguments are provided to `func` when it's invoked.
  15655. *
  15656. * @static
  15657. * @memberOf _
  15658. * @since 3.0.0
  15659. * @category Util
  15660. * @param {Function} func The function to attempt.
  15661. * @param {...*} [args] The arguments to invoke `func` with.
  15662. * @returns {*} Returns the `func` result or error object.
  15663. * @example
  15664. *
  15665. * // Avoid throwing errors for invalid selectors.
  15666. * var elements = _.attempt(function(selector) {
  15667. * return document.querySelectorAll(selector);
  15668. * }, '>_>');
  15669. *
  15670. * if (_.isError(elements)) {
  15671. * elements = [];
  15672. * }
  15673. */
  15674. var attempt = baseRest(function(func, args) {
  15675. try {
  15676. return apply(func, undefined, args);
  15677. } catch (e) {
  15678. return isError(e) ? e : new Error(e);
  15679. }
  15680. });
  15681. /**
  15682. * Binds methods of an object to the object itself, overwriting the existing
  15683. * method.
  15684. *
  15685. * **Note:** This method doesn't set the "length" property of bound functions.
  15686. *
  15687. * @static
  15688. * @since 0.1.0
  15689. * @memberOf _
  15690. * @category Util
  15691. * @param {Object} object The object to bind and assign the bound methods to.
  15692. * @param {...(string|string[])} methodNames The object method names to bind.
  15693. * @returns {Object} Returns `object`.
  15694. * @example
  15695. *
  15696. * var view = {
  15697. * 'label': 'docs',
  15698. * 'click': function() {
  15699. * console.log('clicked ' + this.label);
  15700. * }
  15701. * };
  15702. *
  15703. * _.bindAll(view, ['click']);
  15704. * jQuery(element).on('click', view.click);
  15705. * // => Logs 'clicked docs' when clicked.
  15706. */
  15707. var bindAll = flatRest(function(object, methodNames) {
  15708. arrayEach(methodNames, function(key) {
  15709. key = toKey(key);
  15710. baseAssignValue(object, key, bind(object[key], object));
  15711. });
  15712. return object;
  15713. });
  15714. /**
  15715. * Creates a function that iterates over `pairs` and invokes the corresponding
  15716. * function of the first predicate to return truthy. The predicate-function
  15717. * pairs are invoked with the `this` binding and arguments of the created
  15718. * function.
  15719. *
  15720. * @static
  15721. * @memberOf _
  15722. * @since 4.0.0
  15723. * @category Util
  15724. * @param {Array} pairs The predicate-function pairs.
  15725. * @returns {Function} Returns the new composite function.
  15726. * @example
  15727. *
  15728. * var func = _.cond([
  15729. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15730. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15731. * [_.stubTrue, _.constant('no match')]
  15732. * ]);
  15733. *
  15734. * func({ 'a': 1, 'b': 2 });
  15735. * // => 'matches A'
  15736. *
  15737. * func({ 'a': 0, 'b': 1 });
  15738. * // => 'matches B'
  15739. *
  15740. * func({ 'a': '1', 'b': '2' });
  15741. * // => 'no match'
  15742. */
  15743. function cond(pairs) {
  15744. var length = pairs == null ? 0 : pairs.length,
  15745. toIteratee = getIteratee();
  15746. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15747. if (typeof pair[1] != 'function') {
  15748. throw new TypeError(FUNC_ERROR_TEXT);
  15749. }
  15750. return [toIteratee(pair[0]), pair[1]];
  15751. });
  15752. return baseRest(function(args) {
  15753. var index = -1;
  15754. while (++index < length) {
  15755. var pair = pairs[index];
  15756. if (apply(pair[0], this, args)) {
  15757. return apply(pair[1], this, args);
  15758. }
  15759. }
  15760. });
  15761. }
  15762. /**
  15763. * Creates a function that invokes the predicate properties of `source` with
  15764. * the corresponding property values of a given object, returning `true` if
  15765. * all predicates return truthy, else `false`.
  15766. *
  15767. * **Note:** The created function is equivalent to `_.conformsTo` with
  15768. * `source` partially applied.
  15769. *
  15770. * @static
  15771. * @memberOf _
  15772. * @since 4.0.0
  15773. * @category Util
  15774. * @param {Object} source The object of property predicates to conform to.
  15775. * @returns {Function} Returns the new spec function.
  15776. * @example
  15777. *
  15778. * var objects = [
  15779. * { 'a': 2, 'b': 1 },
  15780. * { 'a': 1, 'b': 2 }
  15781. * ];
  15782. *
  15783. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15784. * // => [{ 'a': 1, 'b': 2 }]
  15785. */
  15786. function conforms(source) {
  15787. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15788. }
  15789. /**
  15790. * Creates a function that returns `value`.
  15791. *
  15792. * @static
  15793. * @memberOf _
  15794. * @since 2.4.0
  15795. * @category Util
  15796. * @param {*} value The value to return from the new function.
  15797. * @returns {Function} Returns the new constant function.
  15798. * @example
  15799. *
  15800. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15801. *
  15802. * console.log(objects);
  15803. * // => [{ 'a': 1 }, { 'a': 1 }]
  15804. *
  15805. * console.log(objects[0] === objects[1]);
  15806. * // => true
  15807. */
  15808. function constant(value) {
  15809. return function() {
  15810. return value;
  15811. };
  15812. }
  15813. /**
  15814. * Checks `value` to determine whether a default value should be returned in
  15815. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15816. * or `undefined`.
  15817. *
  15818. * @static
  15819. * @memberOf _
  15820. * @since 4.14.0
  15821. * @category Util
  15822. * @param {*} value The value to check.
  15823. * @param {*} defaultValue The default value.
  15824. * @returns {*} Returns the resolved value.
  15825. * @example
  15826. *
  15827. * _.defaultTo(1, 10);
  15828. * // => 1
  15829. *
  15830. * _.defaultTo(undefined, 10);
  15831. * // => 10
  15832. */
  15833. function defaultTo(value, defaultValue) {
  15834. return (value == null || value !== value) ? defaultValue : value;
  15835. }
  15836. /**
  15837. * Creates a function that returns the result of invoking the given functions
  15838. * with the `this` binding of the created function, where each successive
  15839. * invocation is supplied the return value of the previous.
  15840. *
  15841. * @static
  15842. * @memberOf _
  15843. * @since 3.0.0
  15844. * @category Util
  15845. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15846. * @returns {Function} Returns the new composite function.
  15847. * @see _.flowRight
  15848. * @example
  15849. *
  15850. * function square(n) {
  15851. * return n * n;
  15852. * }
  15853. *
  15854. * var addSquare = _.flow([_.add, square]);
  15855. * addSquare(1, 2);
  15856. * // => 9
  15857. */
  15858. var flow = createFlow();
  15859. /**
  15860. * This method is like `_.flow` except that it creates a function that
  15861. * invokes the given functions from right to left.
  15862. *
  15863. * @static
  15864. * @since 3.0.0
  15865. * @memberOf _
  15866. * @category Util
  15867. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15868. * @returns {Function} Returns the new composite function.
  15869. * @see _.flow
  15870. * @example
  15871. *
  15872. * function square(n) {
  15873. * return n * n;
  15874. * }
  15875. *
  15876. * var addSquare = _.flowRight([square, _.add]);
  15877. * addSquare(1, 2);
  15878. * // => 9
  15879. */
  15880. var flowRight = createFlow(true);
  15881. /**
  15882. * This method returns the first argument it receives.
  15883. *
  15884. * @static
  15885. * @since 0.1.0
  15886. * @memberOf _
  15887. * @category Util
  15888. * @param {*} value Any value.
  15889. * @returns {*} Returns `value`.
  15890. * @example
  15891. *
  15892. * var object = { 'a': 1 };
  15893. *
  15894. * console.log(_.identity(object) === object);
  15895. * // => true
  15896. */
  15897. function identity(value) {
  15898. return value;
  15899. }
  15900. /**
  15901. * Creates a function that invokes `func` with the arguments of the created
  15902. * function. If `func` is a property name, the created function returns the
  15903. * property value for a given element. If `func` is an array or object, the
  15904. * created function returns `true` for elements that contain the equivalent
  15905. * source properties, otherwise it returns `false`.
  15906. *
  15907. * @static
  15908. * @since 4.0.0
  15909. * @memberOf _
  15910. * @category Util
  15911. * @param {*} [func=_.identity] The value to convert to a callback.
  15912. * @returns {Function} Returns the callback.
  15913. * @example
  15914. *
  15915. * var users = [
  15916. * { 'user': 'barney', 'age': 36, 'active': true },
  15917. * { 'user': 'fred', 'age': 40, 'active': false }
  15918. * ];
  15919. *
  15920. * // The `_.matches` iteratee shorthand.
  15921. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15922. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15923. *
  15924. * // The `_.matchesProperty` iteratee shorthand.
  15925. * _.filter(users, _.iteratee(['user', 'fred']));
  15926. * // => [{ 'user': 'fred', 'age': 40 }]
  15927. *
  15928. * // The `_.property` iteratee shorthand.
  15929. * _.map(users, _.iteratee('user'));
  15930. * // => ['barney', 'fred']
  15931. *
  15932. * // Create custom iteratee shorthands.
  15933. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15934. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15935. * return func.test(string);
  15936. * };
  15937. * });
  15938. *
  15939. * _.filter(['abc', 'def'], /ef/);
  15940. * // => ['def']
  15941. */
  15942. function iteratee(func) {
  15943. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15944. }
  15945. /**
  15946. * Creates a function that performs a partial deep comparison between a given
  15947. * object and `source`, returning `true` if the given object has equivalent
  15948. * property values, else `false`.
  15949. *
  15950. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15951. * partially applied.
  15952. *
  15953. * Partial comparisons will match empty array and empty object `source`
  15954. * values against any array or object value, respectively. See `_.isEqual`
  15955. * for a list of supported value comparisons.
  15956. *
  15957. * **Note:** Multiple values can be checked by combining several matchers
  15958. * using `_.overSome`
  15959. *
  15960. * @static
  15961. * @memberOf _
  15962. * @since 3.0.0
  15963. * @category Util
  15964. * @param {Object} source The object of property values to match.
  15965. * @returns {Function} Returns the new spec function.
  15966. * @example
  15967. *
  15968. * var objects = [
  15969. * { 'a': 1, 'b': 2, 'c': 3 },
  15970. * { 'a': 4, 'b': 5, 'c': 6 }
  15971. * ];
  15972. *
  15973. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15974. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15975. *
  15976. * // Checking for several possible values
  15977. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15978. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15979. */
  15980. function matches(source) {
  15981. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15982. }
  15983. /**
  15984. * Creates a function that performs a partial deep comparison between the
  15985. * value at `path` of a given object to `srcValue`, returning `true` if the
  15986. * object value is equivalent, else `false`.
  15987. *
  15988. * **Note:** Partial comparisons will match empty array and empty object
  15989. * `srcValue` values against any array or object value, respectively. See
  15990. * `_.isEqual` for a list of supported value comparisons.
  15991. *
  15992. * **Note:** Multiple values can be checked by combining several matchers
  15993. * using `_.overSome`
  15994. *
  15995. * @static
  15996. * @memberOf _
  15997. * @since 3.2.0
  15998. * @category Util
  15999. * @param {Array|string} path The path of the property to get.
  16000. * @param {*} srcValue The value to match.
  16001. * @returns {Function} Returns the new spec function.
  16002. * @example
  16003. *
  16004. * var objects = [
  16005. * { 'a': 1, 'b': 2, 'c': 3 },
  16006. * { 'a': 4, 'b': 5, 'c': 6 }
  16007. * ];
  16008. *
  16009. * _.find(objects, _.matchesProperty('a', 4));
  16010. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16011. *
  16012. * // Checking for several possible values
  16013. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16014. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16015. */
  16016. function matchesProperty(path, srcValue) {
  16017. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16018. }
  16019. /**
  16020. * Creates a function that invokes the method at `path` of a given object.
  16021. * Any additional arguments are provided to the invoked method.
  16022. *
  16023. * @static
  16024. * @memberOf _
  16025. * @since 3.7.0
  16026. * @category Util
  16027. * @param {Array|string} path The path of the method to invoke.
  16028. * @param {...*} [args] The arguments to invoke the method with.
  16029. * @returns {Function} Returns the new invoker function.
  16030. * @example
  16031. *
  16032. * var objects = [
  16033. * { 'a': { 'b': _.constant(2) } },
  16034. * { 'a': { 'b': _.constant(1) } }
  16035. * ];
  16036. *
  16037. * _.map(objects, _.method('a.b'));
  16038. * // => [2, 1]
  16039. *
  16040. * _.map(objects, _.method(['a', 'b']));
  16041. * // => [2, 1]
  16042. */
  16043. var method = baseRest(function(path, args) {
  16044. return function(object) {
  16045. return baseInvoke(object, path, args);
  16046. };
  16047. });
  16048. /**
  16049. * The opposite of `_.method`; this method creates a function that invokes
  16050. * the method at a given path of `object`. Any additional arguments are
  16051. * provided to the invoked method.
  16052. *
  16053. * @static
  16054. * @memberOf _
  16055. * @since 3.7.0
  16056. * @category Util
  16057. * @param {Object} object The object to query.
  16058. * @param {...*} [args] The arguments to invoke the method with.
  16059. * @returns {Function} Returns the new invoker function.
  16060. * @example
  16061. *
  16062. * var array = _.times(3, _.constant),
  16063. * object = { 'a': array, 'b': array, 'c': array };
  16064. *
  16065. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16066. * // => [2, 0]
  16067. *
  16068. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16069. * // => [2, 0]
  16070. */
  16071. var methodOf = baseRest(function(object, args) {
  16072. return function(path) {
  16073. return baseInvoke(object, path, args);
  16074. };
  16075. });
  16076. /**
  16077. * Adds all own enumerable string keyed function properties of a source
  16078. * object to the destination object. If `object` is a function, then methods
  16079. * are added to its prototype as well.
  16080. *
  16081. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16082. * avoid conflicts caused by modifying the original.
  16083. *
  16084. * @static
  16085. * @since 0.1.0
  16086. * @memberOf _
  16087. * @category Util
  16088. * @param {Function|Object} [object=lodash] The destination object.
  16089. * @param {Object} source The object of functions to add.
  16090. * @param {Object} [options={}] The options object.
  16091. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16092. * @returns {Function|Object} Returns `object`.
  16093. * @example
  16094. *
  16095. * function vowels(string) {
  16096. * return _.filter(string, function(v) {
  16097. * return /[aeiou]/i.test(v);
  16098. * });
  16099. * }
  16100. *
  16101. * _.mixin({ 'vowels': vowels });
  16102. * _.vowels('fred');
  16103. * // => ['e']
  16104. *
  16105. * _('fred').vowels().value();
  16106. * // => ['e']
  16107. *
  16108. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16109. * _('fred').vowels();
  16110. * // => ['e']
  16111. */
  16112. function mixin(object, source, options) {
  16113. var props = keys(source),
  16114. methodNames = baseFunctions(source, props);
  16115. if (options == null &&
  16116. !(isObject(source) && (methodNames.length || !props.length))) {
  16117. options = source;
  16118. source = object;
  16119. object = this;
  16120. methodNames = baseFunctions(source, keys(source));
  16121. }
  16122. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16123. isFunc = isFunction(object);
  16124. arrayEach(methodNames, function(methodName) {
  16125. var func = source[methodName];
  16126. object[methodName] = func;
  16127. if (isFunc) {
  16128. object.prototype[methodName] = function() {
  16129. var chainAll = this.__chain__;
  16130. if (chain || chainAll) {
  16131. var result = object(this.__wrapped__),
  16132. actions = result.__actions__ = copyArray(this.__actions__);
  16133. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16134. result.__chain__ = chainAll;
  16135. return result;
  16136. }
  16137. return func.apply(object, arrayPush([this.value()], arguments));
  16138. };
  16139. }
  16140. });
  16141. return object;
  16142. }
  16143. /**
  16144. * Reverts the `_` variable to its previous value and returns a reference to
  16145. * the `lodash` function.
  16146. *
  16147. * @static
  16148. * @since 0.1.0
  16149. * @memberOf _
  16150. * @category Util
  16151. * @returns {Function} Returns the `lodash` function.
  16152. * @example
  16153. *
  16154. * var lodash = _.noConflict();
  16155. */
  16156. function noConflict() {
  16157. if (root._ === this) {
  16158. root._ = oldDash;
  16159. }
  16160. return this;
  16161. }
  16162. /**
  16163. * This method returns `undefined`.
  16164. *
  16165. * @static
  16166. * @memberOf _
  16167. * @since 2.3.0
  16168. * @category Util
  16169. * @example
  16170. *
  16171. * _.times(2, _.noop);
  16172. * // => [undefined, undefined]
  16173. */
  16174. function noop() {
  16175. // No operation performed.
  16176. }
  16177. /**
  16178. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16179. * the nth argument from the end is returned.
  16180. *
  16181. * @static
  16182. * @memberOf _
  16183. * @since 4.0.0
  16184. * @category Util
  16185. * @param {number} [n=0] The index of the argument to return.
  16186. * @returns {Function} Returns the new pass-thru function.
  16187. * @example
  16188. *
  16189. * var func = _.nthArg(1);
  16190. * func('a', 'b', 'c', 'd');
  16191. * // => 'b'
  16192. *
  16193. * var func = _.nthArg(-2);
  16194. * func('a', 'b', 'c', 'd');
  16195. * // => 'c'
  16196. */
  16197. function nthArg(n) {
  16198. n = toInteger(n);
  16199. return baseRest(function(args) {
  16200. return baseNth(args, n);
  16201. });
  16202. }
  16203. /**
  16204. * Creates a function that invokes `iteratees` with the arguments it receives
  16205. * and returns their results.
  16206. *
  16207. * @static
  16208. * @memberOf _
  16209. * @since 4.0.0
  16210. * @category Util
  16211. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16212. * The iteratees to invoke.
  16213. * @returns {Function} Returns the new function.
  16214. * @example
  16215. *
  16216. * var func = _.over([Math.max, Math.min]);
  16217. *
  16218. * func(1, 2, 3, 4);
  16219. * // => [4, 1]
  16220. */
  16221. var over = createOver(arrayMap);
  16222. /**
  16223. * Creates a function that checks if **all** of the `predicates` return
  16224. * truthy when invoked with the arguments it receives.
  16225. *
  16226. * Following shorthands are possible for providing predicates.
  16227. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16228. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16229. *
  16230. * @static
  16231. * @memberOf _
  16232. * @since 4.0.0
  16233. * @category Util
  16234. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16235. * The predicates to check.
  16236. * @returns {Function} Returns the new function.
  16237. * @example
  16238. *
  16239. * var func = _.overEvery([Boolean, isFinite]);
  16240. *
  16241. * func('1');
  16242. * // => true
  16243. *
  16244. * func(null);
  16245. * // => false
  16246. *
  16247. * func(NaN);
  16248. * // => false
  16249. */
  16250. var overEvery = createOver(arrayEvery);
  16251. /**
  16252. * Creates a function that checks if **any** of the `predicates` return
  16253. * truthy when invoked with the arguments it receives.
  16254. *
  16255. * Following shorthands are possible for providing predicates.
  16256. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16257. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16258. *
  16259. * @static
  16260. * @memberOf _
  16261. * @since 4.0.0
  16262. * @category Util
  16263. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16264. * The predicates to check.
  16265. * @returns {Function} Returns the new function.
  16266. * @example
  16267. *
  16268. * var func = _.overSome([Boolean, isFinite]);
  16269. *
  16270. * func('1');
  16271. * // => true
  16272. *
  16273. * func(null);
  16274. * // => true
  16275. *
  16276. * func(NaN);
  16277. * // => false
  16278. *
  16279. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16280. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16281. */
  16282. var overSome = createOver(arraySome);
  16283. /**
  16284. * Creates a function that returns the value at `path` of a given object.
  16285. *
  16286. * @static
  16287. * @memberOf _
  16288. * @since 2.4.0
  16289. * @category Util
  16290. * @param {Array|string} path The path of the property to get.
  16291. * @returns {Function} Returns the new accessor function.
  16292. * @example
  16293. *
  16294. * var objects = [
  16295. * { 'a': { 'b': 2 } },
  16296. * { 'a': { 'b': 1 } }
  16297. * ];
  16298. *
  16299. * _.map(objects, _.property('a.b'));
  16300. * // => [2, 1]
  16301. *
  16302. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16303. * // => [1, 2]
  16304. */
  16305. function property(path) {
  16306. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16307. }
  16308. /**
  16309. * The opposite of `_.property`; this method creates a function that returns
  16310. * the value at a given path of `object`.
  16311. *
  16312. * @static
  16313. * @memberOf _
  16314. * @since 3.0.0
  16315. * @category Util
  16316. * @param {Object} object The object to query.
  16317. * @returns {Function} Returns the new accessor function.
  16318. * @example
  16319. *
  16320. * var array = [0, 1, 2],
  16321. * object = { 'a': array, 'b': array, 'c': array };
  16322. *
  16323. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16324. * // => [2, 0]
  16325. *
  16326. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16327. * // => [2, 0]
  16328. */
  16329. function propertyOf(object) {
  16330. return function(path) {
  16331. return object == null ? undefined : baseGet(object, path);
  16332. };
  16333. }
  16334. /**
  16335. * Creates an array of numbers (positive and/or negative) progressing from
  16336. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16337. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16338. * it's set to `start` with `start` then set to `0`.
  16339. *
  16340. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16341. * floating-point values which can produce unexpected results.
  16342. *
  16343. * @static
  16344. * @since 0.1.0
  16345. * @memberOf _
  16346. * @category Util
  16347. * @param {number} [start=0] The start of the range.
  16348. * @param {number} end The end of the range.
  16349. * @param {number} [step=1] The value to increment or decrement by.
  16350. * @returns {Array} Returns the range of numbers.
  16351. * @see _.inRange, _.rangeRight
  16352. * @example
  16353. *
  16354. * _.range(4);
  16355. * // => [0, 1, 2, 3]
  16356. *
  16357. * _.range(-4);
  16358. * // => [0, -1, -2, -3]
  16359. *
  16360. * _.range(1, 5);
  16361. * // => [1, 2, 3, 4]
  16362. *
  16363. * _.range(0, 20, 5);
  16364. * // => [0, 5, 10, 15]
  16365. *
  16366. * _.range(0, -4, -1);
  16367. * // => [0, -1, -2, -3]
  16368. *
  16369. * _.range(1, 4, 0);
  16370. * // => [1, 1, 1]
  16371. *
  16372. * _.range(0);
  16373. * // => []
  16374. */
  16375. var range = createRange();
  16376. /**
  16377. * This method is like `_.range` except that it populates values in
  16378. * descending order.
  16379. *
  16380. * @static
  16381. * @memberOf _
  16382. * @since 4.0.0
  16383. * @category Util
  16384. * @param {number} [start=0] The start of the range.
  16385. * @param {number} end The end of the range.
  16386. * @param {number} [step=1] The value to increment or decrement by.
  16387. * @returns {Array} Returns the range of numbers.
  16388. * @see _.inRange, _.range
  16389. * @example
  16390. *
  16391. * _.rangeRight(4);
  16392. * // => [3, 2, 1, 0]
  16393. *
  16394. * _.rangeRight(-4);
  16395. * // => [-3, -2, -1, 0]
  16396. *
  16397. * _.rangeRight(1, 5);
  16398. * // => [4, 3, 2, 1]
  16399. *
  16400. * _.rangeRight(0, 20, 5);
  16401. * // => [15, 10, 5, 0]
  16402. *
  16403. * _.rangeRight(0, -4, -1);
  16404. * // => [-3, -2, -1, 0]
  16405. *
  16406. * _.rangeRight(1, 4, 0);
  16407. * // => [1, 1, 1]
  16408. *
  16409. * _.rangeRight(0);
  16410. * // => []
  16411. */
  16412. var rangeRight = createRange(true);
  16413. /**
  16414. * This method returns a new empty array.
  16415. *
  16416. * @static
  16417. * @memberOf _
  16418. * @since 4.13.0
  16419. * @category Util
  16420. * @returns {Array} Returns the new empty array.
  16421. * @example
  16422. *
  16423. * var arrays = _.times(2, _.stubArray);
  16424. *
  16425. * console.log(arrays);
  16426. * // => [[], []]
  16427. *
  16428. * console.log(arrays[0] === arrays[1]);
  16429. * // => false
  16430. */
  16431. function stubArray() {
  16432. return [];
  16433. }
  16434. /**
  16435. * This method returns `false`.
  16436. *
  16437. * @static
  16438. * @memberOf _
  16439. * @since 4.13.0
  16440. * @category Util
  16441. * @returns {boolean} Returns `false`.
  16442. * @example
  16443. *
  16444. * _.times(2, _.stubFalse);
  16445. * // => [false, false]
  16446. */
  16447. function stubFalse() {
  16448. return false;
  16449. }
  16450. /**
  16451. * This method returns a new empty object.
  16452. *
  16453. * @static
  16454. * @memberOf _
  16455. * @since 4.13.0
  16456. * @category Util
  16457. * @returns {Object} Returns the new empty object.
  16458. * @example
  16459. *
  16460. * var objects = _.times(2, _.stubObject);
  16461. *
  16462. * console.log(objects);
  16463. * // => [{}, {}]
  16464. *
  16465. * console.log(objects[0] === objects[1]);
  16466. * // => false
  16467. */
  16468. function stubObject() {
  16469. return {};
  16470. }
  16471. /**
  16472. * This method returns an empty string.
  16473. *
  16474. * @static
  16475. * @memberOf _
  16476. * @since 4.13.0
  16477. * @category Util
  16478. * @returns {string} Returns the empty string.
  16479. * @example
  16480. *
  16481. * _.times(2, _.stubString);
  16482. * // => ['', '']
  16483. */
  16484. function stubString() {
  16485. return '';
  16486. }
  16487. /**
  16488. * This method returns `true`.
  16489. *
  16490. * @static
  16491. * @memberOf _
  16492. * @since 4.13.0
  16493. * @category Util
  16494. * @returns {boolean} Returns `true`.
  16495. * @example
  16496. *
  16497. * _.times(2, _.stubTrue);
  16498. * // => [true, true]
  16499. */
  16500. function stubTrue() {
  16501. return true;
  16502. }
  16503. /**
  16504. * Invokes the iteratee `n` times, returning an array of the results of
  16505. * each invocation. The iteratee is invoked with one argument; (index).
  16506. *
  16507. * @static
  16508. * @since 0.1.0
  16509. * @memberOf _
  16510. * @category Util
  16511. * @param {number} n The number of times to invoke `iteratee`.
  16512. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16513. * @returns {Array} Returns the array of results.
  16514. * @example
  16515. *
  16516. * _.times(3, String);
  16517. * // => ['0', '1', '2']
  16518. *
  16519. * _.times(4, _.constant(0));
  16520. * // => [0, 0, 0, 0]
  16521. */
  16522. function times(n, iteratee) {
  16523. n = toInteger(n);
  16524. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16525. return [];
  16526. }
  16527. var index = MAX_ARRAY_LENGTH,
  16528. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16529. iteratee = getIteratee(iteratee);
  16530. n -= MAX_ARRAY_LENGTH;
  16531. var result = baseTimes(length, iteratee);
  16532. while (++index < n) {
  16533. iteratee(index);
  16534. }
  16535. return result;
  16536. }
  16537. /**
  16538. * Converts `value` to a property path array.
  16539. *
  16540. * @static
  16541. * @memberOf _
  16542. * @since 4.0.0
  16543. * @category Util
  16544. * @param {*} value The value to convert.
  16545. * @returns {Array} Returns the new property path array.
  16546. * @example
  16547. *
  16548. * _.toPath('a.b.c');
  16549. * // => ['a', 'b', 'c']
  16550. *
  16551. * _.toPath('a[0].b.c');
  16552. * // => ['a', '0', 'b', 'c']
  16553. */
  16554. function toPath(value) {
  16555. if (isArray(value)) {
  16556. return arrayMap(value, toKey);
  16557. }
  16558. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16559. }
  16560. /**
  16561. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16562. *
  16563. * @static
  16564. * @since 0.1.0
  16565. * @memberOf _
  16566. * @category Util
  16567. * @param {string} [prefix=''] The value to prefix the ID with.
  16568. * @returns {string} Returns the unique ID.
  16569. * @example
  16570. *
  16571. * _.uniqueId('contact_');
  16572. * // => 'contact_104'
  16573. *
  16574. * _.uniqueId();
  16575. * // => '105'
  16576. */
  16577. function uniqueId(prefix) {
  16578. var id = ++idCounter;
  16579. return toString(prefix) + id;
  16580. }
  16581. /*------------------------------------------------------------------------*/
  16582. /**
  16583. * Adds two numbers.
  16584. *
  16585. * @static
  16586. * @memberOf _
  16587. * @since 3.4.0
  16588. * @category Math
  16589. * @param {number} augend The first number in an addition.
  16590. * @param {number} addend The second number in an addition.
  16591. * @returns {number} Returns the total.
  16592. * @example
  16593. *
  16594. * _.add(6, 4);
  16595. * // => 10
  16596. */
  16597. var add = createMathOperation(function(augend, addend) {
  16598. return augend + addend;
  16599. }, 0);
  16600. /**
  16601. * Computes `number` rounded up to `precision`.
  16602. *
  16603. * @static
  16604. * @memberOf _
  16605. * @since 3.10.0
  16606. * @category Math
  16607. * @param {number} number The number to round up.
  16608. * @param {number} [precision=0] The precision to round up to.
  16609. * @returns {number} Returns the rounded up number.
  16610. * @example
  16611. *
  16612. * _.ceil(4.006);
  16613. * // => 5
  16614. *
  16615. * _.ceil(6.004, 2);
  16616. * // => 6.01
  16617. *
  16618. * _.ceil(6040, -2);
  16619. * // => 6100
  16620. */
  16621. var ceil = createRound('ceil');
  16622. /**
  16623. * Divide two numbers.
  16624. *
  16625. * @static
  16626. * @memberOf _
  16627. * @since 4.7.0
  16628. * @category Math
  16629. * @param {number} dividend The first number in a division.
  16630. * @param {number} divisor The second number in a division.
  16631. * @returns {number} Returns the quotient.
  16632. * @example
  16633. *
  16634. * _.divide(6, 4);
  16635. * // => 1.5
  16636. */
  16637. var divide = createMathOperation(function(dividend, divisor) {
  16638. return dividend / divisor;
  16639. }, 1);
  16640. /**
  16641. * Computes `number` rounded down to `precision`.
  16642. *
  16643. * @static
  16644. * @memberOf _
  16645. * @since 3.10.0
  16646. * @category Math
  16647. * @param {number} number The number to round down.
  16648. * @param {number} [precision=0] The precision to round down to.
  16649. * @returns {number} Returns the rounded down number.
  16650. * @example
  16651. *
  16652. * _.floor(4.006);
  16653. * // => 4
  16654. *
  16655. * _.floor(0.046, 2);
  16656. * // => 0.04
  16657. *
  16658. * _.floor(4060, -2);
  16659. * // => 4000
  16660. */
  16661. var floor = createRound('floor');
  16662. /**
  16663. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16664. * `undefined` is returned.
  16665. *
  16666. * @static
  16667. * @since 0.1.0
  16668. * @memberOf _
  16669. * @category Math
  16670. * @param {Array} array The array to iterate over.
  16671. * @returns {*} Returns the maximum value.
  16672. * @example
  16673. *
  16674. * _.max([4, 2, 8, 6]);
  16675. * // => 8
  16676. *
  16677. * _.max([]);
  16678. * // => undefined
  16679. */
  16680. function max(array) {
  16681. return (array && array.length)
  16682. ? baseExtremum(array, identity, baseGt)
  16683. : undefined;
  16684. }
  16685. /**
  16686. * This method is like `_.max` except that it accepts `iteratee` which is
  16687. * invoked for each element in `array` to generate the criterion by which
  16688. * the value is ranked. The iteratee is invoked with one argument: (value).
  16689. *
  16690. * @static
  16691. * @memberOf _
  16692. * @since 4.0.0
  16693. * @category Math
  16694. * @param {Array} array The array to iterate over.
  16695. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16696. * @returns {*} Returns the maximum value.
  16697. * @example
  16698. *
  16699. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16700. *
  16701. * _.maxBy(objects, function(o) { return o.n; });
  16702. * // => { 'n': 2 }
  16703. *
  16704. * // The `_.property` iteratee shorthand.
  16705. * _.maxBy(objects, 'n');
  16706. * // => { 'n': 2 }
  16707. */
  16708. function maxBy(array, iteratee) {
  16709. return (array && array.length)
  16710. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16711. : undefined;
  16712. }
  16713. /**
  16714. * Computes the mean of the values in `array`.
  16715. *
  16716. * @static
  16717. * @memberOf _
  16718. * @since 4.0.0
  16719. * @category Math
  16720. * @param {Array} array The array to iterate over.
  16721. * @returns {number} Returns the mean.
  16722. * @example
  16723. *
  16724. * _.mean([4, 2, 8, 6]);
  16725. * // => 5
  16726. */
  16727. function mean(array) {
  16728. return baseMean(array, identity);
  16729. }
  16730. /**
  16731. * This method is like `_.mean` except that it accepts `iteratee` which is
  16732. * invoked for each element in `array` to generate the value to be averaged.
  16733. * The iteratee is invoked with one argument: (value).
  16734. *
  16735. * @static
  16736. * @memberOf _
  16737. * @since 4.7.0
  16738. * @category Math
  16739. * @param {Array} array The array to iterate over.
  16740. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16741. * @returns {number} Returns the mean.
  16742. * @example
  16743. *
  16744. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16745. *
  16746. * _.meanBy(objects, function(o) { return o.n; });
  16747. * // => 5
  16748. *
  16749. * // The `_.property` iteratee shorthand.
  16750. * _.meanBy(objects, 'n');
  16751. * // => 5
  16752. */
  16753. function meanBy(array, iteratee) {
  16754. return baseMean(array, getIteratee(iteratee, 2));
  16755. }
  16756. /**
  16757. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16758. * `undefined` is returned.
  16759. *
  16760. * @static
  16761. * @since 0.1.0
  16762. * @memberOf _
  16763. * @category Math
  16764. * @param {Array} array The array to iterate over.
  16765. * @returns {*} Returns the minimum value.
  16766. * @example
  16767. *
  16768. * _.min([4, 2, 8, 6]);
  16769. * // => 2
  16770. *
  16771. * _.min([]);
  16772. * // => undefined
  16773. */
  16774. function min(array) {
  16775. return (array && array.length)
  16776. ? baseExtremum(array, identity, baseLt)
  16777. : undefined;
  16778. }
  16779. /**
  16780. * This method is like `_.min` except that it accepts `iteratee` which is
  16781. * invoked for each element in `array` to generate the criterion by which
  16782. * the value is ranked. The iteratee is invoked with one argument: (value).
  16783. *
  16784. * @static
  16785. * @memberOf _
  16786. * @since 4.0.0
  16787. * @category Math
  16788. * @param {Array} array The array to iterate over.
  16789. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16790. * @returns {*} Returns the minimum value.
  16791. * @example
  16792. *
  16793. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16794. *
  16795. * _.minBy(objects, function(o) { return o.n; });
  16796. * // => { 'n': 1 }
  16797. *
  16798. * // The `_.property` iteratee shorthand.
  16799. * _.minBy(objects, 'n');
  16800. * // => { 'n': 1 }
  16801. */
  16802. function minBy(array, iteratee) {
  16803. return (array && array.length)
  16804. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16805. : undefined;
  16806. }
  16807. /**
  16808. * Multiply two numbers.
  16809. *
  16810. * @static
  16811. * @memberOf _
  16812. * @since 4.7.0
  16813. * @category Math
  16814. * @param {number} multiplier The first number in a multiplication.
  16815. * @param {number} multiplicand The second number in a multiplication.
  16816. * @returns {number} Returns the product.
  16817. * @example
  16818. *
  16819. * _.multiply(6, 4);
  16820. * // => 24
  16821. */
  16822. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16823. return multiplier * multiplicand;
  16824. }, 1);
  16825. /**
  16826. * Computes `number` rounded to `precision`.
  16827. *
  16828. * @static
  16829. * @memberOf _
  16830. * @since 3.10.0
  16831. * @category Math
  16832. * @param {number} number The number to round.
  16833. * @param {number} [precision=0] The precision to round to.
  16834. * @returns {number} Returns the rounded number.
  16835. * @example
  16836. *
  16837. * _.round(4.006);
  16838. * // => 4
  16839. *
  16840. * _.round(4.006, 2);
  16841. * // => 4.01
  16842. *
  16843. * _.round(4060, -2);
  16844. * // => 4100
  16845. */
  16846. var round = createRound('round');
  16847. /**
  16848. * Subtract two numbers.
  16849. *
  16850. * @static
  16851. * @memberOf _
  16852. * @since 4.0.0
  16853. * @category Math
  16854. * @param {number} minuend The first number in a subtraction.
  16855. * @param {number} subtrahend The second number in a subtraction.
  16856. * @returns {number} Returns the difference.
  16857. * @example
  16858. *
  16859. * _.subtract(6, 4);
  16860. * // => 2
  16861. */
  16862. var subtract = createMathOperation(function(minuend, subtrahend) {
  16863. return minuend - subtrahend;
  16864. }, 0);
  16865. /**
  16866. * Computes the sum of the values in `array`.
  16867. *
  16868. * @static
  16869. * @memberOf _
  16870. * @since 3.4.0
  16871. * @category Math
  16872. * @param {Array} array The array to iterate over.
  16873. * @returns {number} Returns the sum.
  16874. * @example
  16875. *
  16876. * _.sum([4, 2, 8, 6]);
  16877. * // => 20
  16878. */
  16879. function sum(array) {
  16880. return (array && array.length)
  16881. ? baseSum(array, identity)
  16882. : 0;
  16883. }
  16884. /**
  16885. * This method is like `_.sum` except that it accepts `iteratee` which is
  16886. * invoked for each element in `array` to generate the value to be summed.
  16887. * The iteratee is invoked with one argument: (value).
  16888. *
  16889. * @static
  16890. * @memberOf _
  16891. * @since 4.0.0
  16892. * @category Math
  16893. * @param {Array} array The array to iterate over.
  16894. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16895. * @returns {number} Returns the sum.
  16896. * @example
  16897. *
  16898. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16899. *
  16900. * _.sumBy(objects, function(o) { return o.n; });
  16901. * // => 20
  16902. *
  16903. * // The `_.property` iteratee shorthand.
  16904. * _.sumBy(objects, 'n');
  16905. * // => 20
  16906. */
  16907. function sumBy(array, iteratee) {
  16908. return (array && array.length)
  16909. ? baseSum(array, getIteratee(iteratee, 2))
  16910. : 0;
  16911. }
  16912. /*------------------------------------------------------------------------*/
  16913. // Add methods that return wrapped values in chain sequences.
  16914. lodash.after = after;
  16915. lodash.ary = ary;
  16916. lodash.assign = assign;
  16917. lodash.assignIn = assignIn;
  16918. lodash.assignInWith = assignInWith;
  16919. lodash.assignWith = assignWith;
  16920. lodash.at = at;
  16921. lodash.before = before;
  16922. lodash.bind = bind;
  16923. lodash.bindAll = bindAll;
  16924. lodash.bindKey = bindKey;
  16925. lodash.castArray = castArray;
  16926. lodash.chain = chain;
  16927. lodash.chunk = chunk;
  16928. lodash.compact = compact;
  16929. lodash.concat = concat;
  16930. lodash.cond = cond;
  16931. lodash.conforms = conforms;
  16932. lodash.constant = constant;
  16933. lodash.countBy = countBy;
  16934. lodash.create = create;
  16935. lodash.curry = curry;
  16936. lodash.curryRight = curryRight;
  16937. lodash.debounce = debounce;
  16938. lodash.defaults = defaults;
  16939. lodash.defaultsDeep = defaultsDeep;
  16940. lodash.defer = defer;
  16941. lodash.delay = delay;
  16942. lodash.difference = difference;
  16943. lodash.differenceBy = differenceBy;
  16944. lodash.differenceWith = differenceWith;
  16945. lodash.drop = drop;
  16946. lodash.dropRight = dropRight;
  16947. lodash.dropRightWhile = dropRightWhile;
  16948. lodash.dropWhile = dropWhile;
  16949. lodash.fill = fill;
  16950. lodash.filter = filter;
  16951. lodash.flatMap = flatMap;
  16952. lodash.flatMapDeep = flatMapDeep;
  16953. lodash.flatMapDepth = flatMapDepth;
  16954. lodash.flatten = flatten;
  16955. lodash.flattenDeep = flattenDeep;
  16956. lodash.flattenDepth = flattenDepth;
  16957. lodash.flip = flip;
  16958. lodash.flow = flow;
  16959. lodash.flowRight = flowRight;
  16960. lodash.fromPairs = fromPairs;
  16961. lodash.functions = functions;
  16962. lodash.functionsIn = functionsIn;
  16963. lodash.groupBy = groupBy;
  16964. lodash.initial = initial;
  16965. lodash.intersection = intersection;
  16966. lodash.intersectionBy = intersectionBy;
  16967. lodash.intersectionWith = intersectionWith;
  16968. lodash.invert = invert;
  16969. lodash.invertBy = invertBy;
  16970. lodash.invokeMap = invokeMap;
  16971. lodash.iteratee = iteratee;
  16972. lodash.keyBy = keyBy;
  16973. lodash.keys = keys;
  16974. lodash.keysIn = keysIn;
  16975. lodash.map = map;
  16976. lodash.mapKeys = mapKeys;
  16977. lodash.mapValues = mapValues;
  16978. lodash.matches = matches;
  16979. lodash.matchesProperty = matchesProperty;
  16980. lodash.memoize = memoize;
  16981. lodash.merge = merge;
  16982. lodash.mergeWith = mergeWith;
  16983. lodash.method = method;
  16984. lodash.methodOf = methodOf;
  16985. lodash.mixin = mixin;
  16986. lodash.negate = negate;
  16987. lodash.nthArg = nthArg;
  16988. lodash.omit = omit;
  16989. lodash.omitBy = omitBy;
  16990. lodash.once = once;
  16991. lodash.orderBy = orderBy;
  16992. lodash.over = over;
  16993. lodash.overArgs = overArgs;
  16994. lodash.overEvery = overEvery;
  16995. lodash.overSome = overSome;
  16996. lodash.partial = partial;
  16997. lodash.partialRight = partialRight;
  16998. lodash.partition = partition;
  16999. lodash.pick = pick;
  17000. lodash.pickBy = pickBy;
  17001. lodash.property = property;
  17002. lodash.propertyOf = propertyOf;
  17003. lodash.pull = pull;
  17004. lodash.pullAll = pullAll;
  17005. lodash.pullAllBy = pullAllBy;
  17006. lodash.pullAllWith = pullAllWith;
  17007. lodash.pullAt = pullAt;
  17008. lodash.range = range;
  17009. lodash.rangeRight = rangeRight;
  17010. lodash.rearg = rearg;
  17011. lodash.reject = reject;
  17012. lodash.remove = remove;
  17013. lodash.rest = rest;
  17014. lodash.reverse = reverse;
  17015. lodash.sampleSize = sampleSize;
  17016. lodash.set = set;
  17017. lodash.setWith = setWith;
  17018. lodash.shuffle = shuffle;
  17019. lodash.slice = slice;
  17020. lodash.sortBy = sortBy;
  17021. lodash.sortedUniq = sortedUniq;
  17022. lodash.sortedUniqBy = sortedUniqBy;
  17023. lodash.split = split;
  17024. lodash.spread = spread;
  17025. lodash.tail = tail;
  17026. lodash.take = take;
  17027. lodash.takeRight = takeRight;
  17028. lodash.takeRightWhile = takeRightWhile;
  17029. lodash.takeWhile = takeWhile;
  17030. lodash.tap = tap;
  17031. lodash.throttle = throttle;
  17032. lodash.thru = thru;
  17033. lodash.toArray = toArray;
  17034. lodash.toPairs = toPairs;
  17035. lodash.toPairsIn = toPairsIn;
  17036. lodash.toPath = toPath;
  17037. lodash.toPlainObject = toPlainObject;
  17038. lodash.transform = transform;
  17039. lodash.unary = unary;
  17040. lodash.union = union;
  17041. lodash.unionBy = unionBy;
  17042. lodash.unionWith = unionWith;
  17043. lodash.uniq = uniq;
  17044. lodash.uniqBy = uniqBy;
  17045. lodash.uniqWith = uniqWith;
  17046. lodash.unset = unset;
  17047. lodash.unzip = unzip;
  17048. lodash.unzipWith = unzipWith;
  17049. lodash.update = update;
  17050. lodash.updateWith = updateWith;
  17051. lodash.values = values;
  17052. lodash.valuesIn = valuesIn;
  17053. lodash.without = without;
  17054. lodash.words = words;
  17055. lodash.wrap = wrap;
  17056. lodash.xor = xor;
  17057. lodash.xorBy = xorBy;
  17058. lodash.xorWith = xorWith;
  17059. lodash.zip = zip;
  17060. lodash.zipObject = zipObject;
  17061. lodash.zipObjectDeep = zipObjectDeep;
  17062. lodash.zipWith = zipWith;
  17063. // Add aliases.
  17064. lodash.entries = toPairs;
  17065. lodash.entriesIn = toPairsIn;
  17066. lodash.extend = assignIn;
  17067. lodash.extendWith = assignInWith;
  17068. // Add methods to `lodash.prototype`.
  17069. mixin(lodash, lodash);
  17070. /*------------------------------------------------------------------------*/
  17071. // Add methods that return unwrapped values in chain sequences.
  17072. lodash.add = add;
  17073. lodash.attempt = attempt;
  17074. lodash.camelCase = camelCase;
  17075. lodash.capitalize = capitalize;
  17076. lodash.ceil = ceil;
  17077. lodash.clamp = clamp;
  17078. lodash.clone = clone;
  17079. lodash.cloneDeep = cloneDeep;
  17080. lodash.cloneDeepWith = cloneDeepWith;
  17081. lodash.cloneWith = cloneWith;
  17082. lodash.conformsTo = conformsTo;
  17083. lodash.deburr = deburr;
  17084. lodash.defaultTo = defaultTo;
  17085. lodash.divide = divide;
  17086. lodash.endsWith = endsWith;
  17087. lodash.eq = eq;
  17088. lodash.escape = escape;
  17089. lodash.escapeRegExp = escapeRegExp;
  17090. lodash.every = every;
  17091. lodash.find = find;
  17092. lodash.findIndex = findIndex;
  17093. lodash.findKey = findKey;
  17094. lodash.findLast = findLast;
  17095. lodash.findLastIndex = findLastIndex;
  17096. lodash.findLastKey = findLastKey;
  17097. lodash.floor = floor;
  17098. lodash.forEach = forEach;
  17099. lodash.forEachRight = forEachRight;
  17100. lodash.forIn = forIn;
  17101. lodash.forInRight = forInRight;
  17102. lodash.forOwn = forOwn;
  17103. lodash.forOwnRight = forOwnRight;
  17104. lodash.get = get;
  17105. lodash.gt = gt;
  17106. lodash.gte = gte;
  17107. lodash.has = has;
  17108. lodash.hasIn = hasIn;
  17109. lodash.head = head;
  17110. lodash.identity = identity;
  17111. lodash.includes = includes;
  17112. lodash.indexOf = indexOf;
  17113. lodash.inRange = inRange;
  17114. lodash.invoke = invoke;
  17115. lodash.isArguments = isArguments;
  17116. lodash.isArray = isArray;
  17117. lodash.isArrayBuffer = isArrayBuffer;
  17118. lodash.isArrayLike = isArrayLike;
  17119. lodash.isArrayLikeObject = isArrayLikeObject;
  17120. lodash.isBoolean = isBoolean;
  17121. lodash.isBuffer = isBuffer;
  17122. lodash.isDate = isDate;
  17123. lodash.isElement = isElement;
  17124. lodash.isEmpty = isEmpty;
  17125. lodash.isEqual = isEqual;
  17126. lodash.isEqualWith = isEqualWith;
  17127. lodash.isError = isError;
  17128. lodash.isFinite = isFinite;
  17129. lodash.isFunction = isFunction;
  17130. lodash.isInteger = isInteger;
  17131. lodash.isLength = isLength;
  17132. lodash.isMap = isMap;
  17133. lodash.isMatch = isMatch;
  17134. lodash.isMatchWith = isMatchWith;
  17135. lodash.isNaN = isNaN;
  17136. lodash.isNative = isNative;
  17137. lodash.isNil = isNil;
  17138. lodash.isNull = isNull;
  17139. lodash.isNumber = isNumber;
  17140. lodash.isObject = isObject;
  17141. lodash.isObjectLike = isObjectLike;
  17142. lodash.isPlainObject = isPlainObject;
  17143. lodash.isRegExp = isRegExp;
  17144. lodash.isSafeInteger = isSafeInteger;
  17145. lodash.isSet = isSet;
  17146. lodash.isString = isString;
  17147. lodash.isSymbol = isSymbol;
  17148. lodash.isTypedArray = isTypedArray;
  17149. lodash.isUndefined = isUndefined;
  17150. lodash.isWeakMap = isWeakMap;
  17151. lodash.isWeakSet = isWeakSet;
  17152. lodash.join = join;
  17153. lodash.kebabCase = kebabCase;
  17154. lodash.last = last;
  17155. lodash.lastIndexOf = lastIndexOf;
  17156. lodash.lowerCase = lowerCase;
  17157. lodash.lowerFirst = lowerFirst;
  17158. lodash.lt = lt;
  17159. lodash.lte = lte;
  17160. lodash.max = max;
  17161. lodash.maxBy = maxBy;
  17162. lodash.mean = mean;
  17163. lodash.meanBy = meanBy;
  17164. lodash.min = min;
  17165. lodash.minBy = minBy;
  17166. lodash.stubArray = stubArray;
  17167. lodash.stubFalse = stubFalse;
  17168. lodash.stubObject = stubObject;
  17169. lodash.stubString = stubString;
  17170. lodash.stubTrue = stubTrue;
  17171. lodash.multiply = multiply;
  17172. lodash.nth = nth;
  17173. lodash.noConflict = noConflict;
  17174. lodash.noop = noop;
  17175. lodash.now = now;
  17176. lodash.pad = pad;
  17177. lodash.padEnd = padEnd;
  17178. lodash.padStart = padStart;
  17179. lodash.parseInt = parseInt;
  17180. lodash.random = random;
  17181. lodash.reduce = reduce;
  17182. lodash.reduceRight = reduceRight;
  17183. lodash.repeat = repeat;
  17184. lodash.replace = replace;
  17185. lodash.result = result;
  17186. lodash.round = round;
  17187. lodash.runInContext = runInContext;
  17188. lodash.sample = sample;
  17189. lodash.size = size;
  17190. lodash.snakeCase = snakeCase;
  17191. lodash.some = some;
  17192. lodash.sortedIndex = sortedIndex;
  17193. lodash.sortedIndexBy = sortedIndexBy;
  17194. lodash.sortedIndexOf = sortedIndexOf;
  17195. lodash.sortedLastIndex = sortedLastIndex;
  17196. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17197. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17198. lodash.startCase = startCase;
  17199. lodash.startsWith = startsWith;
  17200. lodash.subtract = subtract;
  17201. lodash.sum = sum;
  17202. lodash.sumBy = sumBy;
  17203. lodash.template = template;
  17204. lodash.times = times;
  17205. lodash.toFinite = toFinite;
  17206. lodash.toInteger = toInteger;
  17207. lodash.toLength = toLength;
  17208. lodash.toLower = toLower;
  17209. lodash.toNumber = toNumber;
  17210. lodash.toSafeInteger = toSafeInteger;
  17211. lodash.toString = toString;
  17212. lodash.toUpper = toUpper;
  17213. lodash.trim = trim;
  17214. lodash.trimEnd = trimEnd;
  17215. lodash.trimStart = trimStart;
  17216. lodash.truncate = truncate;
  17217. lodash.unescape = unescape;
  17218. lodash.uniqueId = uniqueId;
  17219. lodash.upperCase = upperCase;
  17220. lodash.upperFirst = upperFirst;
  17221. // Add aliases.
  17222. lodash.each = forEach;
  17223. lodash.eachRight = forEachRight;
  17224. lodash.first = head;
  17225. mixin(lodash, (function() {
  17226. var source = {};
  17227. baseForOwn(lodash, function(func, methodName) {
  17228. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17229. source[methodName] = func;
  17230. }
  17231. });
  17232. return source;
  17233. }()), { 'chain': false });
  17234. /*------------------------------------------------------------------------*/
  17235. /**
  17236. * The semantic version number.
  17237. *
  17238. * @static
  17239. * @memberOf _
  17240. * @type {string}
  17241. */
  17242. lodash.VERSION = VERSION;
  17243. // Assign default placeholders.
  17244. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17245. lodash[methodName].placeholder = lodash;
  17246. });
  17247. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17248. arrayEach(['drop', 'take'], function(methodName, index) {
  17249. LazyWrapper.prototype[methodName] = function(n) {
  17250. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17251. var result = (this.__filtered__ && !index)
  17252. ? new LazyWrapper(this)
  17253. : this.clone();
  17254. if (result.__filtered__) {
  17255. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17256. } else {
  17257. result.__views__.push({
  17258. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17259. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17260. });
  17261. }
  17262. return result;
  17263. };
  17264. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17265. return this.reverse()[methodName](n).reverse();
  17266. };
  17267. });
  17268. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17269. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17270. var type = index + 1,
  17271. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17272. LazyWrapper.prototype[methodName] = function(iteratee) {
  17273. var result = this.clone();
  17274. result.__iteratees__.push({
  17275. 'iteratee': getIteratee(iteratee, 3),
  17276. 'type': type
  17277. });
  17278. result.__filtered__ = result.__filtered__ || isFilter;
  17279. return result;
  17280. };
  17281. });
  17282. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17283. arrayEach(['head', 'last'], function(methodName, index) {
  17284. var takeName = 'take' + (index ? 'Right' : '');
  17285. LazyWrapper.prototype[methodName] = function() {
  17286. return this[takeName](1).value()[0];
  17287. };
  17288. });
  17289. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17290. arrayEach(['initial', 'tail'], function(methodName, index) {
  17291. var dropName = 'drop' + (index ? '' : 'Right');
  17292. LazyWrapper.prototype[methodName] = function() {
  17293. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17294. };
  17295. });
  17296. LazyWrapper.prototype.compact = function() {
  17297. return this.filter(identity);
  17298. };
  17299. LazyWrapper.prototype.find = function(predicate) {
  17300. return this.filter(predicate).head();
  17301. };
  17302. LazyWrapper.prototype.findLast = function(predicate) {
  17303. return this.reverse().find(predicate);
  17304. };
  17305. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17306. if (typeof path == 'function') {
  17307. return new LazyWrapper(this);
  17308. }
  17309. return this.map(function(value) {
  17310. return baseInvoke(value, path, args);
  17311. });
  17312. });
  17313. LazyWrapper.prototype.reject = function(predicate) {
  17314. return this.filter(negate(getIteratee(predicate)));
  17315. };
  17316. LazyWrapper.prototype.slice = function(start, end) {
  17317. start = toInteger(start);
  17318. var result = this;
  17319. if (result.__filtered__ && (start > 0 || end < 0)) {
  17320. return new LazyWrapper(result);
  17321. }
  17322. if (start < 0) {
  17323. result = result.takeRight(-start);
  17324. } else if (start) {
  17325. result = result.drop(start);
  17326. }
  17327. if (end !== undefined) {
  17328. end = toInteger(end);
  17329. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17330. }
  17331. return result;
  17332. };
  17333. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17334. return this.reverse().takeWhile(predicate).reverse();
  17335. };
  17336. LazyWrapper.prototype.toArray = function() {
  17337. return this.take(MAX_ARRAY_LENGTH);
  17338. };
  17339. // Add `LazyWrapper` methods to `lodash.prototype`.
  17340. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17341. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17342. isTaker = /^(?:head|last)$/.test(methodName),
  17343. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17344. retUnwrapped = isTaker || /^find/.test(methodName);
  17345. if (!lodashFunc) {
  17346. return;
  17347. }
  17348. lodash.prototype[methodName] = function() {
  17349. var value = this.__wrapped__,
  17350. args = isTaker ? [1] : arguments,
  17351. isLazy = value instanceof LazyWrapper,
  17352. iteratee = args[0],
  17353. useLazy = isLazy || isArray(value);
  17354. var interceptor = function(value) {
  17355. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17356. return (isTaker && chainAll) ? result[0] : result;
  17357. };
  17358. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17359. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17360. isLazy = useLazy = false;
  17361. }
  17362. var chainAll = this.__chain__,
  17363. isHybrid = !!this.__actions__.length,
  17364. isUnwrapped = retUnwrapped && !chainAll,
  17365. onlyLazy = isLazy && !isHybrid;
  17366. if (!retUnwrapped && useLazy) {
  17367. value = onlyLazy ? value : new LazyWrapper(this);
  17368. var result = func.apply(value, args);
  17369. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17370. return new LodashWrapper(result, chainAll);
  17371. }
  17372. if (isUnwrapped && onlyLazy) {
  17373. return func.apply(this, args);
  17374. }
  17375. result = this.thru(interceptor);
  17376. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17377. };
  17378. });
  17379. // Add `Array` methods to `lodash.prototype`.
  17380. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17381. var func = arrayProto[methodName],
  17382. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17383. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17384. lodash.prototype[methodName] = function() {
  17385. var args = arguments;
  17386. if (retUnwrapped && !this.__chain__) {
  17387. var value = this.value();
  17388. return func.apply(isArray(value) ? value : [], args);
  17389. }
  17390. return this[chainName](function(value) {
  17391. return func.apply(isArray(value) ? value : [], args);
  17392. });
  17393. };
  17394. });
  17395. // Map minified method names to their real names.
  17396. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17397. var lodashFunc = lodash[methodName];
  17398. if (lodashFunc) {
  17399. var key = lodashFunc.name + '';
  17400. if (!hasOwnProperty.call(realNames, key)) {
  17401. realNames[key] = [];
  17402. }
  17403. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17404. }
  17405. });
  17406. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17407. 'name': 'wrapper',
  17408. 'func': undefined
  17409. }];
  17410. // Add methods to `LazyWrapper`.
  17411. LazyWrapper.prototype.clone = lazyClone;
  17412. LazyWrapper.prototype.reverse = lazyReverse;
  17413. LazyWrapper.prototype.value = lazyValue;
  17414. // Add chain sequence methods to the `lodash` wrapper.
  17415. lodash.prototype.at = wrapperAt;
  17416. lodash.prototype.chain = wrapperChain;
  17417. lodash.prototype.commit = wrapperCommit;
  17418. lodash.prototype.next = wrapperNext;
  17419. lodash.prototype.plant = wrapperPlant;
  17420. lodash.prototype.reverse = wrapperReverse;
  17421. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17422. // Add lazy aliases.
  17423. lodash.prototype.first = lodash.prototype.head;
  17424. if (symIterator) {
  17425. lodash.prototype[symIterator] = wrapperToIterator;
  17426. }
  17427. return lodash;
  17428. });
  17429. /*--------------------------------------------------------------------------*/
  17430. // Export lodash.
  17431. var _ = runInContext();
  17432. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17433. if (true) {
  17434. // Expose Lodash on the global object to prevent errors when Lodash is
  17435. // loaded by a script tag in the presence of an AMD loader.
  17436. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17437. // Use `_.noConflict` to remove Lodash from the global object.
  17438. root._ = _;
  17439. // Define as an anonymous module so, through path mapping, it can be
  17440. // referenced as the "underscore" module.
  17441. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17442. return _;
  17443. }).call(exports, __webpack_require__, exports, module),
  17444. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17445. }
  17446. // Check for `exports` after `define` in case a build optimizer adds it.
  17447. else {}
  17448. }.call(this));
  17449. /***/ }),
  17450. /***/ "./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":
  17451. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17452. !*** ./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 ***!
  17453. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17454. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17455. "use strict";
  17456. __webpack_require__.r(__webpack_exports__);
  17457. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17458. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17459. /* harmony export */ });
  17460. /* 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");
  17461. /* 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__);
  17462. /* 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");
  17463. var options = {};
  17464. options.insert = "head";
  17465. options.singleton = false;
  17466. 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);
  17467. /* 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 || {});
  17468. /***/ }),
  17469. /***/ "./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":
  17470. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17471. !*** ./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 ***!
  17472. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17473. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17474. "use strict";
  17475. __webpack_require__.r(__webpack_exports__);
  17476. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17477. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17478. /* harmony export */ });
  17479. /* harmony import */ var _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");
  17480. /* 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__);
  17481. /* 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");
  17482. var options = {};
  17483. options.insert = "head";
  17484. options.singleton = false;
  17485. 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);
  17486. /* 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 || {});
  17487. /***/ }),
  17488. /***/ "./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":
  17489. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17490. !*** ./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 ***!
  17491. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17492. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17493. "use strict";
  17494. __webpack_require__.r(__webpack_exports__);
  17495. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17496. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17497. /* harmony export */ });
  17498. /* harmony import */ var _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");
  17499. /* 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__);
  17500. /* 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");
  17501. var options = {};
  17502. options.insert = "head";
  17503. options.singleton = false;
  17504. 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);
  17505. /* 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 || {});
  17506. /***/ }),
  17507. /***/ "./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":
  17508. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17509. !*** ./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 ***!
  17510. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17511. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17512. "use strict";
  17513. __webpack_require__.r(__webpack_exports__);
  17514. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17515. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17516. /* harmony export */ });
  17517. /* harmony import */ var _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");
  17518. /* 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__);
  17519. /* 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");
  17520. var options = {};
  17521. options.insert = "head";
  17522. options.singleton = false;
  17523. 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);
  17524. /* 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 || {});
  17525. /***/ }),
  17526. /***/ "./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":
  17527. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17528. !*** ./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 ***!
  17529. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17530. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17531. "use strict";
  17532. __webpack_require__.r(__webpack_exports__);
  17533. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17534. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17535. /* harmony export */ });
  17536. /* harmony import */ var _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");
  17537. /* 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__);
  17538. /* 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");
  17539. var options = {};
  17540. options.insert = "head";
  17541. options.singleton = false;
  17542. 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);
  17543. /* 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 || {});
  17544. /***/ }),
  17545. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17546. /*!******************************************************!*\
  17547. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17548. \******************************************************/
  17549. /***/ ((__unused_webpack_module, exports) => {
  17550. "use strict";
  17551. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17552. // runtime helper for setting properties on components
  17553. // in a tree-shakable way
  17554. exports["default"] = (sfc, props) => {
  17555. const target = sfc.__vccOpts || sfc;
  17556. for (const [key, val] of props) {
  17557. target[key] = val;
  17558. }
  17559. return target;
  17560. };
  17561. /***/ }),
  17562. /***/ "./resources/js/components/AppButtonLink.vue":
  17563. /*!***************************************************!*\
  17564. !*** ./resources/js/components/AppButtonLink.vue ***!
  17565. \***************************************************/
  17566. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17567. "use strict";
  17568. __webpack_require__.r(__webpack_exports__);
  17569. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17570. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17571. /* harmony export */ });
  17572. /* 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");
  17573. /* 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");
  17574. /* 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");
  17575. ;
  17576. 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"]])
  17577. /* hot reload */
  17578. if (false) {}
  17579. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17580. /***/ }),
  17581. /***/ "./resources/js/components/AppFooter.vue":
  17582. /*!***********************************************!*\
  17583. !*** ./resources/js/components/AppFooter.vue ***!
  17584. \***********************************************/
  17585. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17586. "use strict";
  17587. __webpack_require__.r(__webpack_exports__);
  17588. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17589. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17590. /* harmony export */ });
  17591. /* 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");
  17592. /* 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");
  17593. /* 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");
  17594. const script = {}
  17595. ;
  17596. 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"]])
  17597. /* hot reload */
  17598. if (false) {}
  17599. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17600. /***/ }),
  17601. /***/ "./resources/js/components/AppMessage.vue":
  17602. /*!************************************************!*\
  17603. !*** ./resources/js/components/AppMessage.vue ***!
  17604. \************************************************/
  17605. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17606. "use strict";
  17607. __webpack_require__.r(__webpack_exports__);
  17608. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17609. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17610. /* harmony export */ });
  17611. /* 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");
  17612. /* 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");
  17613. /* 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");
  17614. ;
  17615. 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"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/components/AppPagination.vue":
  17621. /*!***************************************************!*\
  17622. !*** ./resources/js/components/AppPagination.vue ***!
  17623. \***************************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17629. /* harmony export */ });
  17630. /* 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");
  17631. /* 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");
  17632. /* 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");
  17633. ;
  17634. 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"]])
  17635. /* hot reload */
  17636. if (false) {}
  17637. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17638. /***/ }),
  17639. /***/ "./resources/js/components/AppSidebar.vue":
  17640. /*!************************************************!*\
  17641. !*** ./resources/js/components/AppSidebar.vue ***!
  17642. \************************************************/
  17643. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17644. "use strict";
  17645. __webpack_require__.r(__webpack_exports__);
  17646. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17647. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17648. /* harmony export */ });
  17649. /* 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");
  17650. /* 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");
  17651. /* 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");
  17652. /* 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");
  17653. ;
  17654. 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"]])
  17655. /* hot reload */
  17656. if (false) {}
  17657. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17658. /***/ }),
  17659. /***/ "./resources/js/components/AppSubSidebar.vue":
  17660. /*!***************************************************!*\
  17661. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17662. \***************************************************/
  17663. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17664. "use strict";
  17665. __webpack_require__.r(__webpack_exports__);
  17666. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17667. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17668. /* harmony export */ });
  17669. /* 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");
  17670. /* 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");
  17671. /* 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");
  17672. /* 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");
  17673. ;
  17674. 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"]])
  17675. /* hot reload */
  17676. if (false) {}
  17677. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17678. /***/ }),
  17679. /***/ "./resources/js/components/AppTopBar.vue":
  17680. /*!***********************************************!*\
  17681. !*** ./resources/js/components/AppTopBar.vue ***!
  17682. \***********************************************/
  17683. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17684. "use strict";
  17685. __webpack_require__.r(__webpack_exports__);
  17686. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17687. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17688. /* harmony export */ });
  17689. /* 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");
  17690. /* 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");
  17691. /* 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");
  17692. /* 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");
  17693. ;
  17694. 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"]])
  17695. /* hot reload */
  17696. if (false) {}
  17697. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17698. /***/ }),
  17699. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17700. /*!**************************************************!*\
  17701. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17702. \**************************************************/
  17703. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17704. "use strict";
  17705. __webpack_require__.r(__webpack_exports__);
  17706. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17707. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17708. /* harmony export */ });
  17709. /* 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");
  17710. /* 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");
  17711. /* 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");
  17712. /* 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");
  17713. ;
  17714. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_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"]])
  17715. /* hot reload */
  17716. if (false) {}
  17717. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17718. /***/ }),
  17719. /***/ "./resources/js/pages/topup/Index.vue":
  17720. /*!********************************************!*\
  17721. !*** ./resources/js/pages/topup/Index.vue ***!
  17722. \********************************************/
  17723. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17724. "use strict";
  17725. __webpack_require__.r(__webpack_exports__);
  17726. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17727. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17728. /* harmony export */ });
  17729. /* harmony import */ var _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");
  17730. /* 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");
  17731. /* 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");
  17732. ;
  17733. 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"]])
  17734. /* hot reload */
  17735. if (false) {}
  17736. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17737. /***/ }),
  17738. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17739. /*!**************************************************************************************!*\
  17740. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17741. \**************************************************************************************/
  17742. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17743. "use strict";
  17744. __webpack_require__.r(__webpack_exports__);
  17745. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17746. /* 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"])
  17747. /* harmony export */ });
  17748. /* 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");
  17749. /***/ }),
  17750. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17751. /*!***********************************************************************************!*\
  17752. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17753. \***********************************************************************************/
  17754. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17755. "use strict";
  17756. __webpack_require__.r(__webpack_exports__);
  17757. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17758. /* 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"])
  17759. /* harmony export */ });
  17760. /* 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");
  17761. /***/ }),
  17762. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17763. /*!**************************************************************************************!*\
  17764. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17765. \**************************************************************************************/
  17766. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17767. "use strict";
  17768. __webpack_require__.r(__webpack_exports__);
  17769. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17770. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17771. /* harmony export */ });
  17772. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17773. /***/ }),
  17774. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17775. /*!***********************************************************************************!*\
  17776. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17777. \***********************************************************************************/
  17778. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17779. "use strict";
  17780. __webpack_require__.r(__webpack_exports__);
  17781. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17782. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17783. /* harmony export */ });
  17784. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17785. /***/ }),
  17786. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17787. /*!**************************************************************************************!*\
  17788. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17789. \**************************************************************************************/
  17790. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17791. "use strict";
  17792. __webpack_require__.r(__webpack_exports__);
  17793. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17794. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17795. /* harmony export */ });
  17796. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17797. /***/ }),
  17798. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17799. /*!**********************************************************************************!*\
  17800. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17801. \**********************************************************************************/
  17802. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17803. "use strict";
  17804. __webpack_require__.r(__webpack_exports__);
  17805. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17806. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17807. /* harmony export */ });
  17808. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17809. /***/ }),
  17810. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17811. /*!*************************************************************************************!*\
  17812. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17813. \*************************************************************************************/
  17814. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17815. "use strict";
  17816. __webpack_require__.r(__webpack_exports__);
  17817. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17818. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17819. /* harmony export */ });
  17820. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17821. /***/ }),
  17822. /***/ "./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  17823. /*!*******************************************************************************!*\
  17824. !*** ./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  17825. \*******************************************************************************/
  17826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17827. "use strict";
  17828. __webpack_require__.r(__webpack_exports__);
  17829. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17830. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17831. /* harmony export */ });
  17832. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17833. /***/ }),
  17834. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17835. /*!*********************************************************************************!*\
  17836. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17837. \*********************************************************************************/
  17838. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17839. "use strict";
  17840. __webpack_require__.r(__webpack_exports__);
  17841. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17842. /* harmony export */ "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)
  17843. /* harmony export */ });
  17844. /* 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");
  17845. /***/ }),
  17846. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17847. /*!*****************************************************************************************!*\
  17848. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17849. \*****************************************************************************************/
  17850. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17851. "use strict";
  17852. __webpack_require__.r(__webpack_exports__);
  17853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17854. /* harmony export */ "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)
  17855. /* harmony export */ });
  17856. /* 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");
  17857. /***/ }),
  17858. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17859. /*!******************************************************************************!*\
  17860. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17861. \******************************************************************************/
  17862. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17863. "use strict";
  17864. __webpack_require__.r(__webpack_exports__);
  17865. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17866. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17867. /* harmony export */ });
  17868. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17869. /***/ }),
  17870. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17871. /*!*********************************************************************************!*\
  17872. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17873. \*********************************************************************************/
  17874. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17875. "use strict";
  17876. __webpack_require__.r(__webpack_exports__);
  17877. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17878. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17879. /* harmony export */ });
  17880. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17881. /***/ }),
  17882. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17883. /*!******************************************************************************************!*\
  17884. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17885. \******************************************************************************************/
  17886. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17887. "use strict";
  17888. __webpack_require__.r(__webpack_exports__);
  17889. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17890. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17891. /* harmony export */ });
  17892. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17893. /***/ }),
  17894. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17895. /*!*********************************************************************************************!*\
  17896. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17897. \*********************************************************************************************/
  17898. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17899. "use strict";
  17900. __webpack_require__.r(__webpack_exports__);
  17901. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17902. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17903. /* harmony export */ });
  17904. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17905. /***/ }),
  17906. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17907. /*!*****************************************************************************************!*\
  17908. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17909. \*****************************************************************************************/
  17910. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17911. "use strict";
  17912. __webpack_require__.r(__webpack_exports__);
  17913. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17914. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17915. /* harmony export */ });
  17916. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17917. /***/ }),
  17918. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17919. /*!********************************************************************************************!*\
  17920. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17921. \********************************************************************************************/
  17922. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17923. "use strict";
  17924. __webpack_require__.r(__webpack_exports__);
  17925. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17926. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17927. /* harmony export */ });
  17928. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17929. /***/ }),
  17930. /***/ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c":
  17931. /*!**************************************************************************!*\
  17932. !*** ./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  17933. \**************************************************************************/
  17934. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17935. "use strict";
  17936. __webpack_require__.r(__webpack_exports__);
  17937. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17938. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__.render)
  17939. /* harmony export */ });
  17940. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17941. /***/ }),
  17942. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17943. /*!********************************************************************************************************!*\
  17944. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17945. \********************************************************************************************************/
  17946. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17947. "use strict";
  17948. __webpack_require__.r(__webpack_exports__);
  17949. /* 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");
  17950. /***/ }),
  17951. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17952. /*!*********************************************************************************************************!*\
  17953. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17954. \*********************************************************************************************************/
  17955. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17956. "use strict";
  17957. __webpack_require__.r(__webpack_exports__);
  17958. /* 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");
  17959. /***/ }),
  17960. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17961. /*!************************************************************************************************************!*\
  17962. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17963. \************************************************************************************************************/
  17964. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17965. "use strict";
  17966. __webpack_require__.r(__webpack_exports__);
  17967. /* 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");
  17968. /***/ }),
  17969. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17970. /*!********************************************************************************************************!*\
  17971. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17972. \********************************************************************************************************/
  17973. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17974. "use strict";
  17975. __webpack_require__.r(__webpack_exports__);
  17976. /* 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");
  17977. /***/ }),
  17978. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17979. /*!***********************************************************************************************************!*\
  17980. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17981. \***********************************************************************************************************/
  17982. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17983. "use strict";
  17984. __webpack_require__.r(__webpack_exports__);
  17985. /* 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");
  17986. /***/ })
  17987. }]);