resources_js_pages_Users_Index_vue.js 696KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Users_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***********************************************************************************************************************************************************************************************************!*\
  326. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***********************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  335. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  336. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Users/config.js");
  337. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  338. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  339. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  340. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  341. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  342. __name: 'Index',
  343. props: {
  344. users: Object,
  345. initialSearch: String
  346. },
  347. setup: function setup(__props, _ref) {
  348. var expose = _ref.expose;
  349. expose();
  350. var resetConfirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm)();
  351. var onResetPassword = function onResetPassword(data) {
  352. resetConfirm.require({
  353. message: "Yakin mereset kata sandi (".concat(data.name, ") ?"),
  354. header: 'Reset Kata Sandi',
  355. acceptLabel: 'Iya',
  356. rejectLabel: 'Tidak',
  357. accept: function accept() {
  358. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.put(route('users.reset-password', data.id));
  359. },
  360. reject: function reject() {
  361. resetConfirm.close();
  362. }
  363. });
  364. };
  365. var __returned__ = {
  366. resetConfirm: resetConfirm,
  367. onResetPassword: onResetPassword,
  368. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  369. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm,
  370. indexTable: _config__WEBPACK_IMPORTED_MODULE_2__.indexTable,
  371. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  372. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  373. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  374. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  375. };
  376. Object.defineProperty(__returned__, '__isScriptSetup', {
  377. enumerable: false,
  378. value: true
  379. });
  380. return __returned__;
  381. }
  382. });
  383. /***/ }),
  384. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  385. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  386. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  387. \***********************************************************************************************************************************************************************************************************************************************************************************/
  388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  389. "use strict";
  390. __webpack_require__.r(__webpack_exports__);
  391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  392. /* harmony export */ "render": () => (/* binding */ render)
  393. /* harmony export */ });
  394. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  395. var _hoisted_1 = {
  396. key: 1,
  397. "class": "p-button-label"
  398. };
  399. var _hoisted_2 = {
  400. key: 1,
  401. "class": "p-button p-component"
  402. };
  403. var _hoisted_3 = {
  404. key: 1,
  405. "class": "p-button-label"
  406. };
  407. function render(_ctx, _cache, $props, $setup, $data, $options) {
  408. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  409. key: 0,
  410. "class": "p-button p-component",
  411. as: "button",
  412. type: "button"
  413. }, {
  414. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  415. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  416. key: 0,
  417. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  418. }, null, 2
  419. /* CLASS */
  420. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  421. /* TEXT */
  422. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  423. }),
  424. _: 1
  425. /* STABLE */
  426. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  427. key: 0,
  428. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  429. }, null, 2
  430. /* CLASS */
  431. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  432. /* TEXT */
  433. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  434. }
  435. /***/ }),
  436. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  437. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  438. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  439. \********************************************************************************************************************************************************************************************************************************************************************************/
  440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  441. "use strict";
  442. __webpack_require__.r(__webpack_exports__);
  443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  444. /* harmony export */ "render": () => (/* binding */ render)
  445. /* harmony export */ });
  446. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  447. var _hoisted_1 = {
  448. key: 0
  449. };
  450. var _hoisted_2 = {
  451. key: 1
  452. };
  453. function render(_ctx, _cache, $props, $setup, $data, $options) {
  454. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  455. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  456. key: 0,
  457. severity: "success",
  458. onClose: $setup.onClose
  459. }, {
  460. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  461. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  462. /* TEXT */
  463. )];
  464. }),
  465. _: 1
  466. /* STABLE */
  467. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  468. key: 1,
  469. severity: "error",
  470. onClose: $setup.onClose
  471. }, {
  472. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  473. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  474. /* TEXT */
  475. )];
  476. }),
  477. _: 1
  478. /* STABLE */
  479. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  480. key: 2,
  481. severity: "error",
  482. onClose: $setup.onClose
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  486. /* TEXT */
  487. ))];
  488. }),
  489. _: 1
  490. /* STABLE */
  491. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  492. /* STABLE_FRAGMENT */
  493. );
  494. }
  495. /***/ }),
  496. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  497. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  498. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  499. \***********************************************************************************************************************************************************************************************************************************************************************************/
  500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  501. "use strict";
  502. __webpack_require__.r(__webpack_exports__);
  503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  504. /* harmony export */ "render": () => (/* binding */ render)
  505. /* harmony export */ });
  506. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  507. var _hoisted_1 = {
  508. key: 0,
  509. "class": "p-paginator p-component flex justify-content-start"
  510. };
  511. var _hoisted_2 = {
  512. "class": "p-paginator-pages"
  513. };
  514. var _hoisted_3 = ["innerHTML"];
  515. function render(_ctx, _cache, $props, $setup, $data, $options) {
  516. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  517. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  518. key: "link-".concat(key),
  519. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  520. 'p-disabled': link
  521. }]),
  522. innerHTML: link.label
  523. }, null, 10
  524. /* CLASS, PROPS */
  525. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  526. key: "link-".concat(key),
  527. href: link.url,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'p-highlight': link.active
  530. }, "p-paginator-page p-paginator-element p-link"]),
  531. innerHTML: link.label
  532. }, null, 8
  533. /* PROPS */
  534. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  535. /* STABLE_FRAGMENT */
  536. );
  537. }), 256
  538. /* UNKEYED_FRAGMENT */
  539. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  540. }
  541. /***/ }),
  542. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  543. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  544. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  545. \*******************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. function render(_ctx, _cache, $props, $setup, $data, $options) {
  554. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  555. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  556. modelValue: $setup.search,
  557. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  558. return $setup.search = $event;
  559. })
  560. }, null, 8
  561. /* PROPS */
  562. , ["modelValue"]);
  563. }
  564. /***/ }),
  565. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  566. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  567. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  568. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  570. "use strict";
  571. __webpack_require__.r(__webpack_exports__);
  572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  573. /* harmony export */ "render": () => (/* binding */ render)
  574. /* harmony export */ });
  575. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  576. var _hoisted_1 = {
  577. "class": "layout-footer"
  578. };
  579. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  580. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  581. href: "https://dijitalcode.com",
  582. target: "_blank",
  583. "class": "font-medium ml-2"
  584. }, " DijitalCODE ", -1
  585. /* HOISTED */
  586. );
  587. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  588. function render(_ctx, _cache) {
  589. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  593. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  595. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. function render(_ctx, _cache, $props, $setup, $data, $options) {
  604. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["SubSidebar"], {
  605. "class": "layout-menu",
  606. items: $props.menu,
  607. root: true
  608. }, null, 8
  609. /* PROPS */
  610. , ["items"])]);
  611. }
  612. /***/ }),
  613. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  614. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  615. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  616. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  618. "use strict";
  619. __webpack_require__.r(__webpack_exports__);
  620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  621. /* harmony export */ "render": () => (/* binding */ render)
  622. /* harmony export */ });
  623. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  624. var _withScopeId = function _withScopeId(n) {
  625. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  626. };
  627. var _hoisted_1 = {
  628. key: 0
  629. };
  630. var _hoisted_2 = ["aria-label"];
  631. var _hoisted_3 = ["aria-label"];
  632. function render(_ctx, _cache, $props, $setup, $data, $options) {
  633. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  634. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  635. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  636. key: i,
  637. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  638. 'layout-menuitem-category': $props.root
  639. }]),
  640. role: "none"
  641. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  642. key: 0
  643. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  644. "class": "layout-menuitem-root-text",
  645. "aria-label": item.label
  646. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  647. /* TEXT, PROPS */
  648. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  649. items: item.items
  650. }, null, 8
  651. /* PROPS */
  652. , ["items"])], 64
  653. /* STABLE_FRAGMENT */
  654. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  655. key: 1
  656. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  657. key: 0,
  658. role: "menuitem",
  659. href: item.to,
  660. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  661. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  662. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  663. }]),
  664. "aria-label": item.label
  665. }, {
  666. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  667. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  669. }, null, 2
  670. /* CLASS */
  671. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  672. /* TEXT */
  673. )];
  674. }),
  675. _: 2
  676. /* DYNAMIC */
  677. }, 1032
  678. /* PROPS, DYNAMIC_SLOTS */
  679. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  680. key: 1,
  681. href: "#",
  682. role: "menuitem",
  683. "aria-label": item.label
  684. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  686. }, null, 2
  687. /* CLASS */
  688. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  689. /* TEXT */
  690. )], 8
  691. /* PROPS */
  692. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  693. items: item.items
  694. }, null, 8
  695. /* PROPS */
  696. , ["items"])], 64
  697. /* STABLE_FRAGMENT */
  698. ))], 2
  699. /* CLASS */
  700. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  701. /* STABLE_FRAGMENT */
  702. );
  703. }), 256
  704. /* UNKEYED_FRAGMENT */
  705. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  706. }
  707. /***/ }),
  708. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  709. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  710. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  711. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  713. "use strict";
  714. __webpack_require__.r(__webpack_exports__);
  715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  716. /* harmony export */ "render": () => (/* binding */ render)
  717. /* harmony export */ });
  718. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  719. var _withScopeId = function _withScopeId(n) {
  720. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  721. };
  722. var _hoisted_1 = {
  723. "class": "layout-topbar"
  724. };
  725. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  726. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  727. alt: "Brand Logo",
  728. src: "/images/logo.svg",
  729. "class": "md:mr-3"
  730. }, null, -1
  731. /* HOISTED */
  732. );
  733. });
  734. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  735. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  736. /* HOISTED */
  737. );
  738. });
  739. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  740. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  741. "class": "pi pi-bars"
  742. }, null, -1
  743. /* HOISTED */
  744. );
  745. });
  746. var _hoisted_5 = [_hoisted_4];
  747. var _hoisted_6 = {
  748. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  749. };
  750. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  751. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  752. "class": "pi pi-ellipsis-v"
  753. }, null, -1
  754. /* HOISTED */
  755. );
  756. });
  757. var _hoisted_8 = [_hoisted_7];
  758. var _hoisted_9 = {
  759. "class": "layout-topbar-menu hidden lg:flex origin-top"
  760. };
  761. var _hoisted_10 = {
  762. "class": "align-self-center"
  763. };
  764. var _hoisted_11 = {
  765. "class": "hidden lg:inline"
  766. };
  767. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  768. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  769. "class": "pi pi-user"
  770. }, null, -1
  771. /* HOISTED */
  772. );
  773. });
  774. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  775. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  780. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  781. "class": "pi pi-sign-out"
  782. }, null, -1
  783. /* HOISTED */
  784. );
  785. });
  786. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  787. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  788. /* HOISTED */
  789. );
  790. });
  791. function render(_ctx, _cache, $props, $setup, $data, $options) {
  792. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  793. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  794. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  795. href: "/",
  796. "class": "layout-topbar-logo"
  797. }, {
  798. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  799. return [_hoisted_2, _hoisted_3];
  800. }),
  801. _: 1
  802. /* STABLE */
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  804. "class": "p-link layout-menu-button layout-topbar-button",
  805. onClick: _cache[0] || (_cache[0] = function ($event) {
  806. return _ctx.$emit('menu-toggle', $event);
  807. })
  808. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  809. selector: '@next',
  810. enterClass: 'hidden',
  811. enterActiveClass: 'scalein',
  812. leaveToClass: 'hidden',
  813. leaveActiveClass: 'fadeout',
  814. hideOnOutsideClick: true
  815. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  816. /* TEXT */
  817. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  818. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  819. "class": "p-link layout-topbar-button"
  820. }, {
  821. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [_hoisted_12, _hoisted_13];
  823. }),
  824. _: 1
  825. /* STABLE */
  826. }, 8
  827. /* PROPS */
  828. , ["href"])), [[_directive_tooltip, {
  829. value: 'Ubah Profil',
  830. "class": 'layout-topbar-menu-tooltip'
  831. }, void 0, {
  832. bottom: true
  833. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  834. href: _ctx.route('logout'),
  835. as: "button",
  836. method: "post",
  837. "class": "p-link layout-topbar-button"
  838. }, {
  839. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  840. return [_hoisted_14, _hoisted_15];
  841. }),
  842. _: 1
  843. /* STABLE */
  844. }, 8
  845. /* PROPS */
  846. , ["href"])), [[_directive_tooltip, {
  847. value: 'Keluar',
  848. "class": 'layout-topbar-menu-tooltip'
  849. }, void 0, {
  850. bottom: true
  851. }]])])])]);
  852. }
  853. /***/ }),
  854. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  855. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  856. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  857. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  859. "use strict";
  860. __webpack_require__.r(__webpack_exports__);
  861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  862. /* harmony export */ "render": () => (/* binding */ render)
  863. /* harmony export */ });
  864. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  865. var _withScopeId = function _withScopeId(n) {
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  867. };
  868. var _hoisted_1 = {
  869. "class": "layout-sidebar"
  870. };
  871. var _hoisted_2 = {
  872. "class": "layout-main-container"
  873. };
  874. var _hoisted_3 = {
  875. "class": "layout-main"
  876. };
  877. var _hoisted_4 = {
  878. key: 0,
  879. "class": "layout-mask p-component-overlay"
  880. };
  881. function render(_ctx, _cache, $props, $setup, $data, $options) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  883. title: $props.title
  884. }, null, 8
  885. /* PROPS */
  886. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  887. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  888. onClick: $setup.onWrapperClick
  889. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  890. onMenuToggle: $setup.onMenuToggle
  891. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  892. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  893. }, null, 8
  894. /* PROPS */
  895. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  896. name: "layout-mask"
  897. }, {
  898. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  899. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  900. }),
  901. _: 1
  902. /* STABLE */
  903. })], 2
  904. /* CLASS */
  905. )], 64
  906. /* STABLE_FRAGMENT */
  907. );
  908. }
  909. /***/ }),
  910. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c":
  911. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  912. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c ***!
  913. \****************************************************************************************************************************************************************************************************************************************************************************/
  914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  915. "use strict";
  916. __webpack_require__.r(__webpack_exports__);
  917. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  918. /* harmony export */ "render": () => (/* binding */ render)
  919. /* harmony export */ });
  920. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  921. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  922. /* HOISTED */
  923. );
  924. var _hoisted_2 = {
  925. "class": "grid"
  926. };
  927. var _hoisted_3 = {
  928. "class": "col-12 md:col-8"
  929. };
  930. var _hoisted_4 = {
  931. "class": "flex align-items-center"
  932. };
  933. var _hoisted_5 = {
  934. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  935. };
  936. function render(_ctx, _cache, $props, $setup, $data, $options) {
  937. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  938. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  939. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  940. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  941. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  942. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], {
  943. title: "Daftar User"
  944. }, {
  945. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  946. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  947. responsiveLayout: "scroll",
  948. columnResizeMode: "expand",
  949. value: $props.users.data,
  950. rowHover: true,
  951. stripedRows: true
  952. }, {
  953. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  954. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSearch"], {
  955. "class": "w-full md:w-27rem",
  956. placeholder: "cari, contoh: tina",
  957. url: "/users",
  958. initialSearch: $props.initialSearch
  959. }, null, 8
  960. /* PROPS */
  961. , ["initialSearch"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. label: "Tambah User",
  963. icon: "pi pi-pencil",
  964. "class": "p-button-outlined",
  965. href: _ctx.route('users.create')
  966. }, null, 8
  967. /* PROPS */
  968. , ["href"])])])];
  969. }),
  970. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  971. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  972. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  973. field: value.field,
  974. header: value.header,
  975. key: value.field
  976. }, null, 8
  977. /* PROPS */
  978. , ["field", "header"]);
  979. }), 128
  980. /* KEYED_FRAGMENT */
  981. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  982. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  983. var data = _ref.data;
  984. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  985. icon: "pi pi-pencil",
  986. "class": "p-button-icon-only p-button-rounded p-button-text",
  987. href: _ctx.route('users.edit', data.id)
  988. }, null, 8
  989. /* PROPS */
  990. , ["href"]), [[_directive_tooltip, 'Ubah User', void 0, {
  991. bottom: true
  992. }]]), data.role_id !== 1 ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Button, {
  993. key: 0,
  994. icon: "pi pi-key",
  995. "class": "p-button-icon-only p-button-rounded p-button-text",
  996. onClick: function onClick($event) {
  997. return $setup.onResetPassword(data);
  998. }
  999. }, null, 8
  1000. /* PROPS */
  1001. , ["onClick"])), [[_directive_tooltip, 'Reset Kata Sandi', void 0, {
  1002. bottom: true
  1003. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1004. }),
  1005. _: 1
  1006. /* STABLE */
  1007. })];
  1008. }),
  1009. _: 1
  1010. /* STABLE */
  1011. }, 8
  1012. /* PROPS */
  1013. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1014. links: $props.users.links
  1015. }, null, 8
  1016. /* PROPS */
  1017. , ["links"])];
  1018. }),
  1019. _: 1
  1020. /* STABLE */
  1021. });
  1022. }
  1023. /***/ }),
  1024. /***/ "./resources/js/pages/Users/config.js":
  1025. /*!********************************************!*\
  1026. !*** ./resources/js/pages/Users/config.js ***!
  1027. \********************************************/
  1028. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1029. "use strict";
  1030. __webpack_require__.r(__webpack_exports__);
  1031. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1032. /* harmony export */ "indexTable": () => (/* binding */ indexTable)
  1033. /* harmony export */ });
  1034. var indexTable = [{
  1035. field: 'name',
  1036. header: 'Nama'
  1037. }, {
  1038. field: 'username',
  1039. header: 'Nama Pengguna'
  1040. }, {
  1041. field: 'role',
  1042. header: 'Hak Akses'
  1043. }, {
  1044. field: 'status',
  1045. header: 'Status'
  1046. }];
  1047. /***/ }),
  1048. /***/ "./resources/js/utils/menu.js":
  1049. /*!************************************!*\
  1050. !*** ./resources/js/utils/menu.js ***!
  1051. \************************************/
  1052. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1053. "use strict";
  1054. __webpack_require__.r(__webpack_exports__);
  1055. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1056. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1057. /* harmony export */ });
  1058. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1059. // Admin
  1060. 1: [{
  1061. label: 'Home',
  1062. items: [{
  1063. label: 'Dashboard',
  1064. icon: 'pi pi-chart-bar',
  1065. to: '/dashboards',
  1066. component: 'Dashboards/Index'
  1067. }]
  1068. }, {
  1069. label: 'Laporan',
  1070. items: []
  1071. }, {
  1072. label: 'Master',
  1073. items: [{
  1074. label: 'User',
  1075. icon: 'pi pi-user',
  1076. to: '/users',
  1077. component: 'Users/Index'
  1078. }]
  1079. }],
  1080. // Supervisor
  1081. 2: [{
  1082. label: 'Home',
  1083. items: [{
  1084. label: 'Dashboard',
  1085. icon: 'pi pi-chart-bar',
  1086. to: '/dashboards',
  1087. component: 'Dashboards/Index'
  1088. }]
  1089. }, {
  1090. label: 'Master',
  1091. items: [{
  1092. label: 'Pelanggan',
  1093. icon: 'pi pi-users',
  1094. to: '/customers',
  1095. component: 'Customers/Index'
  1096. }, {
  1097. label: 'Pembelian',
  1098. icon: 'pi pi-shopping-cart',
  1099. to: '/purchases',
  1100. component: 'Purchases/Index'
  1101. }, {
  1102. label: 'Penjualan',
  1103. icon: 'pi pi-tag',
  1104. to: '/sales',
  1105. component: 'Sales/Index'
  1106. }, {
  1107. label: 'Produk',
  1108. icon: 'pi pi-th-large',
  1109. to: '/products',
  1110. component: 'Products/Index'
  1111. }]
  1112. }],
  1113. // Operator
  1114. 3: [{
  1115. label: 'Home',
  1116. items: [{
  1117. label: 'Dashboard',
  1118. icon: 'pi pi-chart-bar',
  1119. to: '/dashboards',
  1120. component: 'Dashboards/Index'
  1121. }]
  1122. }, {
  1123. label: 'Master',
  1124. items: [{
  1125. label: 'Supplier',
  1126. icon: 'pi pi-shopping-cart',
  1127. to: '/suppliers',
  1128. component: 'Suppliers/Index'
  1129. }, {
  1130. label: 'Stok Barang',
  1131. icon: 'pi pi-box',
  1132. to: '/stock-products',
  1133. component: 'StockProducts/Index'
  1134. }]
  1135. }]
  1136. });
  1137. /***/ }),
  1138. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1139. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1140. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1141. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1142. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1143. "use strict";
  1144. __webpack_require__.r(__webpack_exports__);
  1145. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1146. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1147. /* harmony export */ });
  1148. /* 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");
  1149. /* 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__);
  1150. // Imports
  1151. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1152. // Module
  1153. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1154. // Exports
  1155. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1156. /***/ }),
  1157. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1158. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1159. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1160. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1161. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1162. "use strict";
  1163. __webpack_require__.r(__webpack_exports__);
  1164. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1165. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1166. /* harmony export */ });
  1167. /* 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");
  1168. /* 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__);
  1169. // Imports
  1170. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1171. // Module
  1172. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-b1b23eb4] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1173. // Exports
  1174. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1175. /***/ }),
  1176. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1177. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1178. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1179. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1180. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1181. "use strict";
  1182. __webpack_require__.r(__webpack_exports__);
  1183. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1184. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1185. /* harmony export */ });
  1186. /* 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");
  1187. /* 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__);
  1188. // Imports
  1189. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1190. // Module
  1191. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1192. // Exports
  1193. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&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/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&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-sidebar[data-v-1d279fe2] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-1d279fe2] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1211. // Exports
  1212. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1213. /***/ }),
  1214. /***/ "./node_modules/lodash/lodash.js":
  1215. /*!***************************************!*\
  1216. !*** ./node_modules/lodash/lodash.js ***!
  1217. \***************************************/
  1218. /***/ (function(module, exports, __webpack_require__) {
  1219. /* module decorator */ module = __webpack_require__.nmd(module);
  1220. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1221. * @license
  1222. * Lodash <https://lodash.com/>
  1223. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1224. * Released under MIT license <https://lodash.com/license>
  1225. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1226. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1227. */
  1228. ;(function() {
  1229. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1230. var undefined;
  1231. /** Used as the semantic version number. */
  1232. var VERSION = '4.17.21';
  1233. /** Used as the size to enable large array optimizations. */
  1234. var LARGE_ARRAY_SIZE = 200;
  1235. /** Error message constants. */
  1236. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1237. FUNC_ERROR_TEXT = 'Expected a function',
  1238. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1239. /** Used to stand-in for `undefined` hash values. */
  1240. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1241. /** Used as the maximum memoize cache size. */
  1242. var MAX_MEMOIZE_SIZE = 500;
  1243. /** Used as the internal argument placeholder. */
  1244. var PLACEHOLDER = '__lodash_placeholder__';
  1245. /** Used to compose bitmasks for cloning. */
  1246. var CLONE_DEEP_FLAG = 1,
  1247. CLONE_FLAT_FLAG = 2,
  1248. CLONE_SYMBOLS_FLAG = 4;
  1249. /** Used to compose bitmasks for value comparisons. */
  1250. var COMPARE_PARTIAL_FLAG = 1,
  1251. COMPARE_UNORDERED_FLAG = 2;
  1252. /** Used to compose bitmasks for function metadata. */
  1253. var WRAP_BIND_FLAG = 1,
  1254. WRAP_BIND_KEY_FLAG = 2,
  1255. WRAP_CURRY_BOUND_FLAG = 4,
  1256. WRAP_CURRY_FLAG = 8,
  1257. WRAP_CURRY_RIGHT_FLAG = 16,
  1258. WRAP_PARTIAL_FLAG = 32,
  1259. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1260. WRAP_ARY_FLAG = 128,
  1261. WRAP_REARG_FLAG = 256,
  1262. WRAP_FLIP_FLAG = 512;
  1263. /** Used as default options for `_.truncate`. */
  1264. var DEFAULT_TRUNC_LENGTH = 30,
  1265. DEFAULT_TRUNC_OMISSION = '...';
  1266. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1267. var HOT_COUNT = 800,
  1268. HOT_SPAN = 16;
  1269. /** Used to indicate the type of lazy iteratees. */
  1270. var LAZY_FILTER_FLAG = 1,
  1271. LAZY_MAP_FLAG = 2,
  1272. LAZY_WHILE_FLAG = 3;
  1273. /** Used as references for various `Number` constants. */
  1274. var INFINITY = 1 / 0,
  1275. MAX_SAFE_INTEGER = 9007199254740991,
  1276. MAX_INTEGER = 1.7976931348623157e+308,
  1277. NAN = 0 / 0;
  1278. /** Used as references for the maximum length and index of an array. */
  1279. var MAX_ARRAY_LENGTH = 4294967295,
  1280. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1281. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1282. /** Used to associate wrap methods with their bit flags. */
  1283. var wrapFlags = [
  1284. ['ary', WRAP_ARY_FLAG],
  1285. ['bind', WRAP_BIND_FLAG],
  1286. ['bindKey', WRAP_BIND_KEY_FLAG],
  1287. ['curry', WRAP_CURRY_FLAG],
  1288. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1289. ['flip', WRAP_FLIP_FLAG],
  1290. ['partial', WRAP_PARTIAL_FLAG],
  1291. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1292. ['rearg', WRAP_REARG_FLAG]
  1293. ];
  1294. /** `Object#toString` result references. */
  1295. var argsTag = '[object Arguments]',
  1296. arrayTag = '[object Array]',
  1297. asyncTag = '[object AsyncFunction]',
  1298. boolTag = '[object Boolean]',
  1299. dateTag = '[object Date]',
  1300. domExcTag = '[object DOMException]',
  1301. errorTag = '[object Error]',
  1302. funcTag = '[object Function]',
  1303. genTag = '[object GeneratorFunction]',
  1304. mapTag = '[object Map]',
  1305. numberTag = '[object Number]',
  1306. nullTag = '[object Null]',
  1307. objectTag = '[object Object]',
  1308. promiseTag = '[object Promise]',
  1309. proxyTag = '[object Proxy]',
  1310. regexpTag = '[object RegExp]',
  1311. setTag = '[object Set]',
  1312. stringTag = '[object String]',
  1313. symbolTag = '[object Symbol]',
  1314. undefinedTag = '[object Undefined]',
  1315. weakMapTag = '[object WeakMap]',
  1316. weakSetTag = '[object WeakSet]';
  1317. var arrayBufferTag = '[object ArrayBuffer]',
  1318. dataViewTag = '[object DataView]',
  1319. float32Tag = '[object Float32Array]',
  1320. float64Tag = '[object Float64Array]',
  1321. int8Tag = '[object Int8Array]',
  1322. int16Tag = '[object Int16Array]',
  1323. int32Tag = '[object Int32Array]',
  1324. uint8Tag = '[object Uint8Array]',
  1325. uint8ClampedTag = '[object Uint8ClampedArray]',
  1326. uint16Tag = '[object Uint16Array]',
  1327. uint32Tag = '[object Uint32Array]';
  1328. /** Used to match empty string literals in compiled template source. */
  1329. var reEmptyStringLeading = /\b__p \+= '';/g,
  1330. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1331. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1332. /** Used to match HTML entities and HTML characters. */
  1333. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1334. reUnescapedHtml = /[&<>"']/g,
  1335. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1336. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1337. /** Used to match template delimiters. */
  1338. var reEscape = /<%-([\s\S]+?)%>/g,
  1339. reEvaluate = /<%([\s\S]+?)%>/g,
  1340. reInterpolate = /<%=([\s\S]+?)%>/g;
  1341. /** Used to match property names within property paths. */
  1342. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1343. reIsPlainProp = /^\w*$/,
  1344. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1345. /**
  1346. * Used to match `RegExp`
  1347. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1348. */
  1349. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1350. reHasRegExpChar = RegExp(reRegExpChar.source);
  1351. /** Used to match leading whitespace. */
  1352. var reTrimStart = /^\s+/;
  1353. /** Used to match a single whitespace character. */
  1354. var reWhitespace = /\s/;
  1355. /** Used to match wrap detail comments. */
  1356. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1357. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1358. reSplitDetails = /,? & /;
  1359. /** Used to match words composed of alphanumeric characters. */
  1360. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1361. /**
  1362. * Used to validate the `validate` option in `_.template` variable.
  1363. *
  1364. * Forbids characters which could potentially change the meaning of the function argument definition:
  1365. * - "()," (modification of function parameters)
  1366. * - "=" (default value)
  1367. * - "[]{}" (destructuring of function parameters)
  1368. * - "/" (beginning of a comment)
  1369. * - whitespace
  1370. */
  1371. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1372. /** Used to match backslashes in property paths. */
  1373. var reEscapeChar = /\\(\\)?/g;
  1374. /**
  1375. * Used to match
  1376. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1377. */
  1378. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1379. /** Used to match `RegExp` flags from their coerced string values. */
  1380. var reFlags = /\w*$/;
  1381. /** Used to detect bad signed hexadecimal string values. */
  1382. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1383. /** Used to detect binary string values. */
  1384. var reIsBinary = /^0b[01]+$/i;
  1385. /** Used to detect host constructors (Safari). */
  1386. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1387. /** Used to detect octal string values. */
  1388. var reIsOctal = /^0o[0-7]+$/i;
  1389. /** Used to detect unsigned integer values. */
  1390. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1391. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1392. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1393. /** Used to ensure capturing order of template delimiters. */
  1394. var reNoMatch = /($^)/;
  1395. /** Used to match unescaped characters in compiled string literals. */
  1396. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1397. /** Used to compose unicode character classes. */
  1398. var rsAstralRange = '\\ud800-\\udfff',
  1399. rsComboMarksRange = '\\u0300-\\u036f',
  1400. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1401. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1402. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1403. rsDingbatRange = '\\u2700-\\u27bf',
  1404. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1405. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1406. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1407. rsPunctuationRange = '\\u2000-\\u206f',
  1408. 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',
  1409. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1410. rsVarRange = '\\ufe0e\\ufe0f',
  1411. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1412. /** Used to compose unicode capture groups. */
  1413. var rsApos = "['\u2019]",
  1414. rsAstral = '[' + rsAstralRange + ']',
  1415. rsBreak = '[' + rsBreakRange + ']',
  1416. rsCombo = '[' + rsComboRange + ']',
  1417. rsDigits = '\\d+',
  1418. rsDingbat = '[' + rsDingbatRange + ']',
  1419. rsLower = '[' + rsLowerRange + ']',
  1420. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1421. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1422. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1423. rsNonAstral = '[^' + rsAstralRange + ']',
  1424. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1425. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1426. rsUpper = '[' + rsUpperRange + ']',
  1427. rsZWJ = '\\u200d';
  1428. /** Used to compose unicode regexes. */
  1429. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1430. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1431. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1432. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1433. reOptMod = rsModifier + '?',
  1434. rsOptVar = '[' + rsVarRange + ']?',
  1435. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1436. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1437. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1438. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1439. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1440. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1441. /** Used to match apostrophes. */
  1442. var reApos = RegExp(rsApos, 'g');
  1443. /**
  1444. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1445. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1446. */
  1447. var reComboMark = RegExp(rsCombo, 'g');
  1448. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1449. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1450. /** Used to match complex or compound words. */
  1451. var reUnicodeWord = RegExp([
  1452. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1453. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1454. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1455. rsUpper + '+' + rsOptContrUpper,
  1456. rsOrdUpper,
  1457. rsOrdLower,
  1458. rsDigits,
  1459. rsEmoji
  1460. ].join('|'), 'g');
  1461. /** 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/). */
  1462. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1463. /** Used to detect strings that need a more robust regexp to match words. */
  1464. 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 ]/;
  1465. /** Used to assign default `context` object properties. */
  1466. var contextProps = [
  1467. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1468. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1469. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1470. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1471. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1472. ];
  1473. /** Used to make template sourceURLs easier to identify. */
  1474. var templateCounter = -1;
  1475. /** Used to identify `toStringTag` values of typed arrays. */
  1476. var typedArrayTags = {};
  1477. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1478. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1479. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1480. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1481. typedArrayTags[uint32Tag] = true;
  1482. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1483. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1484. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1485. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1486. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1487. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1488. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1489. typedArrayTags[weakMapTag] = false;
  1490. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1491. var cloneableTags = {};
  1492. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1493. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1494. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1495. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1496. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1497. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1498. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1499. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1500. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1501. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1502. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1503. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1504. cloneableTags[weakMapTag] = false;
  1505. /** Used to map Latin Unicode letters to basic Latin letters. */
  1506. var deburredLetters = {
  1507. // Latin-1 Supplement block.
  1508. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1509. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1510. '\xc7': 'C', '\xe7': 'c',
  1511. '\xd0': 'D', '\xf0': 'd',
  1512. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1513. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1514. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1515. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1516. '\xd1': 'N', '\xf1': 'n',
  1517. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1518. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1519. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1520. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1521. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1522. '\xc6': 'Ae', '\xe6': 'ae',
  1523. '\xde': 'Th', '\xfe': 'th',
  1524. '\xdf': 'ss',
  1525. // Latin Extended-A block.
  1526. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1527. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1528. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1529. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1530. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1531. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1532. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1533. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1534. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1535. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1536. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1537. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1538. '\u0134': 'J', '\u0135': 'j',
  1539. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1540. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1541. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1542. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1543. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1544. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1545. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1546. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1547. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1548. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1549. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1550. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1551. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1552. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1553. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1554. '\u0174': 'W', '\u0175': 'w',
  1555. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1556. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1557. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1558. '\u0132': 'IJ', '\u0133': 'ij',
  1559. '\u0152': 'Oe', '\u0153': 'oe',
  1560. '\u0149': "'n", '\u017f': 's'
  1561. };
  1562. /** Used to map characters to HTML entities. */
  1563. var htmlEscapes = {
  1564. '&': '&amp;',
  1565. '<': '&lt;',
  1566. '>': '&gt;',
  1567. '"': '&quot;',
  1568. "'": '&#39;'
  1569. };
  1570. /** Used to map HTML entities to characters. */
  1571. var htmlUnescapes = {
  1572. '&amp;': '&',
  1573. '&lt;': '<',
  1574. '&gt;': '>',
  1575. '&quot;': '"',
  1576. '&#39;': "'"
  1577. };
  1578. /** Used to escape characters for inclusion in compiled string literals. */
  1579. var stringEscapes = {
  1580. '\\': '\\',
  1581. "'": "'",
  1582. '\n': 'n',
  1583. '\r': 'r',
  1584. '\u2028': 'u2028',
  1585. '\u2029': 'u2029'
  1586. };
  1587. /** Built-in method references without a dependency on `root`. */
  1588. var freeParseFloat = parseFloat,
  1589. freeParseInt = parseInt;
  1590. /** Detect free variable `global` from Node.js. */
  1591. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1592. /** Detect free variable `self`. */
  1593. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1594. /** Used as a reference to the global object. */
  1595. var root = freeGlobal || freeSelf || Function('return this')();
  1596. /** Detect free variable `exports`. */
  1597. var freeExports = true && exports && !exports.nodeType && exports;
  1598. /** Detect free variable `module`. */
  1599. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1600. /** Detect the popular CommonJS extension `module.exports`. */
  1601. var moduleExports = freeModule && freeModule.exports === freeExports;
  1602. /** Detect free variable `process` from Node.js. */
  1603. var freeProcess = moduleExports && freeGlobal.process;
  1604. /** Used to access faster Node.js helpers. */
  1605. var nodeUtil = (function() {
  1606. try {
  1607. // Use `util.types` for Node.js 10+.
  1608. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1609. if (types) {
  1610. return types;
  1611. }
  1612. // Legacy `process.binding('util')` for Node.js < 10.
  1613. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1614. } catch (e) {}
  1615. }());
  1616. /* Node.js helper references. */
  1617. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1618. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1619. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1620. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1621. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1622. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1623. /*--------------------------------------------------------------------------*/
  1624. /**
  1625. * A faster alternative to `Function#apply`, this function invokes `func`
  1626. * with the `this` binding of `thisArg` and the arguments of `args`.
  1627. *
  1628. * @private
  1629. * @param {Function} func The function to invoke.
  1630. * @param {*} thisArg The `this` binding of `func`.
  1631. * @param {Array} args The arguments to invoke `func` with.
  1632. * @returns {*} Returns the result of `func`.
  1633. */
  1634. function apply(func, thisArg, args) {
  1635. switch (args.length) {
  1636. case 0: return func.call(thisArg);
  1637. case 1: return func.call(thisArg, args[0]);
  1638. case 2: return func.call(thisArg, args[0], args[1]);
  1639. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1640. }
  1641. return func.apply(thisArg, args);
  1642. }
  1643. /**
  1644. * A specialized version of `baseAggregator` for arrays.
  1645. *
  1646. * @private
  1647. * @param {Array} [array] The array to iterate over.
  1648. * @param {Function} setter The function to set `accumulator` values.
  1649. * @param {Function} iteratee The iteratee to transform keys.
  1650. * @param {Object} accumulator The initial aggregated object.
  1651. * @returns {Function} Returns `accumulator`.
  1652. */
  1653. function arrayAggregator(array, setter, iteratee, accumulator) {
  1654. var index = -1,
  1655. length = array == null ? 0 : array.length;
  1656. while (++index < length) {
  1657. var value = array[index];
  1658. setter(accumulator, value, iteratee(value), array);
  1659. }
  1660. return accumulator;
  1661. }
  1662. /**
  1663. * A specialized version of `_.forEach` for arrays without support for
  1664. * iteratee shorthands.
  1665. *
  1666. * @private
  1667. * @param {Array} [array] The array to iterate over.
  1668. * @param {Function} iteratee The function invoked per iteration.
  1669. * @returns {Array} Returns `array`.
  1670. */
  1671. function arrayEach(array, iteratee) {
  1672. var index = -1,
  1673. length = array == null ? 0 : array.length;
  1674. while (++index < length) {
  1675. if (iteratee(array[index], index, array) === false) {
  1676. break;
  1677. }
  1678. }
  1679. return array;
  1680. }
  1681. /**
  1682. * A specialized version of `_.forEachRight` for arrays without support for
  1683. * iteratee shorthands.
  1684. *
  1685. * @private
  1686. * @param {Array} [array] The array to iterate over.
  1687. * @param {Function} iteratee The function invoked per iteration.
  1688. * @returns {Array} Returns `array`.
  1689. */
  1690. function arrayEachRight(array, iteratee) {
  1691. var length = array == null ? 0 : array.length;
  1692. while (length--) {
  1693. if (iteratee(array[length], length, array) === false) {
  1694. break;
  1695. }
  1696. }
  1697. return array;
  1698. }
  1699. /**
  1700. * A specialized version of `_.every` for arrays without support for
  1701. * iteratee shorthands.
  1702. *
  1703. * @private
  1704. * @param {Array} [array] The array to iterate over.
  1705. * @param {Function} predicate The function invoked per iteration.
  1706. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1707. * else `false`.
  1708. */
  1709. function arrayEvery(array, predicate) {
  1710. var index = -1,
  1711. length = array == null ? 0 : array.length;
  1712. while (++index < length) {
  1713. if (!predicate(array[index], index, array)) {
  1714. return false;
  1715. }
  1716. }
  1717. return true;
  1718. }
  1719. /**
  1720. * A specialized version of `_.filter` for arrays without support for
  1721. * iteratee shorthands.
  1722. *
  1723. * @private
  1724. * @param {Array} [array] The array to iterate over.
  1725. * @param {Function} predicate The function invoked per iteration.
  1726. * @returns {Array} Returns the new filtered array.
  1727. */
  1728. function arrayFilter(array, predicate) {
  1729. var index = -1,
  1730. length = array == null ? 0 : array.length,
  1731. resIndex = 0,
  1732. result = [];
  1733. while (++index < length) {
  1734. var value = array[index];
  1735. if (predicate(value, index, array)) {
  1736. result[resIndex++] = value;
  1737. }
  1738. }
  1739. return result;
  1740. }
  1741. /**
  1742. * A specialized version of `_.includes` for arrays without support for
  1743. * specifying an index to search from.
  1744. *
  1745. * @private
  1746. * @param {Array} [array] The array to inspect.
  1747. * @param {*} target The value to search for.
  1748. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1749. */
  1750. function arrayIncludes(array, value) {
  1751. var length = array == null ? 0 : array.length;
  1752. return !!length && baseIndexOf(array, value, 0) > -1;
  1753. }
  1754. /**
  1755. * This function is like `arrayIncludes` except that it accepts a comparator.
  1756. *
  1757. * @private
  1758. * @param {Array} [array] The array to inspect.
  1759. * @param {*} target The value to search for.
  1760. * @param {Function} comparator The comparator invoked per element.
  1761. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1762. */
  1763. function arrayIncludesWith(array, value, comparator) {
  1764. var index = -1,
  1765. length = array == null ? 0 : array.length;
  1766. while (++index < length) {
  1767. if (comparator(value, array[index])) {
  1768. return true;
  1769. }
  1770. }
  1771. return false;
  1772. }
  1773. /**
  1774. * A specialized version of `_.map` for arrays without support for iteratee
  1775. * shorthands.
  1776. *
  1777. * @private
  1778. * @param {Array} [array] The array to iterate over.
  1779. * @param {Function} iteratee The function invoked per iteration.
  1780. * @returns {Array} Returns the new mapped array.
  1781. */
  1782. function arrayMap(array, iteratee) {
  1783. var index = -1,
  1784. length = array == null ? 0 : array.length,
  1785. result = Array(length);
  1786. while (++index < length) {
  1787. result[index] = iteratee(array[index], index, array);
  1788. }
  1789. return result;
  1790. }
  1791. /**
  1792. * Appends the elements of `values` to `array`.
  1793. *
  1794. * @private
  1795. * @param {Array} array The array to modify.
  1796. * @param {Array} values The values to append.
  1797. * @returns {Array} Returns `array`.
  1798. */
  1799. function arrayPush(array, values) {
  1800. var index = -1,
  1801. length = values.length,
  1802. offset = array.length;
  1803. while (++index < length) {
  1804. array[offset + index] = values[index];
  1805. }
  1806. return array;
  1807. }
  1808. /**
  1809. * A specialized version of `_.reduce` for arrays without support for
  1810. * iteratee shorthands.
  1811. *
  1812. * @private
  1813. * @param {Array} [array] The array to iterate over.
  1814. * @param {Function} iteratee The function invoked per iteration.
  1815. * @param {*} [accumulator] The initial value.
  1816. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1817. * the initial value.
  1818. * @returns {*} Returns the accumulated value.
  1819. */
  1820. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1821. var index = -1,
  1822. length = array == null ? 0 : array.length;
  1823. if (initAccum && length) {
  1824. accumulator = array[++index];
  1825. }
  1826. while (++index < length) {
  1827. accumulator = iteratee(accumulator, array[index], index, array);
  1828. }
  1829. return accumulator;
  1830. }
  1831. /**
  1832. * A specialized version of `_.reduceRight` for arrays without support for
  1833. * iteratee shorthands.
  1834. *
  1835. * @private
  1836. * @param {Array} [array] The array to iterate over.
  1837. * @param {Function} iteratee The function invoked per iteration.
  1838. * @param {*} [accumulator] The initial value.
  1839. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1840. * the initial value.
  1841. * @returns {*} Returns the accumulated value.
  1842. */
  1843. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1844. var length = array == null ? 0 : array.length;
  1845. if (initAccum && length) {
  1846. accumulator = array[--length];
  1847. }
  1848. while (length--) {
  1849. accumulator = iteratee(accumulator, array[length], length, array);
  1850. }
  1851. return accumulator;
  1852. }
  1853. /**
  1854. * A specialized version of `_.some` for arrays without support for iteratee
  1855. * shorthands.
  1856. *
  1857. * @private
  1858. * @param {Array} [array] The array to iterate over.
  1859. * @param {Function} predicate The function invoked per iteration.
  1860. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1861. * else `false`.
  1862. */
  1863. function arraySome(array, predicate) {
  1864. var index = -1,
  1865. length = array == null ? 0 : array.length;
  1866. while (++index < length) {
  1867. if (predicate(array[index], index, array)) {
  1868. return true;
  1869. }
  1870. }
  1871. return false;
  1872. }
  1873. /**
  1874. * Gets the size of an ASCII `string`.
  1875. *
  1876. * @private
  1877. * @param {string} string The string inspect.
  1878. * @returns {number} Returns the string size.
  1879. */
  1880. var asciiSize = baseProperty('length');
  1881. /**
  1882. * Converts an ASCII `string` to an array.
  1883. *
  1884. * @private
  1885. * @param {string} string The string to convert.
  1886. * @returns {Array} Returns the converted array.
  1887. */
  1888. function asciiToArray(string) {
  1889. return string.split('');
  1890. }
  1891. /**
  1892. * Splits an ASCII `string` into an array of its words.
  1893. *
  1894. * @private
  1895. * @param {string} The string to inspect.
  1896. * @returns {Array} Returns the words of `string`.
  1897. */
  1898. function asciiWords(string) {
  1899. return string.match(reAsciiWord) || [];
  1900. }
  1901. /**
  1902. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1903. * without support for iteratee shorthands, which iterates over `collection`
  1904. * using `eachFunc`.
  1905. *
  1906. * @private
  1907. * @param {Array|Object} collection The collection to inspect.
  1908. * @param {Function} predicate The function invoked per iteration.
  1909. * @param {Function} eachFunc The function to iterate over `collection`.
  1910. * @returns {*} Returns the found element or its key, else `undefined`.
  1911. */
  1912. function baseFindKey(collection, predicate, eachFunc) {
  1913. var result;
  1914. eachFunc(collection, function(value, key, collection) {
  1915. if (predicate(value, key, collection)) {
  1916. result = key;
  1917. return false;
  1918. }
  1919. });
  1920. return result;
  1921. }
  1922. /**
  1923. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1924. * support for iteratee shorthands.
  1925. *
  1926. * @private
  1927. * @param {Array} array The array to inspect.
  1928. * @param {Function} predicate The function invoked per iteration.
  1929. * @param {number} fromIndex The index to search from.
  1930. * @param {boolean} [fromRight] Specify iterating from right to left.
  1931. * @returns {number} Returns the index of the matched value, else `-1`.
  1932. */
  1933. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1934. var length = array.length,
  1935. index = fromIndex + (fromRight ? 1 : -1);
  1936. while ((fromRight ? index-- : ++index < length)) {
  1937. if (predicate(array[index], index, array)) {
  1938. return index;
  1939. }
  1940. }
  1941. return -1;
  1942. }
  1943. /**
  1944. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1945. *
  1946. * @private
  1947. * @param {Array} array The array to inspect.
  1948. * @param {*} value The value to search for.
  1949. * @param {number} fromIndex The index to search from.
  1950. * @returns {number} Returns the index of the matched value, else `-1`.
  1951. */
  1952. function baseIndexOf(array, value, fromIndex) {
  1953. return value === value
  1954. ? strictIndexOf(array, value, fromIndex)
  1955. : baseFindIndex(array, baseIsNaN, fromIndex);
  1956. }
  1957. /**
  1958. * This function is like `baseIndexOf` except that it accepts a comparator.
  1959. *
  1960. * @private
  1961. * @param {Array} array The array to inspect.
  1962. * @param {*} value The value to search for.
  1963. * @param {number} fromIndex The index to search from.
  1964. * @param {Function} comparator The comparator invoked per element.
  1965. * @returns {number} Returns the index of the matched value, else `-1`.
  1966. */
  1967. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1968. var index = fromIndex - 1,
  1969. length = array.length;
  1970. while (++index < length) {
  1971. if (comparator(array[index], value)) {
  1972. return index;
  1973. }
  1974. }
  1975. return -1;
  1976. }
  1977. /**
  1978. * The base implementation of `_.isNaN` without support for number objects.
  1979. *
  1980. * @private
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1983. */
  1984. function baseIsNaN(value) {
  1985. return value !== value;
  1986. }
  1987. /**
  1988. * The base implementation of `_.mean` and `_.meanBy` without support for
  1989. * iteratee shorthands.
  1990. *
  1991. * @private
  1992. * @param {Array} array The array to iterate over.
  1993. * @param {Function} iteratee The function invoked per iteration.
  1994. * @returns {number} Returns the mean.
  1995. */
  1996. function baseMean(array, iteratee) {
  1997. var length = array == null ? 0 : array.length;
  1998. return length ? (baseSum(array, iteratee) / length) : NAN;
  1999. }
  2000. /**
  2001. * The base implementation of `_.property` without support for deep paths.
  2002. *
  2003. * @private
  2004. * @param {string} key The key of the property to get.
  2005. * @returns {Function} Returns the new accessor function.
  2006. */
  2007. function baseProperty(key) {
  2008. return function(object) {
  2009. return object == null ? undefined : object[key];
  2010. };
  2011. }
  2012. /**
  2013. * The base implementation of `_.propertyOf` without support for deep paths.
  2014. *
  2015. * @private
  2016. * @param {Object} object The object to query.
  2017. * @returns {Function} Returns the new accessor function.
  2018. */
  2019. function basePropertyOf(object) {
  2020. return function(key) {
  2021. return object == null ? undefined : object[key];
  2022. };
  2023. }
  2024. /**
  2025. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2026. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2027. *
  2028. * @private
  2029. * @param {Array|Object} collection The collection to iterate over.
  2030. * @param {Function} iteratee The function invoked per iteration.
  2031. * @param {*} accumulator The initial value.
  2032. * @param {boolean} initAccum Specify using the first or last element of
  2033. * `collection` as the initial value.
  2034. * @param {Function} eachFunc The function to iterate over `collection`.
  2035. * @returns {*} Returns the accumulated value.
  2036. */
  2037. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2038. eachFunc(collection, function(value, index, collection) {
  2039. accumulator = initAccum
  2040. ? (initAccum = false, value)
  2041. : iteratee(accumulator, value, index, collection);
  2042. });
  2043. return accumulator;
  2044. }
  2045. /**
  2046. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2047. * sort order of `array` and replaces criteria objects with their corresponding
  2048. * values.
  2049. *
  2050. * @private
  2051. * @param {Array} array The array to sort.
  2052. * @param {Function} comparer The function to define sort order.
  2053. * @returns {Array} Returns `array`.
  2054. */
  2055. function baseSortBy(array, comparer) {
  2056. var length = array.length;
  2057. array.sort(comparer);
  2058. while (length--) {
  2059. array[length] = array[length].value;
  2060. }
  2061. return array;
  2062. }
  2063. /**
  2064. * The base implementation of `_.sum` and `_.sumBy` without support for
  2065. * iteratee shorthands.
  2066. *
  2067. * @private
  2068. * @param {Array} array The array to iterate over.
  2069. * @param {Function} iteratee The function invoked per iteration.
  2070. * @returns {number} Returns the sum.
  2071. */
  2072. function baseSum(array, iteratee) {
  2073. var result,
  2074. index = -1,
  2075. length = array.length;
  2076. while (++index < length) {
  2077. var current = iteratee(array[index]);
  2078. if (current !== undefined) {
  2079. result = result === undefined ? current : (result + current);
  2080. }
  2081. }
  2082. return result;
  2083. }
  2084. /**
  2085. * The base implementation of `_.times` without support for iteratee shorthands
  2086. * or max array length checks.
  2087. *
  2088. * @private
  2089. * @param {number} n The number of times to invoke `iteratee`.
  2090. * @param {Function} iteratee The function invoked per iteration.
  2091. * @returns {Array} Returns the array of results.
  2092. */
  2093. function baseTimes(n, iteratee) {
  2094. var index = -1,
  2095. result = Array(n);
  2096. while (++index < n) {
  2097. result[index] = iteratee(index);
  2098. }
  2099. return result;
  2100. }
  2101. /**
  2102. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2103. * of key-value pairs for `object` corresponding to the property names of `props`.
  2104. *
  2105. * @private
  2106. * @param {Object} object The object to query.
  2107. * @param {Array} props The property names to get values for.
  2108. * @returns {Object} Returns the key-value pairs.
  2109. */
  2110. function baseToPairs(object, props) {
  2111. return arrayMap(props, function(key) {
  2112. return [key, object[key]];
  2113. });
  2114. }
  2115. /**
  2116. * The base implementation of `_.trim`.
  2117. *
  2118. * @private
  2119. * @param {string} string The string to trim.
  2120. * @returns {string} Returns the trimmed string.
  2121. */
  2122. function baseTrim(string) {
  2123. return string
  2124. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2125. : string;
  2126. }
  2127. /**
  2128. * The base implementation of `_.unary` without support for storing metadata.
  2129. *
  2130. * @private
  2131. * @param {Function} func The function to cap arguments for.
  2132. * @returns {Function} Returns the new capped function.
  2133. */
  2134. function baseUnary(func) {
  2135. return function(value) {
  2136. return func(value);
  2137. };
  2138. }
  2139. /**
  2140. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2141. * array of `object` property values corresponding to the property names
  2142. * of `props`.
  2143. *
  2144. * @private
  2145. * @param {Object} object The object to query.
  2146. * @param {Array} props The property names to get values for.
  2147. * @returns {Object} Returns the array of property values.
  2148. */
  2149. function baseValues(object, props) {
  2150. return arrayMap(props, function(key) {
  2151. return object[key];
  2152. });
  2153. }
  2154. /**
  2155. * Checks if a `cache` value for `key` exists.
  2156. *
  2157. * @private
  2158. * @param {Object} cache The cache to query.
  2159. * @param {string} key The key of the entry to check.
  2160. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2161. */
  2162. function cacheHas(cache, key) {
  2163. return cache.has(key);
  2164. }
  2165. /**
  2166. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2167. * that is not found in the character symbols.
  2168. *
  2169. * @private
  2170. * @param {Array} strSymbols The string symbols to inspect.
  2171. * @param {Array} chrSymbols The character symbols to find.
  2172. * @returns {number} Returns the index of the first unmatched string symbol.
  2173. */
  2174. function charsStartIndex(strSymbols, chrSymbols) {
  2175. var index = -1,
  2176. length = strSymbols.length;
  2177. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2178. return index;
  2179. }
  2180. /**
  2181. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2182. * that is not found in the character symbols.
  2183. *
  2184. * @private
  2185. * @param {Array} strSymbols The string symbols to inspect.
  2186. * @param {Array} chrSymbols The character symbols to find.
  2187. * @returns {number} Returns the index of the last unmatched string symbol.
  2188. */
  2189. function charsEndIndex(strSymbols, chrSymbols) {
  2190. var index = strSymbols.length;
  2191. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2192. return index;
  2193. }
  2194. /**
  2195. * Gets the number of `placeholder` occurrences in `array`.
  2196. *
  2197. * @private
  2198. * @param {Array} array The array to inspect.
  2199. * @param {*} placeholder The placeholder to search for.
  2200. * @returns {number} Returns the placeholder count.
  2201. */
  2202. function countHolders(array, placeholder) {
  2203. var length = array.length,
  2204. result = 0;
  2205. while (length--) {
  2206. if (array[length] === placeholder) {
  2207. ++result;
  2208. }
  2209. }
  2210. return result;
  2211. }
  2212. /**
  2213. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2214. * letters to basic Latin letters.
  2215. *
  2216. * @private
  2217. * @param {string} letter The matched letter to deburr.
  2218. * @returns {string} Returns the deburred letter.
  2219. */
  2220. var deburrLetter = basePropertyOf(deburredLetters);
  2221. /**
  2222. * Used by `_.escape` to convert characters to HTML entities.
  2223. *
  2224. * @private
  2225. * @param {string} chr The matched character to escape.
  2226. * @returns {string} Returns the escaped character.
  2227. */
  2228. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2229. /**
  2230. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2231. *
  2232. * @private
  2233. * @param {string} chr The matched character to escape.
  2234. * @returns {string} Returns the escaped character.
  2235. */
  2236. function escapeStringChar(chr) {
  2237. return '\\' + stringEscapes[chr];
  2238. }
  2239. /**
  2240. * Gets the value at `key` of `object`.
  2241. *
  2242. * @private
  2243. * @param {Object} [object] The object to query.
  2244. * @param {string} key The key of the property to get.
  2245. * @returns {*} Returns the property value.
  2246. */
  2247. function getValue(object, key) {
  2248. return object == null ? undefined : object[key];
  2249. }
  2250. /**
  2251. * Checks if `string` contains Unicode symbols.
  2252. *
  2253. * @private
  2254. * @param {string} string The string to inspect.
  2255. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2256. */
  2257. function hasUnicode(string) {
  2258. return reHasUnicode.test(string);
  2259. }
  2260. /**
  2261. * Checks if `string` contains a word composed of Unicode symbols.
  2262. *
  2263. * @private
  2264. * @param {string} string The string to inspect.
  2265. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2266. */
  2267. function hasUnicodeWord(string) {
  2268. return reHasUnicodeWord.test(string);
  2269. }
  2270. /**
  2271. * Converts `iterator` to an array.
  2272. *
  2273. * @private
  2274. * @param {Object} iterator The iterator to convert.
  2275. * @returns {Array} Returns the converted array.
  2276. */
  2277. function iteratorToArray(iterator) {
  2278. var data,
  2279. result = [];
  2280. while (!(data = iterator.next()).done) {
  2281. result.push(data.value);
  2282. }
  2283. return result;
  2284. }
  2285. /**
  2286. * Converts `map` to its key-value pairs.
  2287. *
  2288. * @private
  2289. * @param {Object} map The map to convert.
  2290. * @returns {Array} Returns the key-value pairs.
  2291. */
  2292. function mapToArray(map) {
  2293. var index = -1,
  2294. result = Array(map.size);
  2295. map.forEach(function(value, key) {
  2296. result[++index] = [key, value];
  2297. });
  2298. return result;
  2299. }
  2300. /**
  2301. * Creates a unary function that invokes `func` with its argument transformed.
  2302. *
  2303. * @private
  2304. * @param {Function} func The function to wrap.
  2305. * @param {Function} transform The argument transform.
  2306. * @returns {Function} Returns the new function.
  2307. */
  2308. function overArg(func, transform) {
  2309. return function(arg) {
  2310. return func(transform(arg));
  2311. };
  2312. }
  2313. /**
  2314. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2315. * and returns an array of their indexes.
  2316. *
  2317. * @private
  2318. * @param {Array} array The array to modify.
  2319. * @param {*} placeholder The placeholder to replace.
  2320. * @returns {Array} Returns the new array of placeholder indexes.
  2321. */
  2322. function replaceHolders(array, placeholder) {
  2323. var index = -1,
  2324. length = array.length,
  2325. resIndex = 0,
  2326. result = [];
  2327. while (++index < length) {
  2328. var value = array[index];
  2329. if (value === placeholder || value === PLACEHOLDER) {
  2330. array[index] = PLACEHOLDER;
  2331. result[resIndex++] = index;
  2332. }
  2333. }
  2334. return result;
  2335. }
  2336. /**
  2337. * Converts `set` to an array of its values.
  2338. *
  2339. * @private
  2340. * @param {Object} set The set to convert.
  2341. * @returns {Array} Returns the values.
  2342. */
  2343. function setToArray(set) {
  2344. var index = -1,
  2345. result = Array(set.size);
  2346. set.forEach(function(value) {
  2347. result[++index] = value;
  2348. });
  2349. return result;
  2350. }
  2351. /**
  2352. * Converts `set` to its value-value pairs.
  2353. *
  2354. * @private
  2355. * @param {Object} set The set to convert.
  2356. * @returns {Array} Returns the value-value pairs.
  2357. */
  2358. function setToPairs(set) {
  2359. var index = -1,
  2360. result = Array(set.size);
  2361. set.forEach(function(value) {
  2362. result[++index] = [value, value];
  2363. });
  2364. return result;
  2365. }
  2366. /**
  2367. * A specialized version of `_.indexOf` which performs strict equality
  2368. * comparisons of values, i.e. `===`.
  2369. *
  2370. * @private
  2371. * @param {Array} array The array to inspect.
  2372. * @param {*} value The value to search for.
  2373. * @param {number} fromIndex The index to search from.
  2374. * @returns {number} Returns the index of the matched value, else `-1`.
  2375. */
  2376. function strictIndexOf(array, value, fromIndex) {
  2377. var index = fromIndex - 1,
  2378. length = array.length;
  2379. while (++index < length) {
  2380. if (array[index] === value) {
  2381. return index;
  2382. }
  2383. }
  2384. return -1;
  2385. }
  2386. /**
  2387. * A specialized version of `_.lastIndexOf` which performs strict equality
  2388. * comparisons of values, i.e. `===`.
  2389. *
  2390. * @private
  2391. * @param {Array} array The array to inspect.
  2392. * @param {*} value The value to search for.
  2393. * @param {number} fromIndex The index to search from.
  2394. * @returns {number} Returns the index of the matched value, else `-1`.
  2395. */
  2396. function strictLastIndexOf(array, value, fromIndex) {
  2397. var index = fromIndex + 1;
  2398. while (index--) {
  2399. if (array[index] === value) {
  2400. return index;
  2401. }
  2402. }
  2403. return index;
  2404. }
  2405. /**
  2406. * Gets the number of symbols in `string`.
  2407. *
  2408. * @private
  2409. * @param {string} string The string to inspect.
  2410. * @returns {number} Returns the string size.
  2411. */
  2412. function stringSize(string) {
  2413. return hasUnicode(string)
  2414. ? unicodeSize(string)
  2415. : asciiSize(string);
  2416. }
  2417. /**
  2418. * Converts `string` to an array.
  2419. *
  2420. * @private
  2421. * @param {string} string The string to convert.
  2422. * @returns {Array} Returns the converted array.
  2423. */
  2424. function stringToArray(string) {
  2425. return hasUnicode(string)
  2426. ? unicodeToArray(string)
  2427. : asciiToArray(string);
  2428. }
  2429. /**
  2430. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2431. * character of `string`.
  2432. *
  2433. * @private
  2434. * @param {string} string The string to inspect.
  2435. * @returns {number} Returns the index of the last non-whitespace character.
  2436. */
  2437. function trimmedEndIndex(string) {
  2438. var index = string.length;
  2439. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2440. return index;
  2441. }
  2442. /**
  2443. * Used by `_.unescape` to convert HTML entities to characters.
  2444. *
  2445. * @private
  2446. * @param {string} chr The matched character to unescape.
  2447. * @returns {string} Returns the unescaped character.
  2448. */
  2449. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2450. /**
  2451. * Gets the size of a Unicode `string`.
  2452. *
  2453. * @private
  2454. * @param {string} string The string inspect.
  2455. * @returns {number} Returns the string size.
  2456. */
  2457. function unicodeSize(string) {
  2458. var result = reUnicode.lastIndex = 0;
  2459. while (reUnicode.test(string)) {
  2460. ++result;
  2461. }
  2462. return result;
  2463. }
  2464. /**
  2465. * Converts a Unicode `string` to an array.
  2466. *
  2467. * @private
  2468. * @param {string} string The string to convert.
  2469. * @returns {Array} Returns the converted array.
  2470. */
  2471. function unicodeToArray(string) {
  2472. return string.match(reUnicode) || [];
  2473. }
  2474. /**
  2475. * Splits a Unicode `string` into an array of its words.
  2476. *
  2477. * @private
  2478. * @param {string} The string to inspect.
  2479. * @returns {Array} Returns the words of `string`.
  2480. */
  2481. function unicodeWords(string) {
  2482. return string.match(reUnicodeWord) || [];
  2483. }
  2484. /*--------------------------------------------------------------------------*/
  2485. /**
  2486. * Create a new pristine `lodash` function using the `context` object.
  2487. *
  2488. * @static
  2489. * @memberOf _
  2490. * @since 1.1.0
  2491. * @category Util
  2492. * @param {Object} [context=root] The context object.
  2493. * @returns {Function} Returns a new `lodash` function.
  2494. * @example
  2495. *
  2496. * _.mixin({ 'foo': _.constant('foo') });
  2497. *
  2498. * var lodash = _.runInContext();
  2499. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2500. *
  2501. * _.isFunction(_.foo);
  2502. * // => true
  2503. * _.isFunction(_.bar);
  2504. * // => false
  2505. *
  2506. * lodash.isFunction(lodash.foo);
  2507. * // => false
  2508. * lodash.isFunction(lodash.bar);
  2509. * // => true
  2510. *
  2511. * // Create a suped-up `defer` in Node.js.
  2512. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2513. */
  2514. var runInContext = (function runInContext(context) {
  2515. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2516. /** Built-in constructor references. */
  2517. var Array = context.Array,
  2518. Date = context.Date,
  2519. Error = context.Error,
  2520. Function = context.Function,
  2521. Math = context.Math,
  2522. Object = context.Object,
  2523. RegExp = context.RegExp,
  2524. String = context.String,
  2525. TypeError = context.TypeError;
  2526. /** Used for built-in method references. */
  2527. var arrayProto = Array.prototype,
  2528. funcProto = Function.prototype,
  2529. objectProto = Object.prototype;
  2530. /** Used to detect overreaching core-js shims. */
  2531. var coreJsData = context['__core-js_shared__'];
  2532. /** Used to resolve the decompiled source of functions. */
  2533. var funcToString = funcProto.toString;
  2534. /** Used to check objects for own properties. */
  2535. var hasOwnProperty = objectProto.hasOwnProperty;
  2536. /** Used to generate unique IDs. */
  2537. var idCounter = 0;
  2538. /** Used to detect methods masquerading as native. */
  2539. var maskSrcKey = (function() {
  2540. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2541. return uid ? ('Symbol(src)_1.' + uid) : '';
  2542. }());
  2543. /**
  2544. * Used to resolve the
  2545. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2546. * of values.
  2547. */
  2548. var nativeObjectToString = objectProto.toString;
  2549. /** Used to infer the `Object` constructor. */
  2550. var objectCtorString = funcToString.call(Object);
  2551. /** Used to restore the original `_` reference in `_.noConflict`. */
  2552. var oldDash = root._;
  2553. /** Used to detect if a method is native. */
  2554. var reIsNative = RegExp('^' +
  2555. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2556. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2557. );
  2558. /** Built-in value references. */
  2559. var Buffer = moduleExports ? context.Buffer : undefined,
  2560. Symbol = context.Symbol,
  2561. Uint8Array = context.Uint8Array,
  2562. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2563. getPrototype = overArg(Object.getPrototypeOf, Object),
  2564. objectCreate = Object.create,
  2565. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2566. splice = arrayProto.splice,
  2567. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2568. symIterator = Symbol ? Symbol.iterator : undefined,
  2569. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2570. var defineProperty = (function() {
  2571. try {
  2572. var func = getNative(Object, 'defineProperty');
  2573. func({}, '', {});
  2574. return func;
  2575. } catch (e) {}
  2576. }());
  2577. /** Mocked built-ins. */
  2578. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2579. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2580. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2581. /* Built-in method references for those with the same name as other `lodash` methods. */
  2582. var nativeCeil = Math.ceil,
  2583. nativeFloor = Math.floor,
  2584. nativeGetSymbols = Object.getOwnPropertySymbols,
  2585. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2586. nativeIsFinite = context.isFinite,
  2587. nativeJoin = arrayProto.join,
  2588. nativeKeys = overArg(Object.keys, Object),
  2589. nativeMax = Math.max,
  2590. nativeMin = Math.min,
  2591. nativeNow = Date.now,
  2592. nativeParseInt = context.parseInt,
  2593. nativeRandom = Math.random,
  2594. nativeReverse = arrayProto.reverse;
  2595. /* Built-in method references that are verified to be native. */
  2596. var DataView = getNative(context, 'DataView'),
  2597. Map = getNative(context, 'Map'),
  2598. Promise = getNative(context, 'Promise'),
  2599. Set = getNative(context, 'Set'),
  2600. WeakMap = getNative(context, 'WeakMap'),
  2601. nativeCreate = getNative(Object, 'create');
  2602. /** Used to store function metadata. */
  2603. var metaMap = WeakMap && new WeakMap;
  2604. /** Used to lookup unminified function names. */
  2605. var realNames = {};
  2606. /** Used to detect maps, sets, and weakmaps. */
  2607. var dataViewCtorString = toSource(DataView),
  2608. mapCtorString = toSource(Map),
  2609. promiseCtorString = toSource(Promise),
  2610. setCtorString = toSource(Set),
  2611. weakMapCtorString = toSource(WeakMap);
  2612. /** Used to convert symbols to primitives and strings. */
  2613. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2614. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2615. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2616. /*------------------------------------------------------------------------*/
  2617. /**
  2618. * Creates a `lodash` object which wraps `value` to enable implicit method
  2619. * chain sequences. Methods that operate on and return arrays, collections,
  2620. * and functions can be chained together. Methods that retrieve a single value
  2621. * or may return a primitive value will automatically end the chain sequence
  2622. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2623. * with `_#value`.
  2624. *
  2625. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2626. * enabled using `_.chain`.
  2627. *
  2628. * The execution of chained methods is lazy, that is, it's deferred until
  2629. * `_#value` is implicitly or explicitly called.
  2630. *
  2631. * Lazy evaluation allows several methods to support shortcut fusion.
  2632. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2633. * the creation of intermediate arrays and can greatly reduce the number of
  2634. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2635. * fusion if the section is applied to an array and iteratees accept only
  2636. * one argument. The heuristic for whether a section qualifies for shortcut
  2637. * fusion is subject to change.
  2638. *
  2639. * Chaining is supported in custom builds as long as the `_#value` method is
  2640. * directly or indirectly included in the build.
  2641. *
  2642. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2643. *
  2644. * The wrapper `Array` methods are:
  2645. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2646. *
  2647. * The wrapper `String` methods are:
  2648. * `replace` and `split`
  2649. *
  2650. * The wrapper methods that support shortcut fusion are:
  2651. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2652. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2653. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2654. *
  2655. * The chainable wrapper methods are:
  2656. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2657. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2658. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2659. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2660. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2661. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2662. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2663. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2664. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2665. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2666. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2667. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2668. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2669. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2670. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2671. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2672. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2673. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2674. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2675. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2676. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2677. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2678. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2679. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2680. *
  2681. * The wrapper methods that are **not** chainable by default are:
  2682. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2683. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2684. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2685. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2686. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2687. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2688. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2689. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2690. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2691. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2692. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2693. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2694. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2695. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2696. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2697. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2698. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2699. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2700. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2701. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2702. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2703. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2704. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2705. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2706. * `upperFirst`, `value`, and `words`
  2707. *
  2708. * @name _
  2709. * @constructor
  2710. * @category Seq
  2711. * @param {*} value The value to wrap in a `lodash` instance.
  2712. * @returns {Object} Returns the new `lodash` wrapper instance.
  2713. * @example
  2714. *
  2715. * function square(n) {
  2716. * return n * n;
  2717. * }
  2718. *
  2719. * var wrapped = _([1, 2, 3]);
  2720. *
  2721. * // Returns an unwrapped value.
  2722. * wrapped.reduce(_.add);
  2723. * // => 6
  2724. *
  2725. * // Returns a wrapped value.
  2726. * var squares = wrapped.map(square);
  2727. *
  2728. * _.isArray(squares);
  2729. * // => false
  2730. *
  2731. * _.isArray(squares.value());
  2732. * // => true
  2733. */
  2734. function lodash(value) {
  2735. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2736. if (value instanceof LodashWrapper) {
  2737. return value;
  2738. }
  2739. if (hasOwnProperty.call(value, '__wrapped__')) {
  2740. return wrapperClone(value);
  2741. }
  2742. }
  2743. return new LodashWrapper(value);
  2744. }
  2745. /**
  2746. * The base implementation of `_.create` without support for assigning
  2747. * properties to the created object.
  2748. *
  2749. * @private
  2750. * @param {Object} proto The object to inherit from.
  2751. * @returns {Object} Returns the new object.
  2752. */
  2753. var baseCreate = (function() {
  2754. function object() {}
  2755. return function(proto) {
  2756. if (!isObject(proto)) {
  2757. return {};
  2758. }
  2759. if (objectCreate) {
  2760. return objectCreate(proto);
  2761. }
  2762. object.prototype = proto;
  2763. var result = new object;
  2764. object.prototype = undefined;
  2765. return result;
  2766. };
  2767. }());
  2768. /**
  2769. * The function whose prototype chain sequence wrappers inherit from.
  2770. *
  2771. * @private
  2772. */
  2773. function baseLodash() {
  2774. // No operation performed.
  2775. }
  2776. /**
  2777. * The base constructor for creating `lodash` wrapper objects.
  2778. *
  2779. * @private
  2780. * @param {*} value The value to wrap.
  2781. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2782. */
  2783. function LodashWrapper(value, chainAll) {
  2784. this.__wrapped__ = value;
  2785. this.__actions__ = [];
  2786. this.__chain__ = !!chainAll;
  2787. this.__index__ = 0;
  2788. this.__values__ = undefined;
  2789. }
  2790. /**
  2791. * By default, the template delimiters used by lodash are like those in
  2792. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2793. * following template settings to use alternative delimiters.
  2794. *
  2795. * @static
  2796. * @memberOf _
  2797. * @type {Object}
  2798. */
  2799. lodash.templateSettings = {
  2800. /**
  2801. * Used to detect `data` property values to be HTML-escaped.
  2802. *
  2803. * @memberOf _.templateSettings
  2804. * @type {RegExp}
  2805. */
  2806. 'escape': reEscape,
  2807. /**
  2808. * Used to detect code to be evaluated.
  2809. *
  2810. * @memberOf _.templateSettings
  2811. * @type {RegExp}
  2812. */
  2813. 'evaluate': reEvaluate,
  2814. /**
  2815. * Used to detect `data` property values to inject.
  2816. *
  2817. * @memberOf _.templateSettings
  2818. * @type {RegExp}
  2819. */
  2820. 'interpolate': reInterpolate,
  2821. /**
  2822. * Used to reference the data object in the template text.
  2823. *
  2824. * @memberOf _.templateSettings
  2825. * @type {string}
  2826. */
  2827. 'variable': '',
  2828. /**
  2829. * Used to import variables into the compiled template.
  2830. *
  2831. * @memberOf _.templateSettings
  2832. * @type {Object}
  2833. */
  2834. 'imports': {
  2835. /**
  2836. * A reference to the `lodash` function.
  2837. *
  2838. * @memberOf _.templateSettings.imports
  2839. * @type {Function}
  2840. */
  2841. '_': lodash
  2842. }
  2843. };
  2844. // Ensure wrappers are instances of `baseLodash`.
  2845. lodash.prototype = baseLodash.prototype;
  2846. lodash.prototype.constructor = lodash;
  2847. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2848. LodashWrapper.prototype.constructor = LodashWrapper;
  2849. /*------------------------------------------------------------------------*/
  2850. /**
  2851. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2852. *
  2853. * @private
  2854. * @constructor
  2855. * @param {*} value The value to wrap.
  2856. */
  2857. function LazyWrapper(value) {
  2858. this.__wrapped__ = value;
  2859. this.__actions__ = [];
  2860. this.__dir__ = 1;
  2861. this.__filtered__ = false;
  2862. this.__iteratees__ = [];
  2863. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2864. this.__views__ = [];
  2865. }
  2866. /**
  2867. * Creates a clone of the lazy wrapper object.
  2868. *
  2869. * @private
  2870. * @name clone
  2871. * @memberOf LazyWrapper
  2872. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2873. */
  2874. function lazyClone() {
  2875. var result = new LazyWrapper(this.__wrapped__);
  2876. result.__actions__ = copyArray(this.__actions__);
  2877. result.__dir__ = this.__dir__;
  2878. result.__filtered__ = this.__filtered__;
  2879. result.__iteratees__ = copyArray(this.__iteratees__);
  2880. result.__takeCount__ = this.__takeCount__;
  2881. result.__views__ = copyArray(this.__views__);
  2882. return result;
  2883. }
  2884. /**
  2885. * Reverses the direction of lazy iteration.
  2886. *
  2887. * @private
  2888. * @name reverse
  2889. * @memberOf LazyWrapper
  2890. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2891. */
  2892. function lazyReverse() {
  2893. if (this.__filtered__) {
  2894. var result = new LazyWrapper(this);
  2895. result.__dir__ = -1;
  2896. result.__filtered__ = true;
  2897. } else {
  2898. result = this.clone();
  2899. result.__dir__ *= -1;
  2900. }
  2901. return result;
  2902. }
  2903. /**
  2904. * Extracts the unwrapped value from its lazy wrapper.
  2905. *
  2906. * @private
  2907. * @name value
  2908. * @memberOf LazyWrapper
  2909. * @returns {*} Returns the unwrapped value.
  2910. */
  2911. function lazyValue() {
  2912. var array = this.__wrapped__.value(),
  2913. dir = this.__dir__,
  2914. isArr = isArray(array),
  2915. isRight = dir < 0,
  2916. arrLength = isArr ? array.length : 0,
  2917. view = getView(0, arrLength, this.__views__),
  2918. start = view.start,
  2919. end = view.end,
  2920. length = end - start,
  2921. index = isRight ? end : (start - 1),
  2922. iteratees = this.__iteratees__,
  2923. iterLength = iteratees.length,
  2924. resIndex = 0,
  2925. takeCount = nativeMin(length, this.__takeCount__);
  2926. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2927. return baseWrapperValue(array, this.__actions__);
  2928. }
  2929. var result = [];
  2930. outer:
  2931. while (length-- && resIndex < takeCount) {
  2932. index += dir;
  2933. var iterIndex = -1,
  2934. value = array[index];
  2935. while (++iterIndex < iterLength) {
  2936. var data = iteratees[iterIndex],
  2937. iteratee = data.iteratee,
  2938. type = data.type,
  2939. computed = iteratee(value);
  2940. if (type == LAZY_MAP_FLAG) {
  2941. value = computed;
  2942. } else if (!computed) {
  2943. if (type == LAZY_FILTER_FLAG) {
  2944. continue outer;
  2945. } else {
  2946. break outer;
  2947. }
  2948. }
  2949. }
  2950. result[resIndex++] = value;
  2951. }
  2952. return result;
  2953. }
  2954. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2955. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2956. LazyWrapper.prototype.constructor = LazyWrapper;
  2957. /*------------------------------------------------------------------------*/
  2958. /**
  2959. * Creates a hash object.
  2960. *
  2961. * @private
  2962. * @constructor
  2963. * @param {Array} [entries] The key-value pairs to cache.
  2964. */
  2965. function Hash(entries) {
  2966. var index = -1,
  2967. length = entries == null ? 0 : entries.length;
  2968. this.clear();
  2969. while (++index < length) {
  2970. var entry = entries[index];
  2971. this.set(entry[0], entry[1]);
  2972. }
  2973. }
  2974. /**
  2975. * Removes all key-value entries from the hash.
  2976. *
  2977. * @private
  2978. * @name clear
  2979. * @memberOf Hash
  2980. */
  2981. function hashClear() {
  2982. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2983. this.size = 0;
  2984. }
  2985. /**
  2986. * Removes `key` and its value from the hash.
  2987. *
  2988. * @private
  2989. * @name delete
  2990. * @memberOf Hash
  2991. * @param {Object} hash The hash to modify.
  2992. * @param {string} key The key of the value to remove.
  2993. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2994. */
  2995. function hashDelete(key) {
  2996. var result = this.has(key) && delete this.__data__[key];
  2997. this.size -= result ? 1 : 0;
  2998. return result;
  2999. }
  3000. /**
  3001. * Gets the hash value for `key`.
  3002. *
  3003. * @private
  3004. * @name get
  3005. * @memberOf Hash
  3006. * @param {string} key The key of the value to get.
  3007. * @returns {*} Returns the entry value.
  3008. */
  3009. function hashGet(key) {
  3010. var data = this.__data__;
  3011. if (nativeCreate) {
  3012. var result = data[key];
  3013. return result === HASH_UNDEFINED ? undefined : result;
  3014. }
  3015. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3016. }
  3017. /**
  3018. * Checks if a hash value for `key` exists.
  3019. *
  3020. * @private
  3021. * @name has
  3022. * @memberOf Hash
  3023. * @param {string} key The key of the entry to check.
  3024. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3025. */
  3026. function hashHas(key) {
  3027. var data = this.__data__;
  3028. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3029. }
  3030. /**
  3031. * Sets the hash `key` to `value`.
  3032. *
  3033. * @private
  3034. * @name set
  3035. * @memberOf Hash
  3036. * @param {string} key The key of the value to set.
  3037. * @param {*} value The value to set.
  3038. * @returns {Object} Returns the hash instance.
  3039. */
  3040. function hashSet(key, value) {
  3041. var data = this.__data__;
  3042. this.size += this.has(key) ? 0 : 1;
  3043. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3044. return this;
  3045. }
  3046. // Add methods to `Hash`.
  3047. Hash.prototype.clear = hashClear;
  3048. Hash.prototype['delete'] = hashDelete;
  3049. Hash.prototype.get = hashGet;
  3050. Hash.prototype.has = hashHas;
  3051. Hash.prototype.set = hashSet;
  3052. /*------------------------------------------------------------------------*/
  3053. /**
  3054. * Creates an list cache object.
  3055. *
  3056. * @private
  3057. * @constructor
  3058. * @param {Array} [entries] The key-value pairs to cache.
  3059. */
  3060. function ListCache(entries) {
  3061. var index = -1,
  3062. length = entries == null ? 0 : entries.length;
  3063. this.clear();
  3064. while (++index < length) {
  3065. var entry = entries[index];
  3066. this.set(entry[0], entry[1]);
  3067. }
  3068. }
  3069. /**
  3070. * Removes all key-value entries from the list cache.
  3071. *
  3072. * @private
  3073. * @name clear
  3074. * @memberOf ListCache
  3075. */
  3076. function listCacheClear() {
  3077. this.__data__ = [];
  3078. this.size = 0;
  3079. }
  3080. /**
  3081. * Removes `key` and its value from the list cache.
  3082. *
  3083. * @private
  3084. * @name delete
  3085. * @memberOf ListCache
  3086. * @param {string} key The key of the value to remove.
  3087. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3088. */
  3089. function listCacheDelete(key) {
  3090. var data = this.__data__,
  3091. index = assocIndexOf(data, key);
  3092. if (index < 0) {
  3093. return false;
  3094. }
  3095. var lastIndex = data.length - 1;
  3096. if (index == lastIndex) {
  3097. data.pop();
  3098. } else {
  3099. splice.call(data, index, 1);
  3100. }
  3101. --this.size;
  3102. return true;
  3103. }
  3104. /**
  3105. * Gets the list cache value for `key`.
  3106. *
  3107. * @private
  3108. * @name get
  3109. * @memberOf ListCache
  3110. * @param {string} key The key of the value to get.
  3111. * @returns {*} Returns the entry value.
  3112. */
  3113. function listCacheGet(key) {
  3114. var data = this.__data__,
  3115. index = assocIndexOf(data, key);
  3116. return index < 0 ? undefined : data[index][1];
  3117. }
  3118. /**
  3119. * Checks if a list cache value for `key` exists.
  3120. *
  3121. * @private
  3122. * @name has
  3123. * @memberOf ListCache
  3124. * @param {string} key The key of the entry to check.
  3125. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3126. */
  3127. function listCacheHas(key) {
  3128. return assocIndexOf(this.__data__, key) > -1;
  3129. }
  3130. /**
  3131. * Sets the list cache `key` to `value`.
  3132. *
  3133. * @private
  3134. * @name set
  3135. * @memberOf ListCache
  3136. * @param {string} key The key of the value to set.
  3137. * @param {*} value The value to set.
  3138. * @returns {Object} Returns the list cache instance.
  3139. */
  3140. function listCacheSet(key, value) {
  3141. var data = this.__data__,
  3142. index = assocIndexOf(data, key);
  3143. if (index < 0) {
  3144. ++this.size;
  3145. data.push([key, value]);
  3146. } else {
  3147. data[index][1] = value;
  3148. }
  3149. return this;
  3150. }
  3151. // Add methods to `ListCache`.
  3152. ListCache.prototype.clear = listCacheClear;
  3153. ListCache.prototype['delete'] = listCacheDelete;
  3154. ListCache.prototype.get = listCacheGet;
  3155. ListCache.prototype.has = listCacheHas;
  3156. ListCache.prototype.set = listCacheSet;
  3157. /*------------------------------------------------------------------------*/
  3158. /**
  3159. * Creates a map cache object to store key-value pairs.
  3160. *
  3161. * @private
  3162. * @constructor
  3163. * @param {Array} [entries] The key-value pairs to cache.
  3164. */
  3165. function MapCache(entries) {
  3166. var index = -1,
  3167. length = entries == null ? 0 : entries.length;
  3168. this.clear();
  3169. while (++index < length) {
  3170. var entry = entries[index];
  3171. this.set(entry[0], entry[1]);
  3172. }
  3173. }
  3174. /**
  3175. * Removes all key-value entries from the map.
  3176. *
  3177. * @private
  3178. * @name clear
  3179. * @memberOf MapCache
  3180. */
  3181. function mapCacheClear() {
  3182. this.size = 0;
  3183. this.__data__ = {
  3184. 'hash': new Hash,
  3185. 'map': new (Map || ListCache),
  3186. 'string': new Hash
  3187. };
  3188. }
  3189. /**
  3190. * Removes `key` and its value from the map.
  3191. *
  3192. * @private
  3193. * @name delete
  3194. * @memberOf MapCache
  3195. * @param {string} key The key of the value to remove.
  3196. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3197. */
  3198. function mapCacheDelete(key) {
  3199. var result = getMapData(this, key)['delete'](key);
  3200. this.size -= result ? 1 : 0;
  3201. return result;
  3202. }
  3203. /**
  3204. * Gets the map value for `key`.
  3205. *
  3206. * @private
  3207. * @name get
  3208. * @memberOf MapCache
  3209. * @param {string} key The key of the value to get.
  3210. * @returns {*} Returns the entry value.
  3211. */
  3212. function mapCacheGet(key) {
  3213. return getMapData(this, key).get(key);
  3214. }
  3215. /**
  3216. * Checks if a map value for `key` exists.
  3217. *
  3218. * @private
  3219. * @name has
  3220. * @memberOf MapCache
  3221. * @param {string} key The key of the entry to check.
  3222. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3223. */
  3224. function mapCacheHas(key) {
  3225. return getMapData(this, key).has(key);
  3226. }
  3227. /**
  3228. * Sets the map `key` to `value`.
  3229. *
  3230. * @private
  3231. * @name set
  3232. * @memberOf MapCache
  3233. * @param {string} key The key of the value to set.
  3234. * @param {*} value The value to set.
  3235. * @returns {Object} Returns the map cache instance.
  3236. */
  3237. function mapCacheSet(key, value) {
  3238. var data = getMapData(this, key),
  3239. size = data.size;
  3240. data.set(key, value);
  3241. this.size += data.size == size ? 0 : 1;
  3242. return this;
  3243. }
  3244. // Add methods to `MapCache`.
  3245. MapCache.prototype.clear = mapCacheClear;
  3246. MapCache.prototype['delete'] = mapCacheDelete;
  3247. MapCache.prototype.get = mapCacheGet;
  3248. MapCache.prototype.has = mapCacheHas;
  3249. MapCache.prototype.set = mapCacheSet;
  3250. /*------------------------------------------------------------------------*/
  3251. /**
  3252. *
  3253. * Creates an array cache object to store unique values.
  3254. *
  3255. * @private
  3256. * @constructor
  3257. * @param {Array} [values] The values to cache.
  3258. */
  3259. function SetCache(values) {
  3260. var index = -1,
  3261. length = values == null ? 0 : values.length;
  3262. this.__data__ = new MapCache;
  3263. while (++index < length) {
  3264. this.add(values[index]);
  3265. }
  3266. }
  3267. /**
  3268. * Adds `value` to the array cache.
  3269. *
  3270. * @private
  3271. * @name add
  3272. * @memberOf SetCache
  3273. * @alias push
  3274. * @param {*} value The value to cache.
  3275. * @returns {Object} Returns the cache instance.
  3276. */
  3277. function setCacheAdd(value) {
  3278. this.__data__.set(value, HASH_UNDEFINED);
  3279. return this;
  3280. }
  3281. /**
  3282. * Checks if `value` is in the array cache.
  3283. *
  3284. * @private
  3285. * @name has
  3286. * @memberOf SetCache
  3287. * @param {*} value The value to search for.
  3288. * @returns {number} Returns `true` if `value` is found, else `false`.
  3289. */
  3290. function setCacheHas(value) {
  3291. return this.__data__.has(value);
  3292. }
  3293. // Add methods to `SetCache`.
  3294. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3295. SetCache.prototype.has = setCacheHas;
  3296. /*------------------------------------------------------------------------*/
  3297. /**
  3298. * Creates a stack cache object to store key-value pairs.
  3299. *
  3300. * @private
  3301. * @constructor
  3302. * @param {Array} [entries] The key-value pairs to cache.
  3303. */
  3304. function Stack(entries) {
  3305. var data = this.__data__ = new ListCache(entries);
  3306. this.size = data.size;
  3307. }
  3308. /**
  3309. * Removes all key-value entries from the stack.
  3310. *
  3311. * @private
  3312. * @name clear
  3313. * @memberOf Stack
  3314. */
  3315. function stackClear() {
  3316. this.__data__ = new ListCache;
  3317. this.size = 0;
  3318. }
  3319. /**
  3320. * Removes `key` and its value from the stack.
  3321. *
  3322. * @private
  3323. * @name delete
  3324. * @memberOf Stack
  3325. * @param {string} key The key of the value to remove.
  3326. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3327. */
  3328. function stackDelete(key) {
  3329. var data = this.__data__,
  3330. result = data['delete'](key);
  3331. this.size = data.size;
  3332. return result;
  3333. }
  3334. /**
  3335. * Gets the stack value for `key`.
  3336. *
  3337. * @private
  3338. * @name get
  3339. * @memberOf Stack
  3340. * @param {string} key The key of the value to get.
  3341. * @returns {*} Returns the entry value.
  3342. */
  3343. function stackGet(key) {
  3344. return this.__data__.get(key);
  3345. }
  3346. /**
  3347. * Checks if a stack value for `key` exists.
  3348. *
  3349. * @private
  3350. * @name has
  3351. * @memberOf Stack
  3352. * @param {string} key The key of the entry to check.
  3353. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3354. */
  3355. function stackHas(key) {
  3356. return this.__data__.has(key);
  3357. }
  3358. /**
  3359. * Sets the stack `key` to `value`.
  3360. *
  3361. * @private
  3362. * @name set
  3363. * @memberOf Stack
  3364. * @param {string} key The key of the value to set.
  3365. * @param {*} value The value to set.
  3366. * @returns {Object} Returns the stack cache instance.
  3367. */
  3368. function stackSet(key, value) {
  3369. var data = this.__data__;
  3370. if (data instanceof ListCache) {
  3371. var pairs = data.__data__;
  3372. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3373. pairs.push([key, value]);
  3374. this.size = ++data.size;
  3375. return this;
  3376. }
  3377. data = this.__data__ = new MapCache(pairs);
  3378. }
  3379. data.set(key, value);
  3380. this.size = data.size;
  3381. return this;
  3382. }
  3383. // Add methods to `Stack`.
  3384. Stack.prototype.clear = stackClear;
  3385. Stack.prototype['delete'] = stackDelete;
  3386. Stack.prototype.get = stackGet;
  3387. Stack.prototype.has = stackHas;
  3388. Stack.prototype.set = stackSet;
  3389. /*------------------------------------------------------------------------*/
  3390. /**
  3391. * Creates an array of the enumerable property names of the array-like `value`.
  3392. *
  3393. * @private
  3394. * @param {*} value The value to query.
  3395. * @param {boolean} inherited Specify returning inherited property names.
  3396. * @returns {Array} Returns the array of property names.
  3397. */
  3398. function arrayLikeKeys(value, inherited) {
  3399. var isArr = isArray(value),
  3400. isArg = !isArr && isArguments(value),
  3401. isBuff = !isArr && !isArg && isBuffer(value),
  3402. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3403. skipIndexes = isArr || isArg || isBuff || isType,
  3404. result = skipIndexes ? baseTimes(value.length, String) : [],
  3405. length = result.length;
  3406. for (var key in value) {
  3407. if ((inherited || hasOwnProperty.call(value, key)) &&
  3408. !(skipIndexes && (
  3409. // Safari 9 has enumerable `arguments.length` in strict mode.
  3410. key == 'length' ||
  3411. // Node.js 0.10 has enumerable non-index properties on buffers.
  3412. (isBuff && (key == 'offset' || key == 'parent')) ||
  3413. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3414. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3415. // Skip index properties.
  3416. isIndex(key, length)
  3417. ))) {
  3418. result.push(key);
  3419. }
  3420. }
  3421. return result;
  3422. }
  3423. /**
  3424. * A specialized version of `_.sample` for arrays.
  3425. *
  3426. * @private
  3427. * @param {Array} array The array to sample.
  3428. * @returns {*} Returns the random element.
  3429. */
  3430. function arraySample(array) {
  3431. var length = array.length;
  3432. return length ? array[baseRandom(0, length - 1)] : undefined;
  3433. }
  3434. /**
  3435. * A specialized version of `_.sampleSize` for arrays.
  3436. *
  3437. * @private
  3438. * @param {Array} array The array to sample.
  3439. * @param {number} n The number of elements to sample.
  3440. * @returns {Array} Returns the random elements.
  3441. */
  3442. function arraySampleSize(array, n) {
  3443. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3444. }
  3445. /**
  3446. * A specialized version of `_.shuffle` for arrays.
  3447. *
  3448. * @private
  3449. * @param {Array} array The array to shuffle.
  3450. * @returns {Array} Returns the new shuffled array.
  3451. */
  3452. function arrayShuffle(array) {
  3453. return shuffleSelf(copyArray(array));
  3454. }
  3455. /**
  3456. * This function is like `assignValue` except that it doesn't assign
  3457. * `undefined` values.
  3458. *
  3459. * @private
  3460. * @param {Object} object The object to modify.
  3461. * @param {string} key The key of the property to assign.
  3462. * @param {*} value The value to assign.
  3463. */
  3464. function assignMergeValue(object, key, value) {
  3465. if ((value !== undefined && !eq(object[key], value)) ||
  3466. (value === undefined && !(key in object))) {
  3467. baseAssignValue(object, key, value);
  3468. }
  3469. }
  3470. /**
  3471. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3472. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3473. * for equality comparisons.
  3474. *
  3475. * @private
  3476. * @param {Object} object The object to modify.
  3477. * @param {string} key The key of the property to assign.
  3478. * @param {*} value The value to assign.
  3479. */
  3480. function assignValue(object, key, value) {
  3481. var objValue = object[key];
  3482. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3483. (value === undefined && !(key in object))) {
  3484. baseAssignValue(object, key, value);
  3485. }
  3486. }
  3487. /**
  3488. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3489. *
  3490. * @private
  3491. * @param {Array} array The array to inspect.
  3492. * @param {*} key The key to search for.
  3493. * @returns {number} Returns the index of the matched value, else `-1`.
  3494. */
  3495. function assocIndexOf(array, key) {
  3496. var length = array.length;
  3497. while (length--) {
  3498. if (eq(array[length][0], key)) {
  3499. return length;
  3500. }
  3501. }
  3502. return -1;
  3503. }
  3504. /**
  3505. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3506. * by `iteratee` and values set by `setter`.
  3507. *
  3508. * @private
  3509. * @param {Array|Object} collection The collection to iterate over.
  3510. * @param {Function} setter The function to set `accumulator` values.
  3511. * @param {Function} iteratee The iteratee to transform keys.
  3512. * @param {Object} accumulator The initial aggregated object.
  3513. * @returns {Function} Returns `accumulator`.
  3514. */
  3515. function baseAggregator(collection, setter, iteratee, accumulator) {
  3516. baseEach(collection, function(value, key, collection) {
  3517. setter(accumulator, value, iteratee(value), collection);
  3518. });
  3519. return accumulator;
  3520. }
  3521. /**
  3522. * The base implementation of `_.assign` without support for multiple sources
  3523. * or `customizer` functions.
  3524. *
  3525. * @private
  3526. * @param {Object} object The destination object.
  3527. * @param {Object} source The source object.
  3528. * @returns {Object} Returns `object`.
  3529. */
  3530. function baseAssign(object, source) {
  3531. return object && copyObject(source, keys(source), object);
  3532. }
  3533. /**
  3534. * The base implementation of `_.assignIn` without support for multiple sources
  3535. * or `customizer` functions.
  3536. *
  3537. * @private
  3538. * @param {Object} object The destination object.
  3539. * @param {Object} source The source object.
  3540. * @returns {Object} Returns `object`.
  3541. */
  3542. function baseAssignIn(object, source) {
  3543. return object && copyObject(source, keysIn(source), object);
  3544. }
  3545. /**
  3546. * The base implementation of `assignValue` and `assignMergeValue` without
  3547. * value checks.
  3548. *
  3549. * @private
  3550. * @param {Object} object The object to modify.
  3551. * @param {string} key The key of the property to assign.
  3552. * @param {*} value The value to assign.
  3553. */
  3554. function baseAssignValue(object, key, value) {
  3555. if (key == '__proto__' && defineProperty) {
  3556. defineProperty(object, key, {
  3557. 'configurable': true,
  3558. 'enumerable': true,
  3559. 'value': value,
  3560. 'writable': true
  3561. });
  3562. } else {
  3563. object[key] = value;
  3564. }
  3565. }
  3566. /**
  3567. * The base implementation of `_.at` without support for individual paths.
  3568. *
  3569. * @private
  3570. * @param {Object} object The object to iterate over.
  3571. * @param {string[]} paths The property paths to pick.
  3572. * @returns {Array} Returns the picked elements.
  3573. */
  3574. function baseAt(object, paths) {
  3575. var index = -1,
  3576. length = paths.length,
  3577. result = Array(length),
  3578. skip = object == null;
  3579. while (++index < length) {
  3580. result[index] = skip ? undefined : get(object, paths[index]);
  3581. }
  3582. return result;
  3583. }
  3584. /**
  3585. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3586. *
  3587. * @private
  3588. * @param {number} number The number to clamp.
  3589. * @param {number} [lower] The lower bound.
  3590. * @param {number} upper The upper bound.
  3591. * @returns {number} Returns the clamped number.
  3592. */
  3593. function baseClamp(number, lower, upper) {
  3594. if (number === number) {
  3595. if (upper !== undefined) {
  3596. number = number <= upper ? number : upper;
  3597. }
  3598. if (lower !== undefined) {
  3599. number = number >= lower ? number : lower;
  3600. }
  3601. }
  3602. return number;
  3603. }
  3604. /**
  3605. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3606. * traversed objects.
  3607. *
  3608. * @private
  3609. * @param {*} value The value to clone.
  3610. * @param {boolean} bitmask The bitmask flags.
  3611. * 1 - Deep clone
  3612. * 2 - Flatten inherited properties
  3613. * 4 - Clone symbols
  3614. * @param {Function} [customizer] The function to customize cloning.
  3615. * @param {string} [key] The key of `value`.
  3616. * @param {Object} [object] The parent object of `value`.
  3617. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3618. * @returns {*} Returns the cloned value.
  3619. */
  3620. function baseClone(value, bitmask, customizer, key, object, stack) {
  3621. var result,
  3622. isDeep = bitmask & CLONE_DEEP_FLAG,
  3623. isFlat = bitmask & CLONE_FLAT_FLAG,
  3624. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3625. if (customizer) {
  3626. result = object ? customizer(value, key, object, stack) : customizer(value);
  3627. }
  3628. if (result !== undefined) {
  3629. return result;
  3630. }
  3631. if (!isObject(value)) {
  3632. return value;
  3633. }
  3634. var isArr = isArray(value);
  3635. if (isArr) {
  3636. result = initCloneArray(value);
  3637. if (!isDeep) {
  3638. return copyArray(value, result);
  3639. }
  3640. } else {
  3641. var tag = getTag(value),
  3642. isFunc = tag == funcTag || tag == genTag;
  3643. if (isBuffer(value)) {
  3644. return cloneBuffer(value, isDeep);
  3645. }
  3646. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3647. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3648. if (!isDeep) {
  3649. return isFlat
  3650. ? copySymbolsIn(value, baseAssignIn(result, value))
  3651. : copySymbols(value, baseAssign(result, value));
  3652. }
  3653. } else {
  3654. if (!cloneableTags[tag]) {
  3655. return object ? value : {};
  3656. }
  3657. result = initCloneByTag(value, tag, isDeep);
  3658. }
  3659. }
  3660. // Check for circular references and return its corresponding clone.
  3661. stack || (stack = new Stack);
  3662. var stacked = stack.get(value);
  3663. if (stacked) {
  3664. return stacked;
  3665. }
  3666. stack.set(value, result);
  3667. if (isSet(value)) {
  3668. value.forEach(function(subValue) {
  3669. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3670. });
  3671. } else if (isMap(value)) {
  3672. value.forEach(function(subValue, key) {
  3673. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3674. });
  3675. }
  3676. var keysFunc = isFull
  3677. ? (isFlat ? getAllKeysIn : getAllKeys)
  3678. : (isFlat ? keysIn : keys);
  3679. var props = isArr ? undefined : keysFunc(value);
  3680. arrayEach(props || value, function(subValue, key) {
  3681. if (props) {
  3682. key = subValue;
  3683. subValue = value[key];
  3684. }
  3685. // Recursively populate clone (susceptible to call stack limits).
  3686. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3687. });
  3688. return result;
  3689. }
  3690. /**
  3691. * The base implementation of `_.conforms` which doesn't clone `source`.
  3692. *
  3693. * @private
  3694. * @param {Object} source The object of property predicates to conform to.
  3695. * @returns {Function} Returns the new spec function.
  3696. */
  3697. function baseConforms(source) {
  3698. var props = keys(source);
  3699. return function(object) {
  3700. return baseConformsTo(object, source, props);
  3701. };
  3702. }
  3703. /**
  3704. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3705. *
  3706. * @private
  3707. * @param {Object} object The object to inspect.
  3708. * @param {Object} source The object of property predicates to conform to.
  3709. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3710. */
  3711. function baseConformsTo(object, source, props) {
  3712. var length = props.length;
  3713. if (object == null) {
  3714. return !length;
  3715. }
  3716. object = Object(object);
  3717. while (length--) {
  3718. var key = props[length],
  3719. predicate = source[key],
  3720. value = object[key];
  3721. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3722. return false;
  3723. }
  3724. }
  3725. return true;
  3726. }
  3727. /**
  3728. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3729. * to provide to `func`.
  3730. *
  3731. * @private
  3732. * @param {Function} func The function to delay.
  3733. * @param {number} wait The number of milliseconds to delay invocation.
  3734. * @param {Array} args The arguments to provide to `func`.
  3735. * @returns {number|Object} Returns the timer id or timeout object.
  3736. */
  3737. function baseDelay(func, wait, args) {
  3738. if (typeof func != 'function') {
  3739. throw new TypeError(FUNC_ERROR_TEXT);
  3740. }
  3741. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3742. }
  3743. /**
  3744. * The base implementation of methods like `_.difference` without support
  3745. * for excluding multiple arrays or iteratee shorthands.
  3746. *
  3747. * @private
  3748. * @param {Array} array The array to inspect.
  3749. * @param {Array} values The values to exclude.
  3750. * @param {Function} [iteratee] The iteratee invoked per element.
  3751. * @param {Function} [comparator] The comparator invoked per element.
  3752. * @returns {Array} Returns the new array of filtered values.
  3753. */
  3754. function baseDifference(array, values, iteratee, comparator) {
  3755. var index = -1,
  3756. includes = arrayIncludes,
  3757. isCommon = true,
  3758. length = array.length,
  3759. result = [],
  3760. valuesLength = values.length;
  3761. if (!length) {
  3762. return result;
  3763. }
  3764. if (iteratee) {
  3765. values = arrayMap(values, baseUnary(iteratee));
  3766. }
  3767. if (comparator) {
  3768. includes = arrayIncludesWith;
  3769. isCommon = false;
  3770. }
  3771. else if (values.length >= LARGE_ARRAY_SIZE) {
  3772. includes = cacheHas;
  3773. isCommon = false;
  3774. values = new SetCache(values);
  3775. }
  3776. outer:
  3777. while (++index < length) {
  3778. var value = array[index],
  3779. computed = iteratee == null ? value : iteratee(value);
  3780. value = (comparator || value !== 0) ? value : 0;
  3781. if (isCommon && computed === computed) {
  3782. var valuesIndex = valuesLength;
  3783. while (valuesIndex--) {
  3784. if (values[valuesIndex] === computed) {
  3785. continue outer;
  3786. }
  3787. }
  3788. result.push(value);
  3789. }
  3790. else if (!includes(values, computed, comparator)) {
  3791. result.push(value);
  3792. }
  3793. }
  3794. return result;
  3795. }
  3796. /**
  3797. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3798. *
  3799. * @private
  3800. * @param {Array|Object} collection The collection to iterate over.
  3801. * @param {Function} iteratee The function invoked per iteration.
  3802. * @returns {Array|Object} Returns `collection`.
  3803. */
  3804. var baseEach = createBaseEach(baseForOwn);
  3805. /**
  3806. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3807. *
  3808. * @private
  3809. * @param {Array|Object} collection The collection to iterate over.
  3810. * @param {Function} iteratee The function invoked per iteration.
  3811. * @returns {Array|Object} Returns `collection`.
  3812. */
  3813. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3814. /**
  3815. * The base implementation of `_.every` without support for iteratee shorthands.
  3816. *
  3817. * @private
  3818. * @param {Array|Object} collection The collection to iterate over.
  3819. * @param {Function} predicate The function invoked per iteration.
  3820. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3821. * else `false`
  3822. */
  3823. function baseEvery(collection, predicate) {
  3824. var result = true;
  3825. baseEach(collection, function(value, index, collection) {
  3826. result = !!predicate(value, index, collection);
  3827. return result;
  3828. });
  3829. return result;
  3830. }
  3831. /**
  3832. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3833. * `comparator` to determine the extremum value.
  3834. *
  3835. * @private
  3836. * @param {Array} array The array to iterate over.
  3837. * @param {Function} iteratee The iteratee invoked per iteration.
  3838. * @param {Function} comparator The comparator used to compare values.
  3839. * @returns {*} Returns the extremum value.
  3840. */
  3841. function baseExtremum(array, iteratee, comparator) {
  3842. var index = -1,
  3843. length = array.length;
  3844. while (++index < length) {
  3845. var value = array[index],
  3846. current = iteratee(value);
  3847. if (current != null && (computed === undefined
  3848. ? (current === current && !isSymbol(current))
  3849. : comparator(current, computed)
  3850. )) {
  3851. var computed = current,
  3852. result = value;
  3853. }
  3854. }
  3855. return result;
  3856. }
  3857. /**
  3858. * The base implementation of `_.fill` without an iteratee call guard.
  3859. *
  3860. * @private
  3861. * @param {Array} array The array to fill.
  3862. * @param {*} value The value to fill `array` with.
  3863. * @param {number} [start=0] The start position.
  3864. * @param {number} [end=array.length] The end position.
  3865. * @returns {Array} Returns `array`.
  3866. */
  3867. function baseFill(array, value, start, end) {
  3868. var length = array.length;
  3869. start = toInteger(start);
  3870. if (start < 0) {
  3871. start = -start > length ? 0 : (length + start);
  3872. }
  3873. end = (end === undefined || end > length) ? length : toInteger(end);
  3874. if (end < 0) {
  3875. end += length;
  3876. }
  3877. end = start > end ? 0 : toLength(end);
  3878. while (start < end) {
  3879. array[start++] = value;
  3880. }
  3881. return array;
  3882. }
  3883. /**
  3884. * The base implementation of `_.filter` without support for iteratee shorthands.
  3885. *
  3886. * @private
  3887. * @param {Array|Object} collection The collection to iterate over.
  3888. * @param {Function} predicate The function invoked per iteration.
  3889. * @returns {Array} Returns the new filtered array.
  3890. */
  3891. function baseFilter(collection, predicate) {
  3892. var result = [];
  3893. baseEach(collection, function(value, index, collection) {
  3894. if (predicate(value, index, collection)) {
  3895. result.push(value);
  3896. }
  3897. });
  3898. return result;
  3899. }
  3900. /**
  3901. * The base implementation of `_.flatten` with support for restricting flattening.
  3902. *
  3903. * @private
  3904. * @param {Array} array The array to flatten.
  3905. * @param {number} depth The maximum recursion depth.
  3906. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3907. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3908. * @param {Array} [result=[]] The initial result value.
  3909. * @returns {Array} Returns the new flattened array.
  3910. */
  3911. function baseFlatten(array, depth, predicate, isStrict, result) {
  3912. var index = -1,
  3913. length = array.length;
  3914. predicate || (predicate = isFlattenable);
  3915. result || (result = []);
  3916. while (++index < length) {
  3917. var value = array[index];
  3918. if (depth > 0 && predicate(value)) {
  3919. if (depth > 1) {
  3920. // Recursively flatten arrays (susceptible to call stack limits).
  3921. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3922. } else {
  3923. arrayPush(result, value);
  3924. }
  3925. } else if (!isStrict) {
  3926. result[result.length] = value;
  3927. }
  3928. }
  3929. return result;
  3930. }
  3931. /**
  3932. * The base implementation of `baseForOwn` which iterates over `object`
  3933. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3934. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3935. *
  3936. * @private
  3937. * @param {Object} object The object to iterate over.
  3938. * @param {Function} iteratee The function invoked per iteration.
  3939. * @param {Function} keysFunc The function to get the keys of `object`.
  3940. * @returns {Object} Returns `object`.
  3941. */
  3942. var baseFor = createBaseFor();
  3943. /**
  3944. * This function is like `baseFor` except that it iterates over properties
  3945. * in the opposite order.
  3946. *
  3947. * @private
  3948. * @param {Object} object The object to iterate over.
  3949. * @param {Function} iteratee The function invoked per iteration.
  3950. * @param {Function} keysFunc The function to get the keys of `object`.
  3951. * @returns {Object} Returns `object`.
  3952. */
  3953. var baseForRight = createBaseFor(true);
  3954. /**
  3955. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3956. *
  3957. * @private
  3958. * @param {Object} object The object to iterate over.
  3959. * @param {Function} iteratee The function invoked per iteration.
  3960. * @returns {Object} Returns `object`.
  3961. */
  3962. function baseForOwn(object, iteratee) {
  3963. return object && baseFor(object, iteratee, keys);
  3964. }
  3965. /**
  3966. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3967. *
  3968. * @private
  3969. * @param {Object} object The object to iterate over.
  3970. * @param {Function} iteratee The function invoked per iteration.
  3971. * @returns {Object} Returns `object`.
  3972. */
  3973. function baseForOwnRight(object, iteratee) {
  3974. return object && baseForRight(object, iteratee, keys);
  3975. }
  3976. /**
  3977. * The base implementation of `_.functions` which creates an array of
  3978. * `object` function property names filtered from `props`.
  3979. *
  3980. * @private
  3981. * @param {Object} object The object to inspect.
  3982. * @param {Array} props The property names to filter.
  3983. * @returns {Array} Returns the function names.
  3984. */
  3985. function baseFunctions(object, props) {
  3986. return arrayFilter(props, function(key) {
  3987. return isFunction(object[key]);
  3988. });
  3989. }
  3990. /**
  3991. * The base implementation of `_.get` without support for default values.
  3992. *
  3993. * @private
  3994. * @param {Object} object The object to query.
  3995. * @param {Array|string} path The path of the property to get.
  3996. * @returns {*} Returns the resolved value.
  3997. */
  3998. function baseGet(object, path) {
  3999. path = castPath(path, object);
  4000. var index = 0,
  4001. length = path.length;
  4002. while (object != null && index < length) {
  4003. object = object[toKey(path[index++])];
  4004. }
  4005. return (index && index == length) ? object : undefined;
  4006. }
  4007. /**
  4008. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4009. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4010. * symbols of `object`.
  4011. *
  4012. * @private
  4013. * @param {Object} object The object to query.
  4014. * @param {Function} keysFunc The function to get the keys of `object`.
  4015. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4016. * @returns {Array} Returns the array of property names and symbols.
  4017. */
  4018. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4019. var result = keysFunc(object);
  4020. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4021. }
  4022. /**
  4023. * The base implementation of `getTag` without fallbacks for buggy environments.
  4024. *
  4025. * @private
  4026. * @param {*} value The value to query.
  4027. * @returns {string} Returns the `toStringTag`.
  4028. */
  4029. function baseGetTag(value) {
  4030. if (value == null) {
  4031. return value === undefined ? undefinedTag : nullTag;
  4032. }
  4033. return (symToStringTag && symToStringTag in Object(value))
  4034. ? getRawTag(value)
  4035. : objectToString(value);
  4036. }
  4037. /**
  4038. * The base implementation of `_.gt` which doesn't coerce arguments.
  4039. *
  4040. * @private
  4041. * @param {*} value The value to compare.
  4042. * @param {*} other The other value to compare.
  4043. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4044. * else `false`.
  4045. */
  4046. function baseGt(value, other) {
  4047. return value > other;
  4048. }
  4049. /**
  4050. * The base implementation of `_.has` without support for deep paths.
  4051. *
  4052. * @private
  4053. * @param {Object} [object] The object to query.
  4054. * @param {Array|string} key The key to check.
  4055. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4056. */
  4057. function baseHas(object, key) {
  4058. return object != null && hasOwnProperty.call(object, key);
  4059. }
  4060. /**
  4061. * The base implementation of `_.hasIn` without support for deep paths.
  4062. *
  4063. * @private
  4064. * @param {Object} [object] The object to query.
  4065. * @param {Array|string} key The key to check.
  4066. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4067. */
  4068. function baseHasIn(object, key) {
  4069. return object != null && key in Object(object);
  4070. }
  4071. /**
  4072. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4073. *
  4074. * @private
  4075. * @param {number} number The number to check.
  4076. * @param {number} start The start of the range.
  4077. * @param {number} end The end of the range.
  4078. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4079. */
  4080. function baseInRange(number, start, end) {
  4081. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4082. }
  4083. /**
  4084. * The base implementation of methods like `_.intersection`, without support
  4085. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4086. *
  4087. * @private
  4088. * @param {Array} arrays The arrays to inspect.
  4089. * @param {Function} [iteratee] The iteratee invoked per element.
  4090. * @param {Function} [comparator] The comparator invoked per element.
  4091. * @returns {Array} Returns the new array of shared values.
  4092. */
  4093. function baseIntersection(arrays, iteratee, comparator) {
  4094. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4095. length = arrays[0].length,
  4096. othLength = arrays.length,
  4097. othIndex = othLength,
  4098. caches = Array(othLength),
  4099. maxLength = Infinity,
  4100. result = [];
  4101. while (othIndex--) {
  4102. var array = arrays[othIndex];
  4103. if (othIndex && iteratee) {
  4104. array = arrayMap(array, baseUnary(iteratee));
  4105. }
  4106. maxLength = nativeMin(array.length, maxLength);
  4107. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4108. ? new SetCache(othIndex && array)
  4109. : undefined;
  4110. }
  4111. array = arrays[0];
  4112. var index = -1,
  4113. seen = caches[0];
  4114. outer:
  4115. while (++index < length && result.length < maxLength) {
  4116. var value = array[index],
  4117. computed = iteratee ? iteratee(value) : value;
  4118. value = (comparator || value !== 0) ? value : 0;
  4119. if (!(seen
  4120. ? cacheHas(seen, computed)
  4121. : includes(result, computed, comparator)
  4122. )) {
  4123. othIndex = othLength;
  4124. while (--othIndex) {
  4125. var cache = caches[othIndex];
  4126. if (!(cache
  4127. ? cacheHas(cache, computed)
  4128. : includes(arrays[othIndex], computed, comparator))
  4129. ) {
  4130. continue outer;
  4131. }
  4132. }
  4133. if (seen) {
  4134. seen.push(computed);
  4135. }
  4136. result.push(value);
  4137. }
  4138. }
  4139. return result;
  4140. }
  4141. /**
  4142. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4143. * `object` with values transformed by `iteratee` and set by `setter`.
  4144. *
  4145. * @private
  4146. * @param {Object} object The object to iterate over.
  4147. * @param {Function} setter The function to set `accumulator` values.
  4148. * @param {Function} iteratee The iteratee to transform values.
  4149. * @param {Object} accumulator The initial inverted object.
  4150. * @returns {Function} Returns `accumulator`.
  4151. */
  4152. function baseInverter(object, setter, iteratee, accumulator) {
  4153. baseForOwn(object, function(value, key, object) {
  4154. setter(accumulator, iteratee(value), key, object);
  4155. });
  4156. return accumulator;
  4157. }
  4158. /**
  4159. * The base implementation of `_.invoke` without support for individual
  4160. * method arguments.
  4161. *
  4162. * @private
  4163. * @param {Object} object The object to query.
  4164. * @param {Array|string} path The path of the method to invoke.
  4165. * @param {Array} args The arguments to invoke the method with.
  4166. * @returns {*} Returns the result of the invoked method.
  4167. */
  4168. function baseInvoke(object, path, args) {
  4169. path = castPath(path, object);
  4170. object = parent(object, path);
  4171. var func = object == null ? object : object[toKey(last(path))];
  4172. return func == null ? undefined : apply(func, object, args);
  4173. }
  4174. /**
  4175. * The base implementation of `_.isArguments`.
  4176. *
  4177. * @private
  4178. * @param {*} value The value to check.
  4179. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4180. */
  4181. function baseIsArguments(value) {
  4182. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4183. }
  4184. /**
  4185. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4186. *
  4187. * @private
  4188. * @param {*} value The value to check.
  4189. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4190. */
  4191. function baseIsArrayBuffer(value) {
  4192. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4193. }
  4194. /**
  4195. * The base implementation of `_.isDate` without Node.js optimizations.
  4196. *
  4197. * @private
  4198. * @param {*} value The value to check.
  4199. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4200. */
  4201. function baseIsDate(value) {
  4202. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4203. }
  4204. /**
  4205. * The base implementation of `_.isEqual` which supports partial comparisons
  4206. * and tracks traversed objects.
  4207. *
  4208. * @private
  4209. * @param {*} value The value to compare.
  4210. * @param {*} other The other value to compare.
  4211. * @param {boolean} bitmask The bitmask flags.
  4212. * 1 - Unordered comparison
  4213. * 2 - Partial comparison
  4214. * @param {Function} [customizer] The function to customize comparisons.
  4215. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4216. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4217. */
  4218. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4219. if (value === other) {
  4220. return true;
  4221. }
  4222. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4223. return value !== value && other !== other;
  4224. }
  4225. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4226. }
  4227. /**
  4228. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4229. * deep comparisons and tracks traversed objects enabling objects with circular
  4230. * references to be compared.
  4231. *
  4232. * @private
  4233. * @param {Object} object The object to compare.
  4234. * @param {Object} other The other object to compare.
  4235. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4236. * @param {Function} customizer The function to customize comparisons.
  4237. * @param {Function} equalFunc The function to determine equivalents of values.
  4238. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4239. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4240. */
  4241. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4242. var objIsArr = isArray(object),
  4243. othIsArr = isArray(other),
  4244. objTag = objIsArr ? arrayTag : getTag(object),
  4245. othTag = othIsArr ? arrayTag : getTag(other);
  4246. objTag = objTag == argsTag ? objectTag : objTag;
  4247. othTag = othTag == argsTag ? objectTag : othTag;
  4248. var objIsObj = objTag == objectTag,
  4249. othIsObj = othTag == objectTag,
  4250. isSameTag = objTag == othTag;
  4251. if (isSameTag && isBuffer(object)) {
  4252. if (!isBuffer(other)) {
  4253. return false;
  4254. }
  4255. objIsArr = true;
  4256. objIsObj = false;
  4257. }
  4258. if (isSameTag && !objIsObj) {
  4259. stack || (stack = new Stack);
  4260. return (objIsArr || isTypedArray(object))
  4261. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4262. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4263. }
  4264. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4265. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4266. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4267. if (objIsWrapped || othIsWrapped) {
  4268. var objUnwrapped = objIsWrapped ? object.value() : object,
  4269. othUnwrapped = othIsWrapped ? other.value() : other;
  4270. stack || (stack = new Stack);
  4271. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4272. }
  4273. }
  4274. if (!isSameTag) {
  4275. return false;
  4276. }
  4277. stack || (stack = new Stack);
  4278. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4279. }
  4280. /**
  4281. * The base implementation of `_.isMap` without Node.js optimizations.
  4282. *
  4283. * @private
  4284. * @param {*} value The value to check.
  4285. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4286. */
  4287. function baseIsMap(value) {
  4288. return isObjectLike(value) && getTag(value) == mapTag;
  4289. }
  4290. /**
  4291. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4292. *
  4293. * @private
  4294. * @param {Object} object The object to inspect.
  4295. * @param {Object} source The object of property values to match.
  4296. * @param {Array} matchData The property names, values, and compare flags to match.
  4297. * @param {Function} [customizer] The function to customize comparisons.
  4298. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4299. */
  4300. function baseIsMatch(object, source, matchData, customizer) {
  4301. var index = matchData.length,
  4302. length = index,
  4303. noCustomizer = !customizer;
  4304. if (object == null) {
  4305. return !length;
  4306. }
  4307. object = Object(object);
  4308. while (index--) {
  4309. var data = matchData[index];
  4310. if ((noCustomizer && data[2])
  4311. ? data[1] !== object[data[0]]
  4312. : !(data[0] in object)
  4313. ) {
  4314. return false;
  4315. }
  4316. }
  4317. while (++index < length) {
  4318. data = matchData[index];
  4319. var key = data[0],
  4320. objValue = object[key],
  4321. srcValue = data[1];
  4322. if (noCustomizer && data[2]) {
  4323. if (objValue === undefined && !(key in object)) {
  4324. return false;
  4325. }
  4326. } else {
  4327. var stack = new Stack;
  4328. if (customizer) {
  4329. var result = customizer(objValue, srcValue, key, object, source, stack);
  4330. }
  4331. if (!(result === undefined
  4332. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4333. : result
  4334. )) {
  4335. return false;
  4336. }
  4337. }
  4338. }
  4339. return true;
  4340. }
  4341. /**
  4342. * The base implementation of `_.isNative` without bad shim checks.
  4343. *
  4344. * @private
  4345. * @param {*} value The value to check.
  4346. * @returns {boolean} Returns `true` if `value` is a native function,
  4347. * else `false`.
  4348. */
  4349. function baseIsNative(value) {
  4350. if (!isObject(value) || isMasked(value)) {
  4351. return false;
  4352. }
  4353. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4354. return pattern.test(toSource(value));
  4355. }
  4356. /**
  4357. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4358. *
  4359. * @private
  4360. * @param {*} value The value to check.
  4361. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4362. */
  4363. function baseIsRegExp(value) {
  4364. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4365. }
  4366. /**
  4367. * The base implementation of `_.isSet` without Node.js optimizations.
  4368. *
  4369. * @private
  4370. * @param {*} value The value to check.
  4371. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4372. */
  4373. function baseIsSet(value) {
  4374. return isObjectLike(value) && getTag(value) == setTag;
  4375. }
  4376. /**
  4377. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4378. *
  4379. * @private
  4380. * @param {*} value The value to check.
  4381. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4382. */
  4383. function baseIsTypedArray(value) {
  4384. return isObjectLike(value) &&
  4385. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4386. }
  4387. /**
  4388. * The base implementation of `_.iteratee`.
  4389. *
  4390. * @private
  4391. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4392. * @returns {Function} Returns the iteratee.
  4393. */
  4394. function baseIteratee(value) {
  4395. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4396. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4397. if (typeof value == 'function') {
  4398. return value;
  4399. }
  4400. if (value == null) {
  4401. return identity;
  4402. }
  4403. if (typeof value == 'object') {
  4404. return isArray(value)
  4405. ? baseMatchesProperty(value[0], value[1])
  4406. : baseMatches(value);
  4407. }
  4408. return property(value);
  4409. }
  4410. /**
  4411. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4412. *
  4413. * @private
  4414. * @param {Object} object The object to query.
  4415. * @returns {Array} Returns the array of property names.
  4416. */
  4417. function baseKeys(object) {
  4418. if (!isPrototype(object)) {
  4419. return nativeKeys(object);
  4420. }
  4421. var result = [];
  4422. for (var key in Object(object)) {
  4423. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4424. result.push(key);
  4425. }
  4426. }
  4427. return result;
  4428. }
  4429. /**
  4430. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4431. *
  4432. * @private
  4433. * @param {Object} object The object to query.
  4434. * @returns {Array} Returns the array of property names.
  4435. */
  4436. function baseKeysIn(object) {
  4437. if (!isObject(object)) {
  4438. return nativeKeysIn(object);
  4439. }
  4440. var isProto = isPrototype(object),
  4441. result = [];
  4442. for (var key in object) {
  4443. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4444. result.push(key);
  4445. }
  4446. }
  4447. return result;
  4448. }
  4449. /**
  4450. * The base implementation of `_.lt` which doesn't coerce arguments.
  4451. *
  4452. * @private
  4453. * @param {*} value The value to compare.
  4454. * @param {*} other The other value to compare.
  4455. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4456. * else `false`.
  4457. */
  4458. function baseLt(value, other) {
  4459. return value < other;
  4460. }
  4461. /**
  4462. * The base implementation of `_.map` without support for iteratee shorthands.
  4463. *
  4464. * @private
  4465. * @param {Array|Object} collection The collection to iterate over.
  4466. * @param {Function} iteratee The function invoked per iteration.
  4467. * @returns {Array} Returns the new mapped array.
  4468. */
  4469. function baseMap(collection, iteratee) {
  4470. var index = -1,
  4471. result = isArrayLike(collection) ? Array(collection.length) : [];
  4472. baseEach(collection, function(value, key, collection) {
  4473. result[++index] = iteratee(value, key, collection);
  4474. });
  4475. return result;
  4476. }
  4477. /**
  4478. * The base implementation of `_.matches` which doesn't clone `source`.
  4479. *
  4480. * @private
  4481. * @param {Object} source The object of property values to match.
  4482. * @returns {Function} Returns the new spec function.
  4483. */
  4484. function baseMatches(source) {
  4485. var matchData = getMatchData(source);
  4486. if (matchData.length == 1 && matchData[0][2]) {
  4487. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4488. }
  4489. return function(object) {
  4490. return object === source || baseIsMatch(object, source, matchData);
  4491. };
  4492. }
  4493. /**
  4494. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4495. *
  4496. * @private
  4497. * @param {string} path The path of the property to get.
  4498. * @param {*} srcValue The value to match.
  4499. * @returns {Function} Returns the new spec function.
  4500. */
  4501. function baseMatchesProperty(path, srcValue) {
  4502. if (isKey(path) && isStrictComparable(srcValue)) {
  4503. return matchesStrictComparable(toKey(path), srcValue);
  4504. }
  4505. return function(object) {
  4506. var objValue = get(object, path);
  4507. return (objValue === undefined && objValue === srcValue)
  4508. ? hasIn(object, path)
  4509. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4510. };
  4511. }
  4512. /**
  4513. * The base implementation of `_.merge` without support for multiple sources.
  4514. *
  4515. * @private
  4516. * @param {Object} object The destination object.
  4517. * @param {Object} source The source object.
  4518. * @param {number} srcIndex The index of `source`.
  4519. * @param {Function} [customizer] The function to customize merged values.
  4520. * @param {Object} [stack] Tracks traversed source values and their merged
  4521. * counterparts.
  4522. */
  4523. function baseMerge(object, source, srcIndex, customizer, stack) {
  4524. if (object === source) {
  4525. return;
  4526. }
  4527. baseFor(source, function(srcValue, key) {
  4528. stack || (stack = new Stack);
  4529. if (isObject(srcValue)) {
  4530. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4531. }
  4532. else {
  4533. var newValue = customizer
  4534. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4535. : undefined;
  4536. if (newValue === undefined) {
  4537. newValue = srcValue;
  4538. }
  4539. assignMergeValue(object, key, newValue);
  4540. }
  4541. }, keysIn);
  4542. }
  4543. /**
  4544. * A specialized version of `baseMerge` for arrays and objects which performs
  4545. * deep merges and tracks traversed objects enabling objects with circular
  4546. * references to be merged.
  4547. *
  4548. * @private
  4549. * @param {Object} object The destination object.
  4550. * @param {Object} source The source object.
  4551. * @param {string} key The key of the value to merge.
  4552. * @param {number} srcIndex The index of `source`.
  4553. * @param {Function} mergeFunc The function to merge values.
  4554. * @param {Function} [customizer] The function to customize assigned values.
  4555. * @param {Object} [stack] Tracks traversed source values and their merged
  4556. * counterparts.
  4557. */
  4558. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4559. var objValue = safeGet(object, key),
  4560. srcValue = safeGet(source, key),
  4561. stacked = stack.get(srcValue);
  4562. if (stacked) {
  4563. assignMergeValue(object, key, stacked);
  4564. return;
  4565. }
  4566. var newValue = customizer
  4567. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4568. : undefined;
  4569. var isCommon = newValue === undefined;
  4570. if (isCommon) {
  4571. var isArr = isArray(srcValue),
  4572. isBuff = !isArr && isBuffer(srcValue),
  4573. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4574. newValue = srcValue;
  4575. if (isArr || isBuff || isTyped) {
  4576. if (isArray(objValue)) {
  4577. newValue = objValue;
  4578. }
  4579. else if (isArrayLikeObject(objValue)) {
  4580. newValue = copyArray(objValue);
  4581. }
  4582. else if (isBuff) {
  4583. isCommon = false;
  4584. newValue = cloneBuffer(srcValue, true);
  4585. }
  4586. else if (isTyped) {
  4587. isCommon = false;
  4588. newValue = cloneTypedArray(srcValue, true);
  4589. }
  4590. else {
  4591. newValue = [];
  4592. }
  4593. }
  4594. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4595. newValue = objValue;
  4596. if (isArguments(objValue)) {
  4597. newValue = toPlainObject(objValue);
  4598. }
  4599. else if (!isObject(objValue) || isFunction(objValue)) {
  4600. newValue = initCloneObject(srcValue);
  4601. }
  4602. }
  4603. else {
  4604. isCommon = false;
  4605. }
  4606. }
  4607. if (isCommon) {
  4608. // Recursively merge objects and arrays (susceptible to call stack limits).
  4609. stack.set(srcValue, newValue);
  4610. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4611. stack['delete'](srcValue);
  4612. }
  4613. assignMergeValue(object, key, newValue);
  4614. }
  4615. /**
  4616. * The base implementation of `_.nth` which doesn't coerce arguments.
  4617. *
  4618. * @private
  4619. * @param {Array} array The array to query.
  4620. * @param {number} n The index of the element to return.
  4621. * @returns {*} Returns the nth element of `array`.
  4622. */
  4623. function baseNth(array, n) {
  4624. var length = array.length;
  4625. if (!length) {
  4626. return;
  4627. }
  4628. n += n < 0 ? length : 0;
  4629. return isIndex(n, length) ? array[n] : undefined;
  4630. }
  4631. /**
  4632. * The base implementation of `_.orderBy` without param guards.
  4633. *
  4634. * @private
  4635. * @param {Array|Object} collection The collection to iterate over.
  4636. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4637. * @param {string[]} orders The sort orders of `iteratees`.
  4638. * @returns {Array} Returns the new sorted array.
  4639. */
  4640. function baseOrderBy(collection, iteratees, orders) {
  4641. if (iteratees.length) {
  4642. iteratees = arrayMap(iteratees, function(iteratee) {
  4643. if (isArray(iteratee)) {
  4644. return function(value) {
  4645. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4646. }
  4647. }
  4648. return iteratee;
  4649. });
  4650. } else {
  4651. iteratees = [identity];
  4652. }
  4653. var index = -1;
  4654. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4655. var result = baseMap(collection, function(value, key, collection) {
  4656. var criteria = arrayMap(iteratees, function(iteratee) {
  4657. return iteratee(value);
  4658. });
  4659. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4660. });
  4661. return baseSortBy(result, function(object, other) {
  4662. return compareMultiple(object, other, orders);
  4663. });
  4664. }
  4665. /**
  4666. * The base implementation of `_.pick` without support for individual
  4667. * property identifiers.
  4668. *
  4669. * @private
  4670. * @param {Object} object The source object.
  4671. * @param {string[]} paths The property paths to pick.
  4672. * @returns {Object} Returns the new object.
  4673. */
  4674. function basePick(object, paths) {
  4675. return basePickBy(object, paths, function(value, path) {
  4676. return hasIn(object, path);
  4677. });
  4678. }
  4679. /**
  4680. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4681. *
  4682. * @private
  4683. * @param {Object} object The source object.
  4684. * @param {string[]} paths The property paths to pick.
  4685. * @param {Function} predicate The function invoked per property.
  4686. * @returns {Object} Returns the new object.
  4687. */
  4688. function basePickBy(object, paths, predicate) {
  4689. var index = -1,
  4690. length = paths.length,
  4691. result = {};
  4692. while (++index < length) {
  4693. var path = paths[index],
  4694. value = baseGet(object, path);
  4695. if (predicate(value, path)) {
  4696. baseSet(result, castPath(path, object), value);
  4697. }
  4698. }
  4699. return result;
  4700. }
  4701. /**
  4702. * A specialized version of `baseProperty` which supports deep paths.
  4703. *
  4704. * @private
  4705. * @param {Array|string} path The path of the property to get.
  4706. * @returns {Function} Returns the new accessor function.
  4707. */
  4708. function basePropertyDeep(path) {
  4709. return function(object) {
  4710. return baseGet(object, path);
  4711. };
  4712. }
  4713. /**
  4714. * The base implementation of `_.pullAllBy` without support for iteratee
  4715. * shorthands.
  4716. *
  4717. * @private
  4718. * @param {Array} array The array to modify.
  4719. * @param {Array} values The values to remove.
  4720. * @param {Function} [iteratee] The iteratee invoked per element.
  4721. * @param {Function} [comparator] The comparator invoked per element.
  4722. * @returns {Array} Returns `array`.
  4723. */
  4724. function basePullAll(array, values, iteratee, comparator) {
  4725. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4726. index = -1,
  4727. length = values.length,
  4728. seen = array;
  4729. if (array === values) {
  4730. values = copyArray(values);
  4731. }
  4732. if (iteratee) {
  4733. seen = arrayMap(array, baseUnary(iteratee));
  4734. }
  4735. while (++index < length) {
  4736. var fromIndex = 0,
  4737. value = values[index],
  4738. computed = iteratee ? iteratee(value) : value;
  4739. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4740. if (seen !== array) {
  4741. splice.call(seen, fromIndex, 1);
  4742. }
  4743. splice.call(array, fromIndex, 1);
  4744. }
  4745. }
  4746. return array;
  4747. }
  4748. /**
  4749. * The base implementation of `_.pullAt` without support for individual
  4750. * indexes or capturing the removed elements.
  4751. *
  4752. * @private
  4753. * @param {Array} array The array to modify.
  4754. * @param {number[]} indexes The indexes of elements to remove.
  4755. * @returns {Array} Returns `array`.
  4756. */
  4757. function basePullAt(array, indexes) {
  4758. var length = array ? indexes.length : 0,
  4759. lastIndex = length - 1;
  4760. while (length--) {
  4761. var index = indexes[length];
  4762. if (length == lastIndex || index !== previous) {
  4763. var previous = index;
  4764. if (isIndex(index)) {
  4765. splice.call(array, index, 1);
  4766. } else {
  4767. baseUnset(array, index);
  4768. }
  4769. }
  4770. }
  4771. return array;
  4772. }
  4773. /**
  4774. * The base implementation of `_.random` without support for returning
  4775. * floating-point numbers.
  4776. *
  4777. * @private
  4778. * @param {number} lower The lower bound.
  4779. * @param {number} upper The upper bound.
  4780. * @returns {number} Returns the random number.
  4781. */
  4782. function baseRandom(lower, upper) {
  4783. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4784. }
  4785. /**
  4786. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4787. * coerce arguments.
  4788. *
  4789. * @private
  4790. * @param {number} start The start of the range.
  4791. * @param {number} end The end of the range.
  4792. * @param {number} step The value to increment or decrement by.
  4793. * @param {boolean} [fromRight] Specify iterating from right to left.
  4794. * @returns {Array} Returns the range of numbers.
  4795. */
  4796. function baseRange(start, end, step, fromRight) {
  4797. var index = -1,
  4798. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4799. result = Array(length);
  4800. while (length--) {
  4801. result[fromRight ? length : ++index] = start;
  4802. start += step;
  4803. }
  4804. return result;
  4805. }
  4806. /**
  4807. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4808. *
  4809. * @private
  4810. * @param {string} string The string to repeat.
  4811. * @param {number} n The number of times to repeat the string.
  4812. * @returns {string} Returns the repeated string.
  4813. */
  4814. function baseRepeat(string, n) {
  4815. var result = '';
  4816. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4817. return result;
  4818. }
  4819. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4820. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4821. do {
  4822. if (n % 2) {
  4823. result += string;
  4824. }
  4825. n = nativeFloor(n / 2);
  4826. if (n) {
  4827. string += string;
  4828. }
  4829. } while (n);
  4830. return result;
  4831. }
  4832. /**
  4833. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4834. *
  4835. * @private
  4836. * @param {Function} func The function to apply a rest parameter to.
  4837. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4838. * @returns {Function} Returns the new function.
  4839. */
  4840. function baseRest(func, start) {
  4841. return setToString(overRest(func, start, identity), func + '');
  4842. }
  4843. /**
  4844. * The base implementation of `_.sample`.
  4845. *
  4846. * @private
  4847. * @param {Array|Object} collection The collection to sample.
  4848. * @returns {*} Returns the random element.
  4849. */
  4850. function baseSample(collection) {
  4851. return arraySample(values(collection));
  4852. }
  4853. /**
  4854. * The base implementation of `_.sampleSize` without param guards.
  4855. *
  4856. * @private
  4857. * @param {Array|Object} collection The collection to sample.
  4858. * @param {number} n The number of elements to sample.
  4859. * @returns {Array} Returns the random elements.
  4860. */
  4861. function baseSampleSize(collection, n) {
  4862. var array = values(collection);
  4863. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4864. }
  4865. /**
  4866. * The base implementation of `_.set`.
  4867. *
  4868. * @private
  4869. * @param {Object} object The object to modify.
  4870. * @param {Array|string} path The path of the property to set.
  4871. * @param {*} value The value to set.
  4872. * @param {Function} [customizer] The function to customize path creation.
  4873. * @returns {Object} Returns `object`.
  4874. */
  4875. function baseSet(object, path, value, customizer) {
  4876. if (!isObject(object)) {
  4877. return object;
  4878. }
  4879. path = castPath(path, object);
  4880. var index = -1,
  4881. length = path.length,
  4882. lastIndex = length - 1,
  4883. nested = object;
  4884. while (nested != null && ++index < length) {
  4885. var key = toKey(path[index]),
  4886. newValue = value;
  4887. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4888. return object;
  4889. }
  4890. if (index != lastIndex) {
  4891. var objValue = nested[key];
  4892. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4893. if (newValue === undefined) {
  4894. newValue = isObject(objValue)
  4895. ? objValue
  4896. : (isIndex(path[index + 1]) ? [] : {});
  4897. }
  4898. }
  4899. assignValue(nested, key, newValue);
  4900. nested = nested[key];
  4901. }
  4902. return object;
  4903. }
  4904. /**
  4905. * The base implementation of `setData` without support for hot loop shorting.
  4906. *
  4907. * @private
  4908. * @param {Function} func The function to associate metadata with.
  4909. * @param {*} data The metadata.
  4910. * @returns {Function} Returns `func`.
  4911. */
  4912. var baseSetData = !metaMap ? identity : function(func, data) {
  4913. metaMap.set(func, data);
  4914. return func;
  4915. };
  4916. /**
  4917. * The base implementation of `setToString` without support for hot loop shorting.
  4918. *
  4919. * @private
  4920. * @param {Function} func The function to modify.
  4921. * @param {Function} string The `toString` result.
  4922. * @returns {Function} Returns `func`.
  4923. */
  4924. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4925. return defineProperty(func, 'toString', {
  4926. 'configurable': true,
  4927. 'enumerable': false,
  4928. 'value': constant(string),
  4929. 'writable': true
  4930. });
  4931. };
  4932. /**
  4933. * The base implementation of `_.shuffle`.
  4934. *
  4935. * @private
  4936. * @param {Array|Object} collection The collection to shuffle.
  4937. * @returns {Array} Returns the new shuffled array.
  4938. */
  4939. function baseShuffle(collection) {
  4940. return shuffleSelf(values(collection));
  4941. }
  4942. /**
  4943. * The base implementation of `_.slice` without an iteratee call guard.
  4944. *
  4945. * @private
  4946. * @param {Array} array The array to slice.
  4947. * @param {number} [start=0] The start position.
  4948. * @param {number} [end=array.length] The end position.
  4949. * @returns {Array} Returns the slice of `array`.
  4950. */
  4951. function baseSlice(array, start, end) {
  4952. var index = -1,
  4953. length = array.length;
  4954. if (start < 0) {
  4955. start = -start > length ? 0 : (length + start);
  4956. }
  4957. end = end > length ? length : end;
  4958. if (end < 0) {
  4959. end += length;
  4960. }
  4961. length = start > end ? 0 : ((end - start) >>> 0);
  4962. start >>>= 0;
  4963. var result = Array(length);
  4964. while (++index < length) {
  4965. result[index] = array[index + start];
  4966. }
  4967. return result;
  4968. }
  4969. /**
  4970. * The base implementation of `_.some` without support for iteratee shorthands.
  4971. *
  4972. * @private
  4973. * @param {Array|Object} collection The collection to iterate over.
  4974. * @param {Function} predicate The function invoked per iteration.
  4975. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4976. * else `false`.
  4977. */
  4978. function baseSome(collection, predicate) {
  4979. var result;
  4980. baseEach(collection, function(value, index, collection) {
  4981. result = predicate(value, index, collection);
  4982. return !result;
  4983. });
  4984. return !!result;
  4985. }
  4986. /**
  4987. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4988. * performs a binary search of `array` to determine the index at which `value`
  4989. * should be inserted into `array` in order to maintain its sort order.
  4990. *
  4991. * @private
  4992. * @param {Array} array The sorted array to inspect.
  4993. * @param {*} value The value to evaluate.
  4994. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4995. * @returns {number} Returns the index at which `value` should be inserted
  4996. * into `array`.
  4997. */
  4998. function baseSortedIndex(array, value, retHighest) {
  4999. var low = 0,
  5000. high = array == null ? low : array.length;
  5001. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5002. while (low < high) {
  5003. var mid = (low + high) >>> 1,
  5004. computed = array[mid];
  5005. if (computed !== null && !isSymbol(computed) &&
  5006. (retHighest ? (computed <= value) : (computed < value))) {
  5007. low = mid + 1;
  5008. } else {
  5009. high = mid;
  5010. }
  5011. }
  5012. return high;
  5013. }
  5014. return baseSortedIndexBy(array, value, identity, retHighest);
  5015. }
  5016. /**
  5017. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5018. * which invokes `iteratee` for `value` and each element of `array` to compute
  5019. * their sort ranking. The iteratee is invoked with one argument; (value).
  5020. *
  5021. * @private
  5022. * @param {Array} array The sorted array to inspect.
  5023. * @param {*} value The value to evaluate.
  5024. * @param {Function} iteratee The iteratee invoked per element.
  5025. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5026. * @returns {number} Returns the index at which `value` should be inserted
  5027. * into `array`.
  5028. */
  5029. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5030. var low = 0,
  5031. high = array == null ? 0 : array.length;
  5032. if (high === 0) {
  5033. return 0;
  5034. }
  5035. value = iteratee(value);
  5036. var valIsNaN = value !== value,
  5037. valIsNull = value === null,
  5038. valIsSymbol = isSymbol(value),
  5039. valIsUndefined = value === undefined;
  5040. while (low < high) {
  5041. var mid = nativeFloor((low + high) / 2),
  5042. computed = iteratee(array[mid]),
  5043. othIsDefined = computed !== undefined,
  5044. othIsNull = computed === null,
  5045. othIsReflexive = computed === computed,
  5046. othIsSymbol = isSymbol(computed);
  5047. if (valIsNaN) {
  5048. var setLow = retHighest || othIsReflexive;
  5049. } else if (valIsUndefined) {
  5050. setLow = othIsReflexive && (retHighest || othIsDefined);
  5051. } else if (valIsNull) {
  5052. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5053. } else if (valIsSymbol) {
  5054. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5055. } else if (othIsNull || othIsSymbol) {
  5056. setLow = false;
  5057. } else {
  5058. setLow = retHighest ? (computed <= value) : (computed < value);
  5059. }
  5060. if (setLow) {
  5061. low = mid + 1;
  5062. } else {
  5063. high = mid;
  5064. }
  5065. }
  5066. return nativeMin(high, MAX_ARRAY_INDEX);
  5067. }
  5068. /**
  5069. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5070. * support for iteratee shorthands.
  5071. *
  5072. * @private
  5073. * @param {Array} array The array to inspect.
  5074. * @param {Function} [iteratee] The iteratee invoked per element.
  5075. * @returns {Array} Returns the new duplicate free array.
  5076. */
  5077. function baseSortedUniq(array, iteratee) {
  5078. var index = -1,
  5079. length = array.length,
  5080. resIndex = 0,
  5081. result = [];
  5082. while (++index < length) {
  5083. var value = array[index],
  5084. computed = iteratee ? iteratee(value) : value;
  5085. if (!index || !eq(computed, seen)) {
  5086. var seen = computed;
  5087. result[resIndex++] = value === 0 ? 0 : value;
  5088. }
  5089. }
  5090. return result;
  5091. }
  5092. /**
  5093. * The base implementation of `_.toNumber` which doesn't ensure correct
  5094. * conversions of binary, hexadecimal, or octal string values.
  5095. *
  5096. * @private
  5097. * @param {*} value The value to process.
  5098. * @returns {number} Returns the number.
  5099. */
  5100. function baseToNumber(value) {
  5101. if (typeof value == 'number') {
  5102. return value;
  5103. }
  5104. if (isSymbol(value)) {
  5105. return NAN;
  5106. }
  5107. return +value;
  5108. }
  5109. /**
  5110. * The base implementation of `_.toString` which doesn't convert nullish
  5111. * values to empty strings.
  5112. *
  5113. * @private
  5114. * @param {*} value The value to process.
  5115. * @returns {string} Returns the string.
  5116. */
  5117. function baseToString(value) {
  5118. // Exit early for strings to avoid a performance hit in some environments.
  5119. if (typeof value == 'string') {
  5120. return value;
  5121. }
  5122. if (isArray(value)) {
  5123. // Recursively convert values (susceptible to call stack limits).
  5124. return arrayMap(value, baseToString) + '';
  5125. }
  5126. if (isSymbol(value)) {
  5127. return symbolToString ? symbolToString.call(value) : '';
  5128. }
  5129. var result = (value + '');
  5130. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5131. }
  5132. /**
  5133. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5134. *
  5135. * @private
  5136. * @param {Array} array The array to inspect.
  5137. * @param {Function} [iteratee] The iteratee invoked per element.
  5138. * @param {Function} [comparator] The comparator invoked per element.
  5139. * @returns {Array} Returns the new duplicate free array.
  5140. */
  5141. function baseUniq(array, iteratee, comparator) {
  5142. var index = -1,
  5143. includes = arrayIncludes,
  5144. length = array.length,
  5145. isCommon = true,
  5146. result = [],
  5147. seen = result;
  5148. if (comparator) {
  5149. isCommon = false;
  5150. includes = arrayIncludesWith;
  5151. }
  5152. else if (length >= LARGE_ARRAY_SIZE) {
  5153. var set = iteratee ? null : createSet(array);
  5154. if (set) {
  5155. return setToArray(set);
  5156. }
  5157. isCommon = false;
  5158. includes = cacheHas;
  5159. seen = new SetCache;
  5160. }
  5161. else {
  5162. seen = iteratee ? [] : result;
  5163. }
  5164. outer:
  5165. while (++index < length) {
  5166. var value = array[index],
  5167. computed = iteratee ? iteratee(value) : value;
  5168. value = (comparator || value !== 0) ? value : 0;
  5169. if (isCommon && computed === computed) {
  5170. var seenIndex = seen.length;
  5171. while (seenIndex--) {
  5172. if (seen[seenIndex] === computed) {
  5173. continue outer;
  5174. }
  5175. }
  5176. if (iteratee) {
  5177. seen.push(computed);
  5178. }
  5179. result.push(value);
  5180. }
  5181. else if (!includes(seen, computed, comparator)) {
  5182. if (seen !== result) {
  5183. seen.push(computed);
  5184. }
  5185. result.push(value);
  5186. }
  5187. }
  5188. return result;
  5189. }
  5190. /**
  5191. * The base implementation of `_.unset`.
  5192. *
  5193. * @private
  5194. * @param {Object} object The object to modify.
  5195. * @param {Array|string} path The property path to unset.
  5196. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5197. */
  5198. function baseUnset(object, path) {
  5199. path = castPath(path, object);
  5200. object = parent(object, path);
  5201. return object == null || delete object[toKey(last(path))];
  5202. }
  5203. /**
  5204. * The base implementation of `_.update`.
  5205. *
  5206. * @private
  5207. * @param {Object} object The object to modify.
  5208. * @param {Array|string} path The path of the property to update.
  5209. * @param {Function} updater The function to produce the updated value.
  5210. * @param {Function} [customizer] The function to customize path creation.
  5211. * @returns {Object} Returns `object`.
  5212. */
  5213. function baseUpdate(object, path, updater, customizer) {
  5214. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5215. }
  5216. /**
  5217. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5218. * without support for iteratee shorthands.
  5219. *
  5220. * @private
  5221. * @param {Array} array The array to query.
  5222. * @param {Function} predicate The function invoked per iteration.
  5223. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5224. * @param {boolean} [fromRight] Specify iterating from right to left.
  5225. * @returns {Array} Returns the slice of `array`.
  5226. */
  5227. function baseWhile(array, predicate, isDrop, fromRight) {
  5228. var length = array.length,
  5229. index = fromRight ? length : -1;
  5230. while ((fromRight ? index-- : ++index < length) &&
  5231. predicate(array[index], index, array)) {}
  5232. return isDrop
  5233. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5234. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5235. }
  5236. /**
  5237. * The base implementation of `wrapperValue` which returns the result of
  5238. * performing a sequence of actions on the unwrapped `value`, where each
  5239. * successive action is supplied the return value of the previous.
  5240. *
  5241. * @private
  5242. * @param {*} value The unwrapped value.
  5243. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5244. * @returns {*} Returns the resolved value.
  5245. */
  5246. function baseWrapperValue(value, actions) {
  5247. var result = value;
  5248. if (result instanceof LazyWrapper) {
  5249. result = result.value();
  5250. }
  5251. return arrayReduce(actions, function(result, action) {
  5252. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5253. }, result);
  5254. }
  5255. /**
  5256. * The base implementation of methods like `_.xor`, without support for
  5257. * iteratee shorthands, that accepts an array of arrays to inspect.
  5258. *
  5259. * @private
  5260. * @param {Array} arrays The arrays to inspect.
  5261. * @param {Function} [iteratee] The iteratee invoked per element.
  5262. * @param {Function} [comparator] The comparator invoked per element.
  5263. * @returns {Array} Returns the new array of values.
  5264. */
  5265. function baseXor(arrays, iteratee, comparator) {
  5266. var length = arrays.length;
  5267. if (length < 2) {
  5268. return length ? baseUniq(arrays[0]) : [];
  5269. }
  5270. var index = -1,
  5271. result = Array(length);
  5272. while (++index < length) {
  5273. var array = arrays[index],
  5274. othIndex = -1;
  5275. while (++othIndex < length) {
  5276. if (othIndex != index) {
  5277. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5278. }
  5279. }
  5280. }
  5281. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5282. }
  5283. /**
  5284. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5285. *
  5286. * @private
  5287. * @param {Array} props The property identifiers.
  5288. * @param {Array} values The property values.
  5289. * @param {Function} assignFunc The function to assign values.
  5290. * @returns {Object} Returns the new object.
  5291. */
  5292. function baseZipObject(props, values, assignFunc) {
  5293. var index = -1,
  5294. length = props.length,
  5295. valsLength = values.length,
  5296. result = {};
  5297. while (++index < length) {
  5298. var value = index < valsLength ? values[index] : undefined;
  5299. assignFunc(result, props[index], value);
  5300. }
  5301. return result;
  5302. }
  5303. /**
  5304. * Casts `value` to an empty array if it's not an array like object.
  5305. *
  5306. * @private
  5307. * @param {*} value The value to inspect.
  5308. * @returns {Array|Object} Returns the cast array-like object.
  5309. */
  5310. function castArrayLikeObject(value) {
  5311. return isArrayLikeObject(value) ? value : [];
  5312. }
  5313. /**
  5314. * Casts `value` to `identity` if it's not a function.
  5315. *
  5316. * @private
  5317. * @param {*} value The value to inspect.
  5318. * @returns {Function} Returns cast function.
  5319. */
  5320. function castFunction(value) {
  5321. return typeof value == 'function' ? value : identity;
  5322. }
  5323. /**
  5324. * Casts `value` to a path array if it's not one.
  5325. *
  5326. * @private
  5327. * @param {*} value The value to inspect.
  5328. * @param {Object} [object] The object to query keys on.
  5329. * @returns {Array} Returns the cast property path array.
  5330. */
  5331. function castPath(value, object) {
  5332. if (isArray(value)) {
  5333. return value;
  5334. }
  5335. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5336. }
  5337. /**
  5338. * A `baseRest` alias which can be replaced with `identity` by module
  5339. * replacement plugins.
  5340. *
  5341. * @private
  5342. * @type {Function}
  5343. * @param {Function} func The function to apply a rest parameter to.
  5344. * @returns {Function} Returns the new function.
  5345. */
  5346. var castRest = baseRest;
  5347. /**
  5348. * Casts `array` to a slice if it's needed.
  5349. *
  5350. * @private
  5351. * @param {Array} array The array to inspect.
  5352. * @param {number} start The start position.
  5353. * @param {number} [end=array.length] The end position.
  5354. * @returns {Array} Returns the cast slice.
  5355. */
  5356. function castSlice(array, start, end) {
  5357. var length = array.length;
  5358. end = end === undefined ? length : end;
  5359. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5360. }
  5361. /**
  5362. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5363. *
  5364. * @private
  5365. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5366. */
  5367. var clearTimeout = ctxClearTimeout || function(id) {
  5368. return root.clearTimeout(id);
  5369. };
  5370. /**
  5371. * Creates a clone of `buffer`.
  5372. *
  5373. * @private
  5374. * @param {Buffer} buffer The buffer to clone.
  5375. * @param {boolean} [isDeep] Specify a deep clone.
  5376. * @returns {Buffer} Returns the cloned buffer.
  5377. */
  5378. function cloneBuffer(buffer, isDeep) {
  5379. if (isDeep) {
  5380. return buffer.slice();
  5381. }
  5382. var length = buffer.length,
  5383. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5384. buffer.copy(result);
  5385. return result;
  5386. }
  5387. /**
  5388. * Creates a clone of `arrayBuffer`.
  5389. *
  5390. * @private
  5391. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5392. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5393. */
  5394. function cloneArrayBuffer(arrayBuffer) {
  5395. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5396. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5397. return result;
  5398. }
  5399. /**
  5400. * Creates a clone of `dataView`.
  5401. *
  5402. * @private
  5403. * @param {Object} dataView The data view to clone.
  5404. * @param {boolean} [isDeep] Specify a deep clone.
  5405. * @returns {Object} Returns the cloned data view.
  5406. */
  5407. function cloneDataView(dataView, isDeep) {
  5408. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5409. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5410. }
  5411. /**
  5412. * Creates a clone of `regexp`.
  5413. *
  5414. * @private
  5415. * @param {Object} regexp The regexp to clone.
  5416. * @returns {Object} Returns the cloned regexp.
  5417. */
  5418. function cloneRegExp(regexp) {
  5419. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5420. result.lastIndex = regexp.lastIndex;
  5421. return result;
  5422. }
  5423. /**
  5424. * Creates a clone of the `symbol` object.
  5425. *
  5426. * @private
  5427. * @param {Object} symbol The symbol object to clone.
  5428. * @returns {Object} Returns the cloned symbol object.
  5429. */
  5430. function cloneSymbol(symbol) {
  5431. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5432. }
  5433. /**
  5434. * Creates a clone of `typedArray`.
  5435. *
  5436. * @private
  5437. * @param {Object} typedArray The typed array to clone.
  5438. * @param {boolean} [isDeep] Specify a deep clone.
  5439. * @returns {Object} Returns the cloned typed array.
  5440. */
  5441. function cloneTypedArray(typedArray, isDeep) {
  5442. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5443. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5444. }
  5445. /**
  5446. * Compares values to sort them in ascending order.
  5447. *
  5448. * @private
  5449. * @param {*} value The value to compare.
  5450. * @param {*} other The other value to compare.
  5451. * @returns {number} Returns the sort order indicator for `value`.
  5452. */
  5453. function compareAscending(value, other) {
  5454. if (value !== other) {
  5455. var valIsDefined = value !== undefined,
  5456. valIsNull = value === null,
  5457. valIsReflexive = value === value,
  5458. valIsSymbol = isSymbol(value);
  5459. var othIsDefined = other !== undefined,
  5460. othIsNull = other === null,
  5461. othIsReflexive = other === other,
  5462. othIsSymbol = isSymbol(other);
  5463. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5464. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5465. (valIsNull && othIsDefined && othIsReflexive) ||
  5466. (!valIsDefined && othIsReflexive) ||
  5467. !valIsReflexive) {
  5468. return 1;
  5469. }
  5470. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5471. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5472. (othIsNull && valIsDefined && valIsReflexive) ||
  5473. (!othIsDefined && valIsReflexive) ||
  5474. !othIsReflexive) {
  5475. return -1;
  5476. }
  5477. }
  5478. return 0;
  5479. }
  5480. /**
  5481. * Used by `_.orderBy` to compare multiple properties of a value to another
  5482. * and stable sort them.
  5483. *
  5484. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5485. * specify an order of "desc" for descending or "asc" for ascending sort order
  5486. * of corresponding values.
  5487. *
  5488. * @private
  5489. * @param {Object} object The object to compare.
  5490. * @param {Object} other The other object to compare.
  5491. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5492. * @returns {number} Returns the sort order indicator for `object`.
  5493. */
  5494. function compareMultiple(object, other, orders) {
  5495. var index = -1,
  5496. objCriteria = object.criteria,
  5497. othCriteria = other.criteria,
  5498. length = objCriteria.length,
  5499. ordersLength = orders.length;
  5500. while (++index < length) {
  5501. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5502. if (result) {
  5503. if (index >= ordersLength) {
  5504. return result;
  5505. }
  5506. var order = orders[index];
  5507. return result * (order == 'desc' ? -1 : 1);
  5508. }
  5509. }
  5510. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5511. // that causes it, under certain circumstances, to provide the same value for
  5512. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5513. // for more details.
  5514. //
  5515. // This also ensures a stable sort in V8 and other engines.
  5516. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5517. return object.index - other.index;
  5518. }
  5519. /**
  5520. * Creates an array that is the composition of partially applied arguments,
  5521. * placeholders, and provided arguments into a single array of arguments.
  5522. *
  5523. * @private
  5524. * @param {Array} args The provided arguments.
  5525. * @param {Array} partials The arguments to prepend to those provided.
  5526. * @param {Array} holders The `partials` placeholder indexes.
  5527. * @params {boolean} [isCurried] Specify composing for a curried function.
  5528. * @returns {Array} Returns the new array of composed arguments.
  5529. */
  5530. function composeArgs(args, partials, holders, isCurried) {
  5531. var argsIndex = -1,
  5532. argsLength = args.length,
  5533. holdersLength = holders.length,
  5534. leftIndex = -1,
  5535. leftLength = partials.length,
  5536. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5537. result = Array(leftLength + rangeLength),
  5538. isUncurried = !isCurried;
  5539. while (++leftIndex < leftLength) {
  5540. result[leftIndex] = partials[leftIndex];
  5541. }
  5542. while (++argsIndex < holdersLength) {
  5543. if (isUncurried || argsIndex < argsLength) {
  5544. result[holders[argsIndex]] = args[argsIndex];
  5545. }
  5546. }
  5547. while (rangeLength--) {
  5548. result[leftIndex++] = args[argsIndex++];
  5549. }
  5550. return result;
  5551. }
  5552. /**
  5553. * This function is like `composeArgs` except that the arguments composition
  5554. * is tailored for `_.partialRight`.
  5555. *
  5556. * @private
  5557. * @param {Array} args The provided arguments.
  5558. * @param {Array} partials The arguments to append to those provided.
  5559. * @param {Array} holders The `partials` placeholder indexes.
  5560. * @params {boolean} [isCurried] Specify composing for a curried function.
  5561. * @returns {Array} Returns the new array of composed arguments.
  5562. */
  5563. function composeArgsRight(args, partials, holders, isCurried) {
  5564. var argsIndex = -1,
  5565. argsLength = args.length,
  5566. holdersIndex = -1,
  5567. holdersLength = holders.length,
  5568. rightIndex = -1,
  5569. rightLength = partials.length,
  5570. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5571. result = Array(rangeLength + rightLength),
  5572. isUncurried = !isCurried;
  5573. while (++argsIndex < rangeLength) {
  5574. result[argsIndex] = args[argsIndex];
  5575. }
  5576. var offset = argsIndex;
  5577. while (++rightIndex < rightLength) {
  5578. result[offset + rightIndex] = partials[rightIndex];
  5579. }
  5580. while (++holdersIndex < holdersLength) {
  5581. if (isUncurried || argsIndex < argsLength) {
  5582. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5583. }
  5584. }
  5585. return result;
  5586. }
  5587. /**
  5588. * Copies the values of `source` to `array`.
  5589. *
  5590. * @private
  5591. * @param {Array} source The array to copy values from.
  5592. * @param {Array} [array=[]] The array to copy values to.
  5593. * @returns {Array} Returns `array`.
  5594. */
  5595. function copyArray(source, array) {
  5596. var index = -1,
  5597. length = source.length;
  5598. array || (array = Array(length));
  5599. while (++index < length) {
  5600. array[index] = source[index];
  5601. }
  5602. return array;
  5603. }
  5604. /**
  5605. * Copies properties of `source` to `object`.
  5606. *
  5607. * @private
  5608. * @param {Object} source The object to copy properties from.
  5609. * @param {Array} props The property identifiers to copy.
  5610. * @param {Object} [object={}] The object to copy properties to.
  5611. * @param {Function} [customizer] The function to customize copied values.
  5612. * @returns {Object} Returns `object`.
  5613. */
  5614. function copyObject(source, props, object, customizer) {
  5615. var isNew = !object;
  5616. object || (object = {});
  5617. var index = -1,
  5618. length = props.length;
  5619. while (++index < length) {
  5620. var key = props[index];
  5621. var newValue = customizer
  5622. ? customizer(object[key], source[key], key, object, source)
  5623. : undefined;
  5624. if (newValue === undefined) {
  5625. newValue = source[key];
  5626. }
  5627. if (isNew) {
  5628. baseAssignValue(object, key, newValue);
  5629. } else {
  5630. assignValue(object, key, newValue);
  5631. }
  5632. }
  5633. return object;
  5634. }
  5635. /**
  5636. * Copies own symbols of `source` to `object`.
  5637. *
  5638. * @private
  5639. * @param {Object} source The object to copy symbols from.
  5640. * @param {Object} [object={}] The object to copy symbols to.
  5641. * @returns {Object} Returns `object`.
  5642. */
  5643. function copySymbols(source, object) {
  5644. return copyObject(source, getSymbols(source), object);
  5645. }
  5646. /**
  5647. * Copies own and inherited symbols of `source` to `object`.
  5648. *
  5649. * @private
  5650. * @param {Object} source The object to copy symbols from.
  5651. * @param {Object} [object={}] The object to copy symbols to.
  5652. * @returns {Object} Returns `object`.
  5653. */
  5654. function copySymbolsIn(source, object) {
  5655. return copyObject(source, getSymbolsIn(source), object);
  5656. }
  5657. /**
  5658. * Creates a function like `_.groupBy`.
  5659. *
  5660. * @private
  5661. * @param {Function} setter The function to set accumulator values.
  5662. * @param {Function} [initializer] The accumulator object initializer.
  5663. * @returns {Function} Returns the new aggregator function.
  5664. */
  5665. function createAggregator(setter, initializer) {
  5666. return function(collection, iteratee) {
  5667. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5668. accumulator = initializer ? initializer() : {};
  5669. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5670. };
  5671. }
  5672. /**
  5673. * Creates a function like `_.assign`.
  5674. *
  5675. * @private
  5676. * @param {Function} assigner The function to assign values.
  5677. * @returns {Function} Returns the new assigner function.
  5678. */
  5679. function createAssigner(assigner) {
  5680. return baseRest(function(object, sources) {
  5681. var index = -1,
  5682. length = sources.length,
  5683. customizer = length > 1 ? sources[length - 1] : undefined,
  5684. guard = length > 2 ? sources[2] : undefined;
  5685. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5686. ? (length--, customizer)
  5687. : undefined;
  5688. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5689. customizer = length < 3 ? undefined : customizer;
  5690. length = 1;
  5691. }
  5692. object = Object(object);
  5693. while (++index < length) {
  5694. var source = sources[index];
  5695. if (source) {
  5696. assigner(object, source, index, customizer);
  5697. }
  5698. }
  5699. return object;
  5700. });
  5701. }
  5702. /**
  5703. * Creates a `baseEach` or `baseEachRight` function.
  5704. *
  5705. * @private
  5706. * @param {Function} eachFunc The function to iterate over a collection.
  5707. * @param {boolean} [fromRight] Specify iterating from right to left.
  5708. * @returns {Function} Returns the new base function.
  5709. */
  5710. function createBaseEach(eachFunc, fromRight) {
  5711. return function(collection, iteratee) {
  5712. if (collection == null) {
  5713. return collection;
  5714. }
  5715. if (!isArrayLike(collection)) {
  5716. return eachFunc(collection, iteratee);
  5717. }
  5718. var length = collection.length,
  5719. index = fromRight ? length : -1,
  5720. iterable = Object(collection);
  5721. while ((fromRight ? index-- : ++index < length)) {
  5722. if (iteratee(iterable[index], index, iterable) === false) {
  5723. break;
  5724. }
  5725. }
  5726. return collection;
  5727. };
  5728. }
  5729. /**
  5730. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5731. *
  5732. * @private
  5733. * @param {boolean} [fromRight] Specify iterating from right to left.
  5734. * @returns {Function} Returns the new base function.
  5735. */
  5736. function createBaseFor(fromRight) {
  5737. return function(object, iteratee, keysFunc) {
  5738. var index = -1,
  5739. iterable = Object(object),
  5740. props = keysFunc(object),
  5741. length = props.length;
  5742. while (length--) {
  5743. var key = props[fromRight ? length : ++index];
  5744. if (iteratee(iterable[key], key, iterable) === false) {
  5745. break;
  5746. }
  5747. }
  5748. return object;
  5749. };
  5750. }
  5751. /**
  5752. * Creates a function that wraps `func` to invoke it with the optional `this`
  5753. * binding of `thisArg`.
  5754. *
  5755. * @private
  5756. * @param {Function} func The function to wrap.
  5757. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5758. * @param {*} [thisArg] The `this` binding of `func`.
  5759. * @returns {Function} Returns the new wrapped function.
  5760. */
  5761. function createBind(func, bitmask, thisArg) {
  5762. var isBind = bitmask & WRAP_BIND_FLAG,
  5763. Ctor = createCtor(func);
  5764. function wrapper() {
  5765. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5766. return fn.apply(isBind ? thisArg : this, arguments);
  5767. }
  5768. return wrapper;
  5769. }
  5770. /**
  5771. * Creates a function like `_.lowerFirst`.
  5772. *
  5773. * @private
  5774. * @param {string} methodName The name of the `String` case method to use.
  5775. * @returns {Function} Returns the new case function.
  5776. */
  5777. function createCaseFirst(methodName) {
  5778. return function(string) {
  5779. string = toString(string);
  5780. var strSymbols = hasUnicode(string)
  5781. ? stringToArray(string)
  5782. : undefined;
  5783. var chr = strSymbols
  5784. ? strSymbols[0]
  5785. : string.charAt(0);
  5786. var trailing = strSymbols
  5787. ? castSlice(strSymbols, 1).join('')
  5788. : string.slice(1);
  5789. return chr[methodName]() + trailing;
  5790. };
  5791. }
  5792. /**
  5793. * Creates a function like `_.camelCase`.
  5794. *
  5795. * @private
  5796. * @param {Function} callback The function to combine each word.
  5797. * @returns {Function} Returns the new compounder function.
  5798. */
  5799. function createCompounder(callback) {
  5800. return function(string) {
  5801. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5802. };
  5803. }
  5804. /**
  5805. * Creates a function that produces an instance of `Ctor` regardless of
  5806. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5807. *
  5808. * @private
  5809. * @param {Function} Ctor The constructor to wrap.
  5810. * @returns {Function} Returns the new wrapped function.
  5811. */
  5812. function createCtor(Ctor) {
  5813. return function() {
  5814. // Use a `switch` statement to work with class constructors. See
  5815. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5816. // for more details.
  5817. var args = arguments;
  5818. switch (args.length) {
  5819. case 0: return new Ctor;
  5820. case 1: return new Ctor(args[0]);
  5821. case 2: return new Ctor(args[0], args[1]);
  5822. case 3: return new Ctor(args[0], args[1], args[2]);
  5823. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5824. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5825. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5826. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5827. }
  5828. var thisBinding = baseCreate(Ctor.prototype),
  5829. result = Ctor.apply(thisBinding, args);
  5830. // Mimic the constructor's `return` behavior.
  5831. // See https://es5.github.io/#x13.2.2 for more details.
  5832. return isObject(result) ? result : thisBinding;
  5833. };
  5834. }
  5835. /**
  5836. * Creates a function that wraps `func` to enable currying.
  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 {number} arity The arity of `func`.
  5842. * @returns {Function} Returns the new wrapped function.
  5843. */
  5844. function createCurry(func, bitmask, arity) {
  5845. var Ctor = createCtor(func);
  5846. function wrapper() {
  5847. var length = arguments.length,
  5848. args = Array(length),
  5849. index = length,
  5850. placeholder = getHolder(wrapper);
  5851. while (index--) {
  5852. args[index] = arguments[index];
  5853. }
  5854. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5855. ? []
  5856. : replaceHolders(args, placeholder);
  5857. length -= holders.length;
  5858. if (length < arity) {
  5859. return createRecurry(
  5860. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5861. args, holders, undefined, undefined, arity - length);
  5862. }
  5863. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5864. return apply(fn, this, args);
  5865. }
  5866. return wrapper;
  5867. }
  5868. /**
  5869. * Creates a `_.find` or `_.findLast` function.
  5870. *
  5871. * @private
  5872. * @param {Function} findIndexFunc The function to find the collection index.
  5873. * @returns {Function} Returns the new find function.
  5874. */
  5875. function createFind(findIndexFunc) {
  5876. return function(collection, predicate, fromIndex) {
  5877. var iterable = Object(collection);
  5878. if (!isArrayLike(collection)) {
  5879. var iteratee = getIteratee(predicate, 3);
  5880. collection = keys(collection);
  5881. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5882. }
  5883. var index = findIndexFunc(collection, predicate, fromIndex);
  5884. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5885. };
  5886. }
  5887. /**
  5888. * Creates a `_.flow` or `_.flowRight` function.
  5889. *
  5890. * @private
  5891. * @param {boolean} [fromRight] Specify iterating from right to left.
  5892. * @returns {Function} Returns the new flow function.
  5893. */
  5894. function createFlow(fromRight) {
  5895. return flatRest(function(funcs) {
  5896. var length = funcs.length,
  5897. index = length,
  5898. prereq = LodashWrapper.prototype.thru;
  5899. if (fromRight) {
  5900. funcs.reverse();
  5901. }
  5902. while (index--) {
  5903. var func = funcs[index];
  5904. if (typeof func != 'function') {
  5905. throw new TypeError(FUNC_ERROR_TEXT);
  5906. }
  5907. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5908. var wrapper = new LodashWrapper([], true);
  5909. }
  5910. }
  5911. index = wrapper ? index : length;
  5912. while (++index < length) {
  5913. func = funcs[index];
  5914. var funcName = getFuncName(func),
  5915. data = funcName == 'wrapper' ? getData(func) : undefined;
  5916. if (data && isLaziable(data[0]) &&
  5917. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5918. !data[4].length && data[9] == 1
  5919. ) {
  5920. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5921. } else {
  5922. wrapper = (func.length == 1 && isLaziable(func))
  5923. ? wrapper[funcName]()
  5924. : wrapper.thru(func);
  5925. }
  5926. }
  5927. return function() {
  5928. var args = arguments,
  5929. value = args[0];
  5930. if (wrapper && args.length == 1 && isArray(value)) {
  5931. return wrapper.plant(value).value();
  5932. }
  5933. var index = 0,
  5934. result = length ? funcs[index].apply(this, args) : value;
  5935. while (++index < length) {
  5936. result = funcs[index].call(this, result);
  5937. }
  5938. return result;
  5939. };
  5940. });
  5941. }
  5942. /**
  5943. * Creates a function that wraps `func` to invoke it with optional `this`
  5944. * binding of `thisArg`, partial application, and currying.
  5945. *
  5946. * @private
  5947. * @param {Function|string} func The function or method name to wrap.
  5948. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5949. * @param {*} [thisArg] The `this` binding of `func`.
  5950. * @param {Array} [partials] The arguments to prepend to those provided to
  5951. * the new function.
  5952. * @param {Array} [holders] The `partials` placeholder indexes.
  5953. * @param {Array} [partialsRight] The arguments to append to those provided
  5954. * to the new function.
  5955. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5956. * @param {Array} [argPos] The argument positions of the new function.
  5957. * @param {number} [ary] The arity cap of `func`.
  5958. * @param {number} [arity] The arity of `func`.
  5959. * @returns {Function} Returns the new wrapped function.
  5960. */
  5961. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5962. var isAry = bitmask & WRAP_ARY_FLAG,
  5963. isBind = bitmask & WRAP_BIND_FLAG,
  5964. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5965. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5966. isFlip = bitmask & WRAP_FLIP_FLAG,
  5967. Ctor = isBindKey ? undefined : createCtor(func);
  5968. function wrapper() {
  5969. var length = arguments.length,
  5970. args = Array(length),
  5971. index = length;
  5972. while (index--) {
  5973. args[index] = arguments[index];
  5974. }
  5975. if (isCurried) {
  5976. var placeholder = getHolder(wrapper),
  5977. holdersCount = countHolders(args, placeholder);
  5978. }
  5979. if (partials) {
  5980. args = composeArgs(args, partials, holders, isCurried);
  5981. }
  5982. if (partialsRight) {
  5983. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5984. }
  5985. length -= holdersCount;
  5986. if (isCurried && length < arity) {
  5987. var newHolders = replaceHolders(args, placeholder);
  5988. return createRecurry(
  5989. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5990. args, newHolders, argPos, ary, arity - length
  5991. );
  5992. }
  5993. var thisBinding = isBind ? thisArg : this,
  5994. fn = isBindKey ? thisBinding[func] : func;
  5995. length = args.length;
  5996. if (argPos) {
  5997. args = reorder(args, argPos);
  5998. } else if (isFlip && length > 1) {
  5999. args.reverse();
  6000. }
  6001. if (isAry && ary < length) {
  6002. args.length = ary;
  6003. }
  6004. if (this && this !== root && this instanceof wrapper) {
  6005. fn = Ctor || createCtor(fn);
  6006. }
  6007. return fn.apply(thisBinding, args);
  6008. }
  6009. return wrapper;
  6010. }
  6011. /**
  6012. * Creates a function like `_.invertBy`.
  6013. *
  6014. * @private
  6015. * @param {Function} setter The function to set accumulator values.
  6016. * @param {Function} toIteratee The function to resolve iteratees.
  6017. * @returns {Function} Returns the new inverter function.
  6018. */
  6019. function createInverter(setter, toIteratee) {
  6020. return function(object, iteratee) {
  6021. return baseInverter(object, setter, toIteratee(iteratee), {});
  6022. };
  6023. }
  6024. /**
  6025. * Creates a function that performs a mathematical operation on two values.
  6026. *
  6027. * @private
  6028. * @param {Function} operator The function to perform the operation.
  6029. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6030. * @returns {Function} Returns the new mathematical operation function.
  6031. */
  6032. function createMathOperation(operator, defaultValue) {
  6033. return function(value, other) {
  6034. var result;
  6035. if (value === undefined && other === undefined) {
  6036. return defaultValue;
  6037. }
  6038. if (value !== undefined) {
  6039. result = value;
  6040. }
  6041. if (other !== undefined) {
  6042. if (result === undefined) {
  6043. return other;
  6044. }
  6045. if (typeof value == 'string' || typeof other == 'string') {
  6046. value = baseToString(value);
  6047. other = baseToString(other);
  6048. } else {
  6049. value = baseToNumber(value);
  6050. other = baseToNumber(other);
  6051. }
  6052. result = operator(value, other);
  6053. }
  6054. return result;
  6055. };
  6056. }
  6057. /**
  6058. * Creates a function like `_.over`.
  6059. *
  6060. * @private
  6061. * @param {Function} arrayFunc The function to iterate over iteratees.
  6062. * @returns {Function} Returns the new over function.
  6063. */
  6064. function createOver(arrayFunc) {
  6065. return flatRest(function(iteratees) {
  6066. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6067. return baseRest(function(args) {
  6068. var thisArg = this;
  6069. return arrayFunc(iteratees, function(iteratee) {
  6070. return apply(iteratee, thisArg, args);
  6071. });
  6072. });
  6073. });
  6074. }
  6075. /**
  6076. * Creates the padding for `string` based on `length`. The `chars` string
  6077. * is truncated if the number of characters exceeds `length`.
  6078. *
  6079. * @private
  6080. * @param {number} length The padding length.
  6081. * @param {string} [chars=' '] The string used as padding.
  6082. * @returns {string} Returns the padding for `string`.
  6083. */
  6084. function createPadding(length, chars) {
  6085. chars = chars === undefined ? ' ' : baseToString(chars);
  6086. var charsLength = chars.length;
  6087. if (charsLength < 2) {
  6088. return charsLength ? baseRepeat(chars, length) : chars;
  6089. }
  6090. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6091. return hasUnicode(chars)
  6092. ? castSlice(stringToArray(result), 0, length).join('')
  6093. : result.slice(0, length);
  6094. }
  6095. /**
  6096. * Creates a function that wraps `func` to invoke it with the `this` binding
  6097. * of `thisArg` and `partials` prepended to the arguments it receives.
  6098. *
  6099. * @private
  6100. * @param {Function} func The function to wrap.
  6101. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6102. * @param {*} thisArg The `this` binding of `func`.
  6103. * @param {Array} partials The arguments to prepend to those provided to
  6104. * the new function.
  6105. * @returns {Function} Returns the new wrapped function.
  6106. */
  6107. function createPartial(func, bitmask, thisArg, partials) {
  6108. var isBind = bitmask & WRAP_BIND_FLAG,
  6109. Ctor = createCtor(func);
  6110. function wrapper() {
  6111. var argsIndex = -1,
  6112. argsLength = arguments.length,
  6113. leftIndex = -1,
  6114. leftLength = partials.length,
  6115. args = Array(leftLength + argsLength),
  6116. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6117. while (++leftIndex < leftLength) {
  6118. args[leftIndex] = partials[leftIndex];
  6119. }
  6120. while (argsLength--) {
  6121. args[leftIndex++] = arguments[++argsIndex];
  6122. }
  6123. return apply(fn, isBind ? thisArg : this, args);
  6124. }
  6125. return wrapper;
  6126. }
  6127. /**
  6128. * Creates a `_.range` or `_.rangeRight` function.
  6129. *
  6130. * @private
  6131. * @param {boolean} [fromRight] Specify iterating from right to left.
  6132. * @returns {Function} Returns the new range function.
  6133. */
  6134. function createRange(fromRight) {
  6135. return function(start, end, step) {
  6136. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6137. end = step = undefined;
  6138. }
  6139. // Ensure the sign of `-0` is preserved.
  6140. start = toFinite(start);
  6141. if (end === undefined) {
  6142. end = start;
  6143. start = 0;
  6144. } else {
  6145. end = toFinite(end);
  6146. }
  6147. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6148. return baseRange(start, end, step, fromRight);
  6149. };
  6150. }
  6151. /**
  6152. * Creates a function that performs a relational operation on two values.
  6153. *
  6154. * @private
  6155. * @param {Function} operator The function to perform the operation.
  6156. * @returns {Function} Returns the new relational operation function.
  6157. */
  6158. function createRelationalOperation(operator) {
  6159. return function(value, other) {
  6160. if (!(typeof value == 'string' && typeof other == 'string')) {
  6161. value = toNumber(value);
  6162. other = toNumber(other);
  6163. }
  6164. return operator(value, other);
  6165. };
  6166. }
  6167. /**
  6168. * Creates a function that wraps `func` to continue currying.
  6169. *
  6170. * @private
  6171. * @param {Function} func The function to wrap.
  6172. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6173. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6174. * @param {*} placeholder The placeholder value.
  6175. * @param {*} [thisArg] The `this` binding of `func`.
  6176. * @param {Array} [partials] The arguments to prepend to those provided to
  6177. * the new function.
  6178. * @param {Array} [holders] The `partials` placeholder indexes.
  6179. * @param {Array} [argPos] The argument positions of the new function.
  6180. * @param {number} [ary] The arity cap of `func`.
  6181. * @param {number} [arity] The arity of `func`.
  6182. * @returns {Function} Returns the new wrapped function.
  6183. */
  6184. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6185. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6186. newHolders = isCurry ? holders : undefined,
  6187. newHoldersRight = isCurry ? undefined : holders,
  6188. newPartials = isCurry ? partials : undefined,
  6189. newPartialsRight = isCurry ? undefined : partials;
  6190. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6191. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6192. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6193. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6194. }
  6195. var newData = [
  6196. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6197. newHoldersRight, argPos, ary, arity
  6198. ];
  6199. var result = wrapFunc.apply(undefined, newData);
  6200. if (isLaziable(func)) {
  6201. setData(result, newData);
  6202. }
  6203. result.placeholder = placeholder;
  6204. return setWrapToString(result, func, bitmask);
  6205. }
  6206. /**
  6207. * Creates a function like `_.round`.
  6208. *
  6209. * @private
  6210. * @param {string} methodName The name of the `Math` method to use when rounding.
  6211. * @returns {Function} Returns the new round function.
  6212. */
  6213. function createRound(methodName) {
  6214. var func = Math[methodName];
  6215. return function(number, precision) {
  6216. number = toNumber(number);
  6217. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6218. if (precision && nativeIsFinite(number)) {
  6219. // Shift with exponential notation to avoid floating-point issues.
  6220. // See [MDN](https://mdn.io/round#Examples) for more details.
  6221. var pair = (toString(number) + 'e').split('e'),
  6222. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6223. pair = (toString(value) + 'e').split('e');
  6224. return +(pair[0] + 'e' + (+pair[1] - precision));
  6225. }
  6226. return func(number);
  6227. };
  6228. }
  6229. /**
  6230. * Creates a set object of `values`.
  6231. *
  6232. * @private
  6233. * @param {Array} values The values to add to the set.
  6234. * @returns {Object} Returns the new set.
  6235. */
  6236. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6237. return new Set(values);
  6238. };
  6239. /**
  6240. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6241. *
  6242. * @private
  6243. * @param {Function} keysFunc The function to get the keys of a given object.
  6244. * @returns {Function} Returns the new pairs function.
  6245. */
  6246. function createToPairs(keysFunc) {
  6247. return function(object) {
  6248. var tag = getTag(object);
  6249. if (tag == mapTag) {
  6250. return mapToArray(object);
  6251. }
  6252. if (tag == setTag) {
  6253. return setToPairs(object);
  6254. }
  6255. return baseToPairs(object, keysFunc(object));
  6256. };
  6257. }
  6258. /**
  6259. * Creates a function that either curries or invokes `func` with optional
  6260. * `this` binding and partially applied arguments.
  6261. *
  6262. * @private
  6263. * @param {Function|string} func The function or method name to wrap.
  6264. * @param {number} bitmask The bitmask flags.
  6265. * 1 - `_.bind`
  6266. * 2 - `_.bindKey`
  6267. * 4 - `_.curry` or `_.curryRight` of a bound function
  6268. * 8 - `_.curry`
  6269. * 16 - `_.curryRight`
  6270. * 32 - `_.partial`
  6271. * 64 - `_.partialRight`
  6272. * 128 - `_.rearg`
  6273. * 256 - `_.ary`
  6274. * 512 - `_.flip`
  6275. * @param {*} [thisArg] The `this` binding of `func`.
  6276. * @param {Array} [partials] The arguments to be partially applied.
  6277. * @param {Array} [holders] The `partials` placeholder indexes.
  6278. * @param {Array} [argPos] The argument positions of the new function.
  6279. * @param {number} [ary] The arity cap of `func`.
  6280. * @param {number} [arity] The arity of `func`.
  6281. * @returns {Function} Returns the new wrapped function.
  6282. */
  6283. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6284. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6285. if (!isBindKey && typeof func != 'function') {
  6286. throw new TypeError(FUNC_ERROR_TEXT);
  6287. }
  6288. var length = partials ? partials.length : 0;
  6289. if (!length) {
  6290. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6291. partials = holders = undefined;
  6292. }
  6293. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6294. arity = arity === undefined ? arity : toInteger(arity);
  6295. length -= holders ? holders.length : 0;
  6296. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6297. var partialsRight = partials,
  6298. holdersRight = holders;
  6299. partials = holders = undefined;
  6300. }
  6301. var data = isBindKey ? undefined : getData(func);
  6302. var newData = [
  6303. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6304. argPos, ary, arity
  6305. ];
  6306. if (data) {
  6307. mergeData(newData, data);
  6308. }
  6309. func = newData[0];
  6310. bitmask = newData[1];
  6311. thisArg = newData[2];
  6312. partials = newData[3];
  6313. holders = newData[4];
  6314. arity = newData[9] = newData[9] === undefined
  6315. ? (isBindKey ? 0 : func.length)
  6316. : nativeMax(newData[9] - length, 0);
  6317. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6318. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6319. }
  6320. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6321. var result = createBind(func, bitmask, thisArg);
  6322. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6323. result = createCurry(func, bitmask, arity);
  6324. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6325. result = createPartial(func, bitmask, thisArg, partials);
  6326. } else {
  6327. result = createHybrid.apply(undefined, newData);
  6328. }
  6329. var setter = data ? baseSetData : setData;
  6330. return setWrapToString(setter(result, newData), func, bitmask);
  6331. }
  6332. /**
  6333. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6334. * of source objects to the destination object for all destination properties
  6335. * that resolve to `undefined`.
  6336. *
  6337. * @private
  6338. * @param {*} objValue The destination value.
  6339. * @param {*} srcValue The source value.
  6340. * @param {string} key The key of the property to assign.
  6341. * @param {Object} object The parent object of `objValue`.
  6342. * @returns {*} Returns the value to assign.
  6343. */
  6344. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6345. if (objValue === undefined ||
  6346. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6347. return srcValue;
  6348. }
  6349. return objValue;
  6350. }
  6351. /**
  6352. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6353. * objects into destination objects that are passed thru.
  6354. *
  6355. * @private
  6356. * @param {*} objValue The destination value.
  6357. * @param {*} srcValue The source value.
  6358. * @param {string} key The key of the property to merge.
  6359. * @param {Object} object The parent object of `objValue`.
  6360. * @param {Object} source The parent object of `srcValue`.
  6361. * @param {Object} [stack] Tracks traversed source values and their merged
  6362. * counterparts.
  6363. * @returns {*} Returns the value to assign.
  6364. */
  6365. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6366. if (isObject(objValue) && isObject(srcValue)) {
  6367. // Recursively merge objects and arrays (susceptible to call stack limits).
  6368. stack.set(srcValue, objValue);
  6369. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6370. stack['delete'](srcValue);
  6371. }
  6372. return objValue;
  6373. }
  6374. /**
  6375. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6376. * objects.
  6377. *
  6378. * @private
  6379. * @param {*} value The value to inspect.
  6380. * @param {string} key The key of the property to inspect.
  6381. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6382. */
  6383. function customOmitClone(value) {
  6384. return isPlainObject(value) ? undefined : value;
  6385. }
  6386. /**
  6387. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6388. * partial deep comparisons.
  6389. *
  6390. * @private
  6391. * @param {Array} array The array to compare.
  6392. * @param {Array} other The other array to compare.
  6393. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6394. * @param {Function} customizer The function to customize comparisons.
  6395. * @param {Function} equalFunc The function to determine equivalents of values.
  6396. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6397. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6398. */
  6399. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6400. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6401. arrLength = array.length,
  6402. othLength = other.length;
  6403. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6404. return false;
  6405. }
  6406. // Check that cyclic values are equal.
  6407. var arrStacked = stack.get(array);
  6408. var othStacked = stack.get(other);
  6409. if (arrStacked && othStacked) {
  6410. return arrStacked == other && othStacked == array;
  6411. }
  6412. var index = -1,
  6413. result = true,
  6414. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6415. stack.set(array, other);
  6416. stack.set(other, array);
  6417. // Ignore non-index properties.
  6418. while (++index < arrLength) {
  6419. var arrValue = array[index],
  6420. othValue = other[index];
  6421. if (customizer) {
  6422. var compared = isPartial
  6423. ? customizer(othValue, arrValue, index, other, array, stack)
  6424. : customizer(arrValue, othValue, index, array, other, stack);
  6425. }
  6426. if (compared !== undefined) {
  6427. if (compared) {
  6428. continue;
  6429. }
  6430. result = false;
  6431. break;
  6432. }
  6433. // Recursively compare arrays (susceptible to call stack limits).
  6434. if (seen) {
  6435. if (!arraySome(other, function(othValue, othIndex) {
  6436. if (!cacheHas(seen, othIndex) &&
  6437. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6438. return seen.push(othIndex);
  6439. }
  6440. })) {
  6441. result = false;
  6442. break;
  6443. }
  6444. } else if (!(
  6445. arrValue === othValue ||
  6446. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6447. )) {
  6448. result = false;
  6449. break;
  6450. }
  6451. }
  6452. stack['delete'](array);
  6453. stack['delete'](other);
  6454. return result;
  6455. }
  6456. /**
  6457. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6458. * the same `toStringTag`.
  6459. *
  6460. * **Note:** This function only supports comparing values with tags of
  6461. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6462. *
  6463. * @private
  6464. * @param {Object} object The object to compare.
  6465. * @param {Object} other The other object to compare.
  6466. * @param {string} tag The `toStringTag` of the objects to compare.
  6467. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6468. * @param {Function} customizer The function to customize comparisons.
  6469. * @param {Function} equalFunc The function to determine equivalents of values.
  6470. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6471. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6472. */
  6473. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6474. switch (tag) {
  6475. case dataViewTag:
  6476. if ((object.byteLength != other.byteLength) ||
  6477. (object.byteOffset != other.byteOffset)) {
  6478. return false;
  6479. }
  6480. object = object.buffer;
  6481. other = other.buffer;
  6482. case arrayBufferTag:
  6483. if ((object.byteLength != other.byteLength) ||
  6484. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6485. return false;
  6486. }
  6487. return true;
  6488. case boolTag:
  6489. case dateTag:
  6490. case numberTag:
  6491. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6492. // Invalid dates are coerced to `NaN`.
  6493. return eq(+object, +other);
  6494. case errorTag:
  6495. return object.name == other.name && object.message == other.message;
  6496. case regexpTag:
  6497. case stringTag:
  6498. // Coerce regexes to strings and treat strings, primitives and objects,
  6499. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6500. // for more details.
  6501. return object == (other + '');
  6502. case mapTag:
  6503. var convert = mapToArray;
  6504. case setTag:
  6505. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6506. convert || (convert = setToArray);
  6507. if (object.size != other.size && !isPartial) {
  6508. return false;
  6509. }
  6510. // Assume cyclic values are equal.
  6511. var stacked = stack.get(object);
  6512. if (stacked) {
  6513. return stacked == other;
  6514. }
  6515. bitmask |= COMPARE_UNORDERED_FLAG;
  6516. // Recursively compare objects (susceptible to call stack limits).
  6517. stack.set(object, other);
  6518. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6519. stack['delete'](object);
  6520. return result;
  6521. case symbolTag:
  6522. if (symbolValueOf) {
  6523. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6524. }
  6525. }
  6526. return false;
  6527. }
  6528. /**
  6529. * A specialized version of `baseIsEqualDeep` for objects with support for
  6530. * partial deep comparisons.
  6531. *
  6532. * @private
  6533. * @param {Object} object The object to compare.
  6534. * @param {Object} other The other object to compare.
  6535. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6536. * @param {Function} customizer The function to customize comparisons.
  6537. * @param {Function} equalFunc The function to determine equivalents of values.
  6538. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6539. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6540. */
  6541. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6542. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6543. objProps = getAllKeys(object),
  6544. objLength = objProps.length,
  6545. othProps = getAllKeys(other),
  6546. othLength = othProps.length;
  6547. if (objLength != othLength && !isPartial) {
  6548. return false;
  6549. }
  6550. var index = objLength;
  6551. while (index--) {
  6552. var key = objProps[index];
  6553. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6554. return false;
  6555. }
  6556. }
  6557. // Check that cyclic values are equal.
  6558. var objStacked = stack.get(object);
  6559. var othStacked = stack.get(other);
  6560. if (objStacked && othStacked) {
  6561. return objStacked == other && othStacked == object;
  6562. }
  6563. var result = true;
  6564. stack.set(object, other);
  6565. stack.set(other, object);
  6566. var skipCtor = isPartial;
  6567. while (++index < objLength) {
  6568. key = objProps[index];
  6569. var objValue = object[key],
  6570. othValue = other[key];
  6571. if (customizer) {
  6572. var compared = isPartial
  6573. ? customizer(othValue, objValue, key, other, object, stack)
  6574. : customizer(objValue, othValue, key, object, other, stack);
  6575. }
  6576. // Recursively compare objects (susceptible to call stack limits).
  6577. if (!(compared === undefined
  6578. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6579. : compared
  6580. )) {
  6581. result = false;
  6582. break;
  6583. }
  6584. skipCtor || (skipCtor = key == 'constructor');
  6585. }
  6586. if (result && !skipCtor) {
  6587. var objCtor = object.constructor,
  6588. othCtor = other.constructor;
  6589. // Non `Object` object instances with different constructors are not equal.
  6590. if (objCtor != othCtor &&
  6591. ('constructor' in object && 'constructor' in other) &&
  6592. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6593. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6594. result = false;
  6595. }
  6596. }
  6597. stack['delete'](object);
  6598. stack['delete'](other);
  6599. return result;
  6600. }
  6601. /**
  6602. * A specialized version of `baseRest` which flattens the rest array.
  6603. *
  6604. * @private
  6605. * @param {Function} func The function to apply a rest parameter to.
  6606. * @returns {Function} Returns the new function.
  6607. */
  6608. function flatRest(func) {
  6609. return setToString(overRest(func, undefined, flatten), func + '');
  6610. }
  6611. /**
  6612. * Creates an array of own enumerable property names and symbols of `object`.
  6613. *
  6614. * @private
  6615. * @param {Object} object The object to query.
  6616. * @returns {Array} Returns the array of property names and symbols.
  6617. */
  6618. function getAllKeys(object) {
  6619. return baseGetAllKeys(object, keys, getSymbols);
  6620. }
  6621. /**
  6622. * Creates an array of own and inherited enumerable property names and
  6623. * symbols of `object`.
  6624. *
  6625. * @private
  6626. * @param {Object} object The object to query.
  6627. * @returns {Array} Returns the array of property names and symbols.
  6628. */
  6629. function getAllKeysIn(object) {
  6630. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6631. }
  6632. /**
  6633. * Gets metadata for `func`.
  6634. *
  6635. * @private
  6636. * @param {Function} func The function to query.
  6637. * @returns {*} Returns the metadata for `func`.
  6638. */
  6639. var getData = !metaMap ? noop : function(func) {
  6640. return metaMap.get(func);
  6641. };
  6642. /**
  6643. * Gets the name of `func`.
  6644. *
  6645. * @private
  6646. * @param {Function} func The function to query.
  6647. * @returns {string} Returns the function name.
  6648. */
  6649. function getFuncName(func) {
  6650. var result = (func.name + ''),
  6651. array = realNames[result],
  6652. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6653. while (length--) {
  6654. var data = array[length],
  6655. otherFunc = data.func;
  6656. if (otherFunc == null || otherFunc == func) {
  6657. return data.name;
  6658. }
  6659. }
  6660. return result;
  6661. }
  6662. /**
  6663. * Gets the argument placeholder value for `func`.
  6664. *
  6665. * @private
  6666. * @param {Function} func The function to inspect.
  6667. * @returns {*} Returns the placeholder value.
  6668. */
  6669. function getHolder(func) {
  6670. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6671. return object.placeholder;
  6672. }
  6673. /**
  6674. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6675. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6676. * If arguments are provided, the chosen function is invoked with them and
  6677. * its result is returned.
  6678. *
  6679. * @private
  6680. * @param {*} [value] The value to convert to an iteratee.
  6681. * @param {number} [arity] The arity of the created iteratee.
  6682. * @returns {Function} Returns the chosen function or its result.
  6683. */
  6684. function getIteratee() {
  6685. var result = lodash.iteratee || iteratee;
  6686. result = result === iteratee ? baseIteratee : result;
  6687. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6688. }
  6689. /**
  6690. * Gets the data for `map`.
  6691. *
  6692. * @private
  6693. * @param {Object} map The map to query.
  6694. * @param {string} key The reference key.
  6695. * @returns {*} Returns the map data.
  6696. */
  6697. function getMapData(map, key) {
  6698. var data = map.__data__;
  6699. return isKeyable(key)
  6700. ? data[typeof key == 'string' ? 'string' : 'hash']
  6701. : data.map;
  6702. }
  6703. /**
  6704. * Gets the property names, values, and compare flags of `object`.
  6705. *
  6706. * @private
  6707. * @param {Object} object The object to query.
  6708. * @returns {Array} Returns the match data of `object`.
  6709. */
  6710. function getMatchData(object) {
  6711. var result = keys(object),
  6712. length = result.length;
  6713. while (length--) {
  6714. var key = result[length],
  6715. value = object[key];
  6716. result[length] = [key, value, isStrictComparable(value)];
  6717. }
  6718. return result;
  6719. }
  6720. /**
  6721. * Gets the native function at `key` of `object`.
  6722. *
  6723. * @private
  6724. * @param {Object} object The object to query.
  6725. * @param {string} key The key of the method to get.
  6726. * @returns {*} Returns the function if it's native, else `undefined`.
  6727. */
  6728. function getNative(object, key) {
  6729. var value = getValue(object, key);
  6730. return baseIsNative(value) ? value : undefined;
  6731. }
  6732. /**
  6733. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6734. *
  6735. * @private
  6736. * @param {*} value The value to query.
  6737. * @returns {string} Returns the raw `toStringTag`.
  6738. */
  6739. function getRawTag(value) {
  6740. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6741. tag = value[symToStringTag];
  6742. try {
  6743. value[symToStringTag] = undefined;
  6744. var unmasked = true;
  6745. } catch (e) {}
  6746. var result = nativeObjectToString.call(value);
  6747. if (unmasked) {
  6748. if (isOwn) {
  6749. value[symToStringTag] = tag;
  6750. } else {
  6751. delete value[symToStringTag];
  6752. }
  6753. }
  6754. return result;
  6755. }
  6756. /**
  6757. * Creates an array of the own enumerable symbols of `object`.
  6758. *
  6759. * @private
  6760. * @param {Object} object The object to query.
  6761. * @returns {Array} Returns the array of symbols.
  6762. */
  6763. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6764. if (object == null) {
  6765. return [];
  6766. }
  6767. object = Object(object);
  6768. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6769. return propertyIsEnumerable.call(object, symbol);
  6770. });
  6771. };
  6772. /**
  6773. * Creates an array of the own and inherited enumerable symbols of `object`.
  6774. *
  6775. * @private
  6776. * @param {Object} object The object to query.
  6777. * @returns {Array} Returns the array of symbols.
  6778. */
  6779. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6780. var result = [];
  6781. while (object) {
  6782. arrayPush(result, getSymbols(object));
  6783. object = getPrototype(object);
  6784. }
  6785. return result;
  6786. };
  6787. /**
  6788. * Gets the `toStringTag` of `value`.
  6789. *
  6790. * @private
  6791. * @param {*} value The value to query.
  6792. * @returns {string} Returns the `toStringTag`.
  6793. */
  6794. var getTag = baseGetTag;
  6795. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6796. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6797. (Map && getTag(new Map) != mapTag) ||
  6798. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6799. (Set && getTag(new Set) != setTag) ||
  6800. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6801. getTag = function(value) {
  6802. var result = baseGetTag(value),
  6803. Ctor = result == objectTag ? value.constructor : undefined,
  6804. ctorString = Ctor ? toSource(Ctor) : '';
  6805. if (ctorString) {
  6806. switch (ctorString) {
  6807. case dataViewCtorString: return dataViewTag;
  6808. case mapCtorString: return mapTag;
  6809. case promiseCtorString: return promiseTag;
  6810. case setCtorString: return setTag;
  6811. case weakMapCtorString: return weakMapTag;
  6812. }
  6813. }
  6814. return result;
  6815. };
  6816. }
  6817. /**
  6818. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6819. *
  6820. * @private
  6821. * @param {number} start The start of the view.
  6822. * @param {number} end The end of the view.
  6823. * @param {Array} transforms The transformations to apply to the view.
  6824. * @returns {Object} Returns an object containing the `start` and `end`
  6825. * positions of the view.
  6826. */
  6827. function getView(start, end, transforms) {
  6828. var index = -1,
  6829. length = transforms.length;
  6830. while (++index < length) {
  6831. var data = transforms[index],
  6832. size = data.size;
  6833. switch (data.type) {
  6834. case 'drop': start += size; break;
  6835. case 'dropRight': end -= size; break;
  6836. case 'take': end = nativeMin(end, start + size); break;
  6837. case 'takeRight': start = nativeMax(start, end - size); break;
  6838. }
  6839. }
  6840. return { 'start': start, 'end': end };
  6841. }
  6842. /**
  6843. * Extracts wrapper details from the `source` body comment.
  6844. *
  6845. * @private
  6846. * @param {string} source The source to inspect.
  6847. * @returns {Array} Returns the wrapper details.
  6848. */
  6849. function getWrapDetails(source) {
  6850. var match = source.match(reWrapDetails);
  6851. return match ? match[1].split(reSplitDetails) : [];
  6852. }
  6853. /**
  6854. * Checks if `path` exists on `object`.
  6855. *
  6856. * @private
  6857. * @param {Object} object The object to query.
  6858. * @param {Array|string} path The path to check.
  6859. * @param {Function} hasFunc The function to check properties.
  6860. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6861. */
  6862. function hasPath(object, path, hasFunc) {
  6863. path = castPath(path, object);
  6864. var index = -1,
  6865. length = path.length,
  6866. result = false;
  6867. while (++index < length) {
  6868. var key = toKey(path[index]);
  6869. if (!(result = object != null && hasFunc(object, key))) {
  6870. break;
  6871. }
  6872. object = object[key];
  6873. }
  6874. if (result || ++index != length) {
  6875. return result;
  6876. }
  6877. length = object == null ? 0 : object.length;
  6878. return !!length && isLength(length) && isIndex(key, length) &&
  6879. (isArray(object) || isArguments(object));
  6880. }
  6881. /**
  6882. * Initializes an array clone.
  6883. *
  6884. * @private
  6885. * @param {Array} array The array to clone.
  6886. * @returns {Array} Returns the initialized clone.
  6887. */
  6888. function initCloneArray(array) {
  6889. var length = array.length,
  6890. result = new array.constructor(length);
  6891. // Add properties assigned by `RegExp#exec`.
  6892. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6893. result.index = array.index;
  6894. result.input = array.input;
  6895. }
  6896. return result;
  6897. }
  6898. /**
  6899. * Initializes an object clone.
  6900. *
  6901. * @private
  6902. * @param {Object} object The object to clone.
  6903. * @returns {Object} Returns the initialized clone.
  6904. */
  6905. function initCloneObject(object) {
  6906. return (typeof object.constructor == 'function' && !isPrototype(object))
  6907. ? baseCreate(getPrototype(object))
  6908. : {};
  6909. }
  6910. /**
  6911. * Initializes an object clone based on its `toStringTag`.
  6912. *
  6913. * **Note:** This function only supports cloning values with tags of
  6914. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6915. *
  6916. * @private
  6917. * @param {Object} object The object to clone.
  6918. * @param {string} tag The `toStringTag` of the object to clone.
  6919. * @param {boolean} [isDeep] Specify a deep clone.
  6920. * @returns {Object} Returns the initialized clone.
  6921. */
  6922. function initCloneByTag(object, tag, isDeep) {
  6923. var Ctor = object.constructor;
  6924. switch (tag) {
  6925. case arrayBufferTag:
  6926. return cloneArrayBuffer(object);
  6927. case boolTag:
  6928. case dateTag:
  6929. return new Ctor(+object);
  6930. case dataViewTag:
  6931. return cloneDataView(object, isDeep);
  6932. case float32Tag: case float64Tag:
  6933. case int8Tag: case int16Tag: case int32Tag:
  6934. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6935. return cloneTypedArray(object, isDeep);
  6936. case mapTag:
  6937. return new Ctor;
  6938. case numberTag:
  6939. case stringTag:
  6940. return new Ctor(object);
  6941. case regexpTag:
  6942. return cloneRegExp(object);
  6943. case setTag:
  6944. return new Ctor;
  6945. case symbolTag:
  6946. return cloneSymbol(object);
  6947. }
  6948. }
  6949. /**
  6950. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6951. *
  6952. * @private
  6953. * @param {string} source The source to modify.
  6954. * @returns {Array} details The details to insert.
  6955. * @returns {string} Returns the modified source.
  6956. */
  6957. function insertWrapDetails(source, details) {
  6958. var length = details.length;
  6959. if (!length) {
  6960. return source;
  6961. }
  6962. var lastIndex = length - 1;
  6963. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6964. details = details.join(length > 2 ? ', ' : ' ');
  6965. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6966. }
  6967. /**
  6968. * Checks if `value` is a flattenable `arguments` object or array.
  6969. *
  6970. * @private
  6971. * @param {*} value The value to check.
  6972. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6973. */
  6974. function isFlattenable(value) {
  6975. return isArray(value) || isArguments(value) ||
  6976. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6977. }
  6978. /**
  6979. * Checks if `value` is a valid array-like index.
  6980. *
  6981. * @private
  6982. * @param {*} value The value to check.
  6983. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6984. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6985. */
  6986. function isIndex(value, length) {
  6987. var type = typeof value;
  6988. length = length == null ? MAX_SAFE_INTEGER : length;
  6989. return !!length &&
  6990. (type == 'number' ||
  6991. (type != 'symbol' && reIsUint.test(value))) &&
  6992. (value > -1 && value % 1 == 0 && value < length);
  6993. }
  6994. /**
  6995. * Checks if the given arguments are from an iteratee call.
  6996. *
  6997. * @private
  6998. * @param {*} value The potential iteratee value argument.
  6999. * @param {*} index The potential iteratee index or key argument.
  7000. * @param {*} object The potential iteratee object argument.
  7001. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7002. * else `false`.
  7003. */
  7004. function isIterateeCall(value, index, object) {
  7005. if (!isObject(object)) {
  7006. return false;
  7007. }
  7008. var type = typeof index;
  7009. if (type == 'number'
  7010. ? (isArrayLike(object) && isIndex(index, object.length))
  7011. : (type == 'string' && index in object)
  7012. ) {
  7013. return eq(object[index], value);
  7014. }
  7015. return false;
  7016. }
  7017. /**
  7018. * Checks if `value` is a property name and not a property path.
  7019. *
  7020. * @private
  7021. * @param {*} value The value to check.
  7022. * @param {Object} [object] The object to query keys on.
  7023. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7024. */
  7025. function isKey(value, object) {
  7026. if (isArray(value)) {
  7027. return false;
  7028. }
  7029. var type = typeof value;
  7030. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7031. value == null || isSymbol(value)) {
  7032. return true;
  7033. }
  7034. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7035. (object != null && value in Object(object));
  7036. }
  7037. /**
  7038. * Checks if `value` is suitable for use as unique object key.
  7039. *
  7040. * @private
  7041. * @param {*} value The value to check.
  7042. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7043. */
  7044. function isKeyable(value) {
  7045. var type = typeof value;
  7046. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7047. ? (value !== '__proto__')
  7048. : (value === null);
  7049. }
  7050. /**
  7051. * Checks if `func` has a lazy counterpart.
  7052. *
  7053. * @private
  7054. * @param {Function} func The function to check.
  7055. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7056. * else `false`.
  7057. */
  7058. function isLaziable(func) {
  7059. var funcName = getFuncName(func),
  7060. other = lodash[funcName];
  7061. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7062. return false;
  7063. }
  7064. if (func === other) {
  7065. return true;
  7066. }
  7067. var data = getData(other);
  7068. return !!data && func === data[0];
  7069. }
  7070. /**
  7071. * Checks if `func` has its source masked.
  7072. *
  7073. * @private
  7074. * @param {Function} func The function to check.
  7075. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7076. */
  7077. function isMasked(func) {
  7078. return !!maskSrcKey && (maskSrcKey in func);
  7079. }
  7080. /**
  7081. * Checks if `func` is capable of being masked.
  7082. *
  7083. * @private
  7084. * @param {*} value The value to check.
  7085. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7086. */
  7087. var isMaskable = coreJsData ? isFunction : stubFalse;
  7088. /**
  7089. * Checks if `value` is likely a prototype object.
  7090. *
  7091. * @private
  7092. * @param {*} value The value to check.
  7093. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7094. */
  7095. function isPrototype(value) {
  7096. var Ctor = value && value.constructor,
  7097. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7098. return value === proto;
  7099. }
  7100. /**
  7101. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7102. *
  7103. * @private
  7104. * @param {*} value The value to check.
  7105. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7106. * equality comparisons, else `false`.
  7107. */
  7108. function isStrictComparable(value) {
  7109. return value === value && !isObject(value);
  7110. }
  7111. /**
  7112. * A specialized version of `matchesProperty` for source values suitable
  7113. * for strict equality comparisons, i.e. `===`.
  7114. *
  7115. * @private
  7116. * @param {string} key The key of the property to get.
  7117. * @param {*} srcValue The value to match.
  7118. * @returns {Function} Returns the new spec function.
  7119. */
  7120. function matchesStrictComparable(key, srcValue) {
  7121. return function(object) {
  7122. if (object == null) {
  7123. return false;
  7124. }
  7125. return object[key] === srcValue &&
  7126. (srcValue !== undefined || (key in Object(object)));
  7127. };
  7128. }
  7129. /**
  7130. * A specialized version of `_.memoize` which clears the memoized function's
  7131. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7132. *
  7133. * @private
  7134. * @param {Function} func The function to have its output memoized.
  7135. * @returns {Function} Returns the new memoized function.
  7136. */
  7137. function memoizeCapped(func) {
  7138. var result = memoize(func, function(key) {
  7139. if (cache.size === MAX_MEMOIZE_SIZE) {
  7140. cache.clear();
  7141. }
  7142. return key;
  7143. });
  7144. var cache = result.cache;
  7145. return result;
  7146. }
  7147. /**
  7148. * Merges the function metadata of `source` into `data`.
  7149. *
  7150. * Merging metadata reduces the number of wrappers used to invoke a function.
  7151. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7152. * may be applied regardless of execution order. Methods like `_.ary` and
  7153. * `_.rearg` modify function arguments, making the order in which they are
  7154. * executed important, preventing the merging of metadata. However, we make
  7155. * an exception for a safe combined case where curried functions have `_.ary`
  7156. * and or `_.rearg` applied.
  7157. *
  7158. * @private
  7159. * @param {Array} data The destination metadata.
  7160. * @param {Array} source The source metadata.
  7161. * @returns {Array} Returns `data`.
  7162. */
  7163. function mergeData(data, source) {
  7164. var bitmask = data[1],
  7165. srcBitmask = source[1],
  7166. newBitmask = bitmask | srcBitmask,
  7167. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7168. var isCombo =
  7169. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7170. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7171. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7172. // Exit early if metadata can't be merged.
  7173. if (!(isCommon || isCombo)) {
  7174. return data;
  7175. }
  7176. // Use source `thisArg` if available.
  7177. if (srcBitmask & WRAP_BIND_FLAG) {
  7178. data[2] = source[2];
  7179. // Set when currying a bound function.
  7180. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7181. }
  7182. // Compose partial arguments.
  7183. var value = source[3];
  7184. if (value) {
  7185. var partials = data[3];
  7186. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7187. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7188. }
  7189. // Compose partial right arguments.
  7190. value = source[5];
  7191. if (value) {
  7192. partials = data[5];
  7193. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7194. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7195. }
  7196. // Use source `argPos` if available.
  7197. value = source[7];
  7198. if (value) {
  7199. data[7] = value;
  7200. }
  7201. // Use source `ary` if it's smaller.
  7202. if (srcBitmask & WRAP_ARY_FLAG) {
  7203. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7204. }
  7205. // Use source `arity` if one is not provided.
  7206. if (data[9] == null) {
  7207. data[9] = source[9];
  7208. }
  7209. // Use source `func` and merge bitmasks.
  7210. data[0] = source[0];
  7211. data[1] = newBitmask;
  7212. return data;
  7213. }
  7214. /**
  7215. * This function is like
  7216. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7217. * except that it includes inherited enumerable properties.
  7218. *
  7219. * @private
  7220. * @param {Object} object The object to query.
  7221. * @returns {Array} Returns the array of property names.
  7222. */
  7223. function nativeKeysIn(object) {
  7224. var result = [];
  7225. if (object != null) {
  7226. for (var key in Object(object)) {
  7227. result.push(key);
  7228. }
  7229. }
  7230. return result;
  7231. }
  7232. /**
  7233. * Converts `value` to a string using `Object.prototype.toString`.
  7234. *
  7235. * @private
  7236. * @param {*} value The value to convert.
  7237. * @returns {string} Returns the converted string.
  7238. */
  7239. function objectToString(value) {
  7240. return nativeObjectToString.call(value);
  7241. }
  7242. /**
  7243. * A specialized version of `baseRest` which transforms the rest array.
  7244. *
  7245. * @private
  7246. * @param {Function} func The function to apply a rest parameter to.
  7247. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7248. * @param {Function} transform The rest array transform.
  7249. * @returns {Function} Returns the new function.
  7250. */
  7251. function overRest(func, start, transform) {
  7252. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7253. return function() {
  7254. var args = arguments,
  7255. index = -1,
  7256. length = nativeMax(args.length - start, 0),
  7257. array = Array(length);
  7258. while (++index < length) {
  7259. array[index] = args[start + index];
  7260. }
  7261. index = -1;
  7262. var otherArgs = Array(start + 1);
  7263. while (++index < start) {
  7264. otherArgs[index] = args[index];
  7265. }
  7266. otherArgs[start] = transform(array);
  7267. return apply(func, this, otherArgs);
  7268. };
  7269. }
  7270. /**
  7271. * Gets the parent value at `path` of `object`.
  7272. *
  7273. * @private
  7274. * @param {Object} object The object to query.
  7275. * @param {Array} path The path to get the parent value of.
  7276. * @returns {*} Returns the parent value.
  7277. */
  7278. function parent(object, path) {
  7279. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7280. }
  7281. /**
  7282. * Reorder `array` according to the specified indexes where the element at
  7283. * the first index is assigned as the first element, the element at
  7284. * the second index is assigned as the second element, and so on.
  7285. *
  7286. * @private
  7287. * @param {Array} array The array to reorder.
  7288. * @param {Array} indexes The arranged array indexes.
  7289. * @returns {Array} Returns `array`.
  7290. */
  7291. function reorder(array, indexes) {
  7292. var arrLength = array.length,
  7293. length = nativeMin(indexes.length, arrLength),
  7294. oldArray = copyArray(array);
  7295. while (length--) {
  7296. var index = indexes[length];
  7297. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7298. }
  7299. return array;
  7300. }
  7301. /**
  7302. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7303. *
  7304. * @private
  7305. * @param {Object} object The object to query.
  7306. * @param {string} key The key of the property to get.
  7307. * @returns {*} Returns the property value.
  7308. */
  7309. function safeGet(object, key) {
  7310. if (key === 'constructor' && typeof object[key] === 'function') {
  7311. return;
  7312. }
  7313. if (key == '__proto__') {
  7314. return;
  7315. }
  7316. return object[key];
  7317. }
  7318. /**
  7319. * Sets metadata for `func`.
  7320. *
  7321. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7322. * period of time, it will trip its breaker and transition to an identity
  7323. * function to avoid garbage collection pauses in V8. See
  7324. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7325. * for more details.
  7326. *
  7327. * @private
  7328. * @param {Function} func The function to associate metadata with.
  7329. * @param {*} data The metadata.
  7330. * @returns {Function} Returns `func`.
  7331. */
  7332. var setData = shortOut(baseSetData);
  7333. /**
  7334. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7335. *
  7336. * @private
  7337. * @param {Function} func The function to delay.
  7338. * @param {number} wait The number of milliseconds to delay invocation.
  7339. * @returns {number|Object} Returns the timer id or timeout object.
  7340. */
  7341. var setTimeout = ctxSetTimeout || function(func, wait) {
  7342. return root.setTimeout(func, wait);
  7343. };
  7344. /**
  7345. * Sets the `toString` method of `func` to return `string`.
  7346. *
  7347. * @private
  7348. * @param {Function} func The function to modify.
  7349. * @param {Function} string The `toString` result.
  7350. * @returns {Function} Returns `func`.
  7351. */
  7352. var setToString = shortOut(baseSetToString);
  7353. /**
  7354. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7355. * with wrapper details in a comment at the top of the source body.
  7356. *
  7357. * @private
  7358. * @param {Function} wrapper The function to modify.
  7359. * @param {Function} reference The reference function.
  7360. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7361. * @returns {Function} Returns `wrapper`.
  7362. */
  7363. function setWrapToString(wrapper, reference, bitmask) {
  7364. var source = (reference + '');
  7365. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7366. }
  7367. /**
  7368. * Creates a function that'll short out and invoke `identity` instead
  7369. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7370. * milliseconds.
  7371. *
  7372. * @private
  7373. * @param {Function} func The function to restrict.
  7374. * @returns {Function} Returns the new shortable function.
  7375. */
  7376. function shortOut(func) {
  7377. var count = 0,
  7378. lastCalled = 0;
  7379. return function() {
  7380. var stamp = nativeNow(),
  7381. remaining = HOT_SPAN - (stamp - lastCalled);
  7382. lastCalled = stamp;
  7383. if (remaining > 0) {
  7384. if (++count >= HOT_COUNT) {
  7385. return arguments[0];
  7386. }
  7387. } else {
  7388. count = 0;
  7389. }
  7390. return func.apply(undefined, arguments);
  7391. };
  7392. }
  7393. /**
  7394. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7395. *
  7396. * @private
  7397. * @param {Array} array The array to shuffle.
  7398. * @param {number} [size=array.length] The size of `array`.
  7399. * @returns {Array} Returns `array`.
  7400. */
  7401. function shuffleSelf(array, size) {
  7402. var index = -1,
  7403. length = array.length,
  7404. lastIndex = length - 1;
  7405. size = size === undefined ? length : size;
  7406. while (++index < size) {
  7407. var rand = baseRandom(index, lastIndex),
  7408. value = array[rand];
  7409. array[rand] = array[index];
  7410. array[index] = value;
  7411. }
  7412. array.length = size;
  7413. return array;
  7414. }
  7415. /**
  7416. * Converts `string` to a property path array.
  7417. *
  7418. * @private
  7419. * @param {string} string The string to convert.
  7420. * @returns {Array} Returns the property path array.
  7421. */
  7422. var stringToPath = memoizeCapped(function(string) {
  7423. var result = [];
  7424. if (string.charCodeAt(0) === 46 /* . */) {
  7425. result.push('');
  7426. }
  7427. string.replace(rePropName, function(match, number, quote, subString) {
  7428. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7429. });
  7430. return result;
  7431. });
  7432. /**
  7433. * Converts `value` to a string key if it's not a string or symbol.
  7434. *
  7435. * @private
  7436. * @param {*} value The value to inspect.
  7437. * @returns {string|symbol} Returns the key.
  7438. */
  7439. function toKey(value) {
  7440. if (typeof value == 'string' || isSymbol(value)) {
  7441. return value;
  7442. }
  7443. var result = (value + '');
  7444. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7445. }
  7446. /**
  7447. * Converts `func` to its source code.
  7448. *
  7449. * @private
  7450. * @param {Function} func The function to convert.
  7451. * @returns {string} Returns the source code.
  7452. */
  7453. function toSource(func) {
  7454. if (func != null) {
  7455. try {
  7456. return funcToString.call(func);
  7457. } catch (e) {}
  7458. try {
  7459. return (func + '');
  7460. } catch (e) {}
  7461. }
  7462. return '';
  7463. }
  7464. /**
  7465. * Updates wrapper `details` based on `bitmask` flags.
  7466. *
  7467. * @private
  7468. * @returns {Array} details The details to modify.
  7469. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7470. * @returns {Array} Returns `details`.
  7471. */
  7472. function updateWrapDetails(details, bitmask) {
  7473. arrayEach(wrapFlags, function(pair) {
  7474. var value = '_.' + pair[0];
  7475. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7476. details.push(value);
  7477. }
  7478. });
  7479. return details.sort();
  7480. }
  7481. /**
  7482. * Creates a clone of `wrapper`.
  7483. *
  7484. * @private
  7485. * @param {Object} wrapper The wrapper to clone.
  7486. * @returns {Object} Returns the cloned wrapper.
  7487. */
  7488. function wrapperClone(wrapper) {
  7489. if (wrapper instanceof LazyWrapper) {
  7490. return wrapper.clone();
  7491. }
  7492. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7493. result.__actions__ = copyArray(wrapper.__actions__);
  7494. result.__index__ = wrapper.__index__;
  7495. result.__values__ = wrapper.__values__;
  7496. return result;
  7497. }
  7498. /*------------------------------------------------------------------------*/
  7499. /**
  7500. * Creates an array of elements split into groups the length of `size`.
  7501. * If `array` can't be split evenly, the final chunk will be the remaining
  7502. * elements.
  7503. *
  7504. * @static
  7505. * @memberOf _
  7506. * @since 3.0.0
  7507. * @category Array
  7508. * @param {Array} array The array to process.
  7509. * @param {number} [size=1] The length of each chunk
  7510. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7511. * @returns {Array} Returns the new array of chunks.
  7512. * @example
  7513. *
  7514. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7515. * // => [['a', 'b'], ['c', 'd']]
  7516. *
  7517. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7518. * // => [['a', 'b', 'c'], ['d']]
  7519. */
  7520. function chunk(array, size, guard) {
  7521. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7522. size = 1;
  7523. } else {
  7524. size = nativeMax(toInteger(size), 0);
  7525. }
  7526. var length = array == null ? 0 : array.length;
  7527. if (!length || size < 1) {
  7528. return [];
  7529. }
  7530. var index = 0,
  7531. resIndex = 0,
  7532. result = Array(nativeCeil(length / size));
  7533. while (index < length) {
  7534. result[resIndex++] = baseSlice(array, index, (index += size));
  7535. }
  7536. return result;
  7537. }
  7538. /**
  7539. * Creates an array with all falsey values removed. The values `false`, `null`,
  7540. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7541. *
  7542. * @static
  7543. * @memberOf _
  7544. * @since 0.1.0
  7545. * @category Array
  7546. * @param {Array} array The array to compact.
  7547. * @returns {Array} Returns the new array of filtered values.
  7548. * @example
  7549. *
  7550. * _.compact([0, 1, false, 2, '', 3]);
  7551. * // => [1, 2, 3]
  7552. */
  7553. function compact(array) {
  7554. var index = -1,
  7555. length = array == null ? 0 : array.length,
  7556. resIndex = 0,
  7557. result = [];
  7558. while (++index < length) {
  7559. var value = array[index];
  7560. if (value) {
  7561. result[resIndex++] = value;
  7562. }
  7563. }
  7564. return result;
  7565. }
  7566. /**
  7567. * Creates a new array concatenating `array` with any additional arrays
  7568. * and/or values.
  7569. *
  7570. * @static
  7571. * @memberOf _
  7572. * @since 4.0.0
  7573. * @category Array
  7574. * @param {Array} array The array to concatenate.
  7575. * @param {...*} [values] The values to concatenate.
  7576. * @returns {Array} Returns the new concatenated array.
  7577. * @example
  7578. *
  7579. * var array = [1];
  7580. * var other = _.concat(array, 2, [3], [[4]]);
  7581. *
  7582. * console.log(other);
  7583. * // => [1, 2, 3, [4]]
  7584. *
  7585. * console.log(array);
  7586. * // => [1]
  7587. */
  7588. function concat() {
  7589. var length = arguments.length;
  7590. if (!length) {
  7591. return [];
  7592. }
  7593. var args = Array(length - 1),
  7594. array = arguments[0],
  7595. index = length;
  7596. while (index--) {
  7597. args[index - 1] = arguments[index];
  7598. }
  7599. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7600. }
  7601. /**
  7602. * Creates an array of `array` values not included in the other given arrays
  7603. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7604. * for equality comparisons. The order and references of result values are
  7605. * determined by the first array.
  7606. *
  7607. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7608. *
  7609. * @static
  7610. * @memberOf _
  7611. * @since 0.1.0
  7612. * @category Array
  7613. * @param {Array} array The array to inspect.
  7614. * @param {...Array} [values] The values to exclude.
  7615. * @returns {Array} Returns the new array of filtered values.
  7616. * @see _.without, _.xor
  7617. * @example
  7618. *
  7619. * _.difference([2, 1], [2, 3]);
  7620. * // => [1]
  7621. */
  7622. var difference = baseRest(function(array, values) {
  7623. return isArrayLikeObject(array)
  7624. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7625. : [];
  7626. });
  7627. /**
  7628. * This method is like `_.difference` except that it accepts `iteratee` which
  7629. * is invoked for each element of `array` and `values` to generate the criterion
  7630. * by which they're compared. The order and references of result values are
  7631. * determined by the first array. The iteratee is invoked with one argument:
  7632. * (value).
  7633. *
  7634. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7635. *
  7636. * @static
  7637. * @memberOf _
  7638. * @since 4.0.0
  7639. * @category Array
  7640. * @param {Array} array The array to inspect.
  7641. * @param {...Array} [values] The values to exclude.
  7642. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7643. * @returns {Array} Returns the new array of filtered values.
  7644. * @example
  7645. *
  7646. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7647. * // => [1.2]
  7648. *
  7649. * // The `_.property` iteratee shorthand.
  7650. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7651. * // => [{ 'x': 2 }]
  7652. */
  7653. var differenceBy = baseRest(function(array, values) {
  7654. var iteratee = last(values);
  7655. if (isArrayLikeObject(iteratee)) {
  7656. iteratee = undefined;
  7657. }
  7658. return isArrayLikeObject(array)
  7659. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7660. : [];
  7661. });
  7662. /**
  7663. * This method is like `_.difference` except that it accepts `comparator`
  7664. * which is invoked to compare elements of `array` to `values`. The order and
  7665. * references of result values are determined by the first array. The comparator
  7666. * is invoked with two arguments: (arrVal, othVal).
  7667. *
  7668. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7669. *
  7670. * @static
  7671. * @memberOf _
  7672. * @since 4.0.0
  7673. * @category Array
  7674. * @param {Array} array The array to inspect.
  7675. * @param {...Array} [values] The values to exclude.
  7676. * @param {Function} [comparator] The comparator invoked per element.
  7677. * @returns {Array} Returns the new array of filtered values.
  7678. * @example
  7679. *
  7680. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7681. *
  7682. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7683. * // => [{ 'x': 2, 'y': 1 }]
  7684. */
  7685. var differenceWith = baseRest(function(array, values) {
  7686. var comparator = last(values);
  7687. if (isArrayLikeObject(comparator)) {
  7688. comparator = undefined;
  7689. }
  7690. return isArrayLikeObject(array)
  7691. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7692. : [];
  7693. });
  7694. /**
  7695. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7696. *
  7697. * @static
  7698. * @memberOf _
  7699. * @since 0.5.0
  7700. * @category Array
  7701. * @param {Array} array The array to query.
  7702. * @param {number} [n=1] The number of elements to drop.
  7703. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7704. * @returns {Array} Returns the slice of `array`.
  7705. * @example
  7706. *
  7707. * _.drop([1, 2, 3]);
  7708. * // => [2, 3]
  7709. *
  7710. * _.drop([1, 2, 3], 2);
  7711. * // => [3]
  7712. *
  7713. * _.drop([1, 2, 3], 5);
  7714. * // => []
  7715. *
  7716. * _.drop([1, 2, 3], 0);
  7717. * // => [1, 2, 3]
  7718. */
  7719. function drop(array, n, guard) {
  7720. var length = array == null ? 0 : array.length;
  7721. if (!length) {
  7722. return [];
  7723. }
  7724. n = (guard || n === undefined) ? 1 : toInteger(n);
  7725. return baseSlice(array, n < 0 ? 0 : n, length);
  7726. }
  7727. /**
  7728. * Creates a slice of `array` with `n` elements dropped from the end.
  7729. *
  7730. * @static
  7731. * @memberOf _
  7732. * @since 3.0.0
  7733. * @category Array
  7734. * @param {Array} array The array to query.
  7735. * @param {number} [n=1] The number of elements to drop.
  7736. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7737. * @returns {Array} Returns the slice of `array`.
  7738. * @example
  7739. *
  7740. * _.dropRight([1, 2, 3]);
  7741. * // => [1, 2]
  7742. *
  7743. * _.dropRight([1, 2, 3], 2);
  7744. * // => [1]
  7745. *
  7746. * _.dropRight([1, 2, 3], 5);
  7747. * // => []
  7748. *
  7749. * _.dropRight([1, 2, 3], 0);
  7750. * // => [1, 2, 3]
  7751. */
  7752. function dropRight(array, n, guard) {
  7753. var length = array == null ? 0 : array.length;
  7754. if (!length) {
  7755. return [];
  7756. }
  7757. n = (guard || n === undefined) ? 1 : toInteger(n);
  7758. n = length - n;
  7759. return baseSlice(array, 0, n < 0 ? 0 : n);
  7760. }
  7761. /**
  7762. * Creates a slice of `array` excluding elements dropped from the end.
  7763. * Elements are dropped until `predicate` returns falsey. The predicate is
  7764. * invoked with three arguments: (value, index, array).
  7765. *
  7766. * @static
  7767. * @memberOf _
  7768. * @since 3.0.0
  7769. * @category Array
  7770. * @param {Array} array The array to query.
  7771. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7772. * @returns {Array} Returns the slice of `array`.
  7773. * @example
  7774. *
  7775. * var users = [
  7776. * { 'user': 'barney', 'active': true },
  7777. * { 'user': 'fred', 'active': false },
  7778. * { 'user': 'pebbles', 'active': false }
  7779. * ];
  7780. *
  7781. * _.dropRightWhile(users, function(o) { return !o.active; });
  7782. * // => objects for ['barney']
  7783. *
  7784. * // The `_.matches` iteratee shorthand.
  7785. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7786. * // => objects for ['barney', 'fred']
  7787. *
  7788. * // The `_.matchesProperty` iteratee shorthand.
  7789. * _.dropRightWhile(users, ['active', false]);
  7790. * // => objects for ['barney']
  7791. *
  7792. * // The `_.property` iteratee shorthand.
  7793. * _.dropRightWhile(users, 'active');
  7794. * // => objects for ['barney', 'fred', 'pebbles']
  7795. */
  7796. function dropRightWhile(array, predicate) {
  7797. return (array && array.length)
  7798. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7799. : [];
  7800. }
  7801. /**
  7802. * Creates a slice of `array` excluding elements dropped from the beginning.
  7803. * Elements are dropped until `predicate` returns falsey. The predicate is
  7804. * invoked with three arguments: (value, index, array).
  7805. *
  7806. * @static
  7807. * @memberOf _
  7808. * @since 3.0.0
  7809. * @category Array
  7810. * @param {Array} array The array to query.
  7811. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7812. * @returns {Array} Returns the slice of `array`.
  7813. * @example
  7814. *
  7815. * var users = [
  7816. * { 'user': 'barney', 'active': false },
  7817. * { 'user': 'fred', 'active': false },
  7818. * { 'user': 'pebbles', 'active': true }
  7819. * ];
  7820. *
  7821. * _.dropWhile(users, function(o) { return !o.active; });
  7822. * // => objects for ['pebbles']
  7823. *
  7824. * // The `_.matches` iteratee shorthand.
  7825. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7826. * // => objects for ['fred', 'pebbles']
  7827. *
  7828. * // The `_.matchesProperty` iteratee shorthand.
  7829. * _.dropWhile(users, ['active', false]);
  7830. * // => objects for ['pebbles']
  7831. *
  7832. * // The `_.property` iteratee shorthand.
  7833. * _.dropWhile(users, 'active');
  7834. * // => objects for ['barney', 'fred', 'pebbles']
  7835. */
  7836. function dropWhile(array, predicate) {
  7837. return (array && array.length)
  7838. ? baseWhile(array, getIteratee(predicate, 3), true)
  7839. : [];
  7840. }
  7841. /**
  7842. * Fills elements of `array` with `value` from `start` up to, but not
  7843. * including, `end`.
  7844. *
  7845. * **Note:** This method mutates `array`.
  7846. *
  7847. * @static
  7848. * @memberOf _
  7849. * @since 3.2.0
  7850. * @category Array
  7851. * @param {Array} array The array to fill.
  7852. * @param {*} value The value to fill `array` with.
  7853. * @param {number} [start=0] The start position.
  7854. * @param {number} [end=array.length] The end position.
  7855. * @returns {Array} Returns `array`.
  7856. * @example
  7857. *
  7858. * var array = [1, 2, 3];
  7859. *
  7860. * _.fill(array, 'a');
  7861. * console.log(array);
  7862. * // => ['a', 'a', 'a']
  7863. *
  7864. * _.fill(Array(3), 2);
  7865. * // => [2, 2, 2]
  7866. *
  7867. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7868. * // => [4, '*', '*', 10]
  7869. */
  7870. function fill(array, value, start, end) {
  7871. var length = array == null ? 0 : array.length;
  7872. if (!length) {
  7873. return [];
  7874. }
  7875. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7876. start = 0;
  7877. end = length;
  7878. }
  7879. return baseFill(array, value, start, end);
  7880. }
  7881. /**
  7882. * This method is like `_.find` except that it returns the index of the first
  7883. * element `predicate` returns truthy for instead of the element itself.
  7884. *
  7885. * @static
  7886. * @memberOf _
  7887. * @since 1.1.0
  7888. * @category Array
  7889. * @param {Array} array The array to inspect.
  7890. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7891. * @param {number} [fromIndex=0] The index to search from.
  7892. * @returns {number} Returns the index of the found element, else `-1`.
  7893. * @example
  7894. *
  7895. * var users = [
  7896. * { 'user': 'barney', 'active': false },
  7897. * { 'user': 'fred', 'active': false },
  7898. * { 'user': 'pebbles', 'active': true }
  7899. * ];
  7900. *
  7901. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7902. * // => 0
  7903. *
  7904. * // The `_.matches` iteratee shorthand.
  7905. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7906. * // => 1
  7907. *
  7908. * // The `_.matchesProperty` iteratee shorthand.
  7909. * _.findIndex(users, ['active', false]);
  7910. * // => 0
  7911. *
  7912. * // The `_.property` iteratee shorthand.
  7913. * _.findIndex(users, 'active');
  7914. * // => 2
  7915. */
  7916. function findIndex(array, predicate, fromIndex) {
  7917. var length = array == null ? 0 : array.length;
  7918. if (!length) {
  7919. return -1;
  7920. }
  7921. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7922. if (index < 0) {
  7923. index = nativeMax(length + index, 0);
  7924. }
  7925. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7926. }
  7927. /**
  7928. * This method is like `_.findIndex` except that it iterates over elements
  7929. * of `collection` from right to left.
  7930. *
  7931. * @static
  7932. * @memberOf _
  7933. * @since 2.0.0
  7934. * @category Array
  7935. * @param {Array} array The array to inspect.
  7936. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7937. * @param {number} [fromIndex=array.length-1] The index to search from.
  7938. * @returns {number} Returns the index of the found element, else `-1`.
  7939. * @example
  7940. *
  7941. * var users = [
  7942. * { 'user': 'barney', 'active': true },
  7943. * { 'user': 'fred', 'active': false },
  7944. * { 'user': 'pebbles', 'active': false }
  7945. * ];
  7946. *
  7947. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7948. * // => 2
  7949. *
  7950. * // The `_.matches` iteratee shorthand.
  7951. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7952. * // => 0
  7953. *
  7954. * // The `_.matchesProperty` iteratee shorthand.
  7955. * _.findLastIndex(users, ['active', false]);
  7956. * // => 2
  7957. *
  7958. * // The `_.property` iteratee shorthand.
  7959. * _.findLastIndex(users, 'active');
  7960. * // => 0
  7961. */
  7962. function findLastIndex(array, predicate, fromIndex) {
  7963. var length = array == null ? 0 : array.length;
  7964. if (!length) {
  7965. return -1;
  7966. }
  7967. var index = length - 1;
  7968. if (fromIndex !== undefined) {
  7969. index = toInteger(fromIndex);
  7970. index = fromIndex < 0
  7971. ? nativeMax(length + index, 0)
  7972. : nativeMin(index, length - 1);
  7973. }
  7974. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7975. }
  7976. /**
  7977. * Flattens `array` a single level deep.
  7978. *
  7979. * @static
  7980. * @memberOf _
  7981. * @since 0.1.0
  7982. * @category Array
  7983. * @param {Array} array The array to flatten.
  7984. * @returns {Array} Returns the new flattened array.
  7985. * @example
  7986. *
  7987. * _.flatten([1, [2, [3, [4]], 5]]);
  7988. * // => [1, 2, [3, [4]], 5]
  7989. */
  7990. function flatten(array) {
  7991. var length = array == null ? 0 : array.length;
  7992. return length ? baseFlatten(array, 1) : [];
  7993. }
  7994. /**
  7995. * Recursively flattens `array`.
  7996. *
  7997. * @static
  7998. * @memberOf _
  7999. * @since 3.0.0
  8000. * @category Array
  8001. * @param {Array} array The array to flatten.
  8002. * @returns {Array} Returns the new flattened array.
  8003. * @example
  8004. *
  8005. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8006. * // => [1, 2, 3, 4, 5]
  8007. */
  8008. function flattenDeep(array) {
  8009. var length = array == null ? 0 : array.length;
  8010. return length ? baseFlatten(array, INFINITY) : [];
  8011. }
  8012. /**
  8013. * Recursively flatten `array` up to `depth` times.
  8014. *
  8015. * @static
  8016. * @memberOf _
  8017. * @since 4.4.0
  8018. * @category Array
  8019. * @param {Array} array The array to flatten.
  8020. * @param {number} [depth=1] The maximum recursion depth.
  8021. * @returns {Array} Returns the new flattened array.
  8022. * @example
  8023. *
  8024. * var array = [1, [2, [3, [4]], 5]];
  8025. *
  8026. * _.flattenDepth(array, 1);
  8027. * // => [1, 2, [3, [4]], 5]
  8028. *
  8029. * _.flattenDepth(array, 2);
  8030. * // => [1, 2, 3, [4], 5]
  8031. */
  8032. function flattenDepth(array, depth) {
  8033. var length = array == null ? 0 : array.length;
  8034. if (!length) {
  8035. return [];
  8036. }
  8037. depth = depth === undefined ? 1 : toInteger(depth);
  8038. return baseFlatten(array, depth);
  8039. }
  8040. /**
  8041. * The inverse of `_.toPairs`; this method returns an object composed
  8042. * from key-value `pairs`.
  8043. *
  8044. * @static
  8045. * @memberOf _
  8046. * @since 4.0.0
  8047. * @category Array
  8048. * @param {Array} pairs The key-value pairs.
  8049. * @returns {Object} Returns the new object.
  8050. * @example
  8051. *
  8052. * _.fromPairs([['a', 1], ['b', 2]]);
  8053. * // => { 'a': 1, 'b': 2 }
  8054. */
  8055. function fromPairs(pairs) {
  8056. var index = -1,
  8057. length = pairs == null ? 0 : pairs.length,
  8058. result = {};
  8059. while (++index < length) {
  8060. var pair = pairs[index];
  8061. result[pair[0]] = pair[1];
  8062. }
  8063. return result;
  8064. }
  8065. /**
  8066. * Gets the first element of `array`.
  8067. *
  8068. * @static
  8069. * @memberOf _
  8070. * @since 0.1.0
  8071. * @alias first
  8072. * @category Array
  8073. * @param {Array} array The array to query.
  8074. * @returns {*} Returns the first element of `array`.
  8075. * @example
  8076. *
  8077. * _.head([1, 2, 3]);
  8078. * // => 1
  8079. *
  8080. * _.head([]);
  8081. * // => undefined
  8082. */
  8083. function head(array) {
  8084. return (array && array.length) ? array[0] : undefined;
  8085. }
  8086. /**
  8087. * Gets the index at which the first occurrence of `value` is found in `array`
  8088. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8089. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8090. * offset from the end of `array`.
  8091. *
  8092. * @static
  8093. * @memberOf _
  8094. * @since 0.1.0
  8095. * @category Array
  8096. * @param {Array} array The array to inspect.
  8097. * @param {*} value The value to search for.
  8098. * @param {number} [fromIndex=0] The index to search from.
  8099. * @returns {number} Returns the index of the matched value, else `-1`.
  8100. * @example
  8101. *
  8102. * _.indexOf([1, 2, 1, 2], 2);
  8103. * // => 1
  8104. *
  8105. * // Search from the `fromIndex`.
  8106. * _.indexOf([1, 2, 1, 2], 2, 2);
  8107. * // => 3
  8108. */
  8109. function indexOf(array, value, fromIndex) {
  8110. var length = array == null ? 0 : array.length;
  8111. if (!length) {
  8112. return -1;
  8113. }
  8114. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8115. if (index < 0) {
  8116. index = nativeMax(length + index, 0);
  8117. }
  8118. return baseIndexOf(array, value, index);
  8119. }
  8120. /**
  8121. * Gets all but the last element of `array`.
  8122. *
  8123. * @static
  8124. * @memberOf _
  8125. * @since 0.1.0
  8126. * @category Array
  8127. * @param {Array} array The array to query.
  8128. * @returns {Array} Returns the slice of `array`.
  8129. * @example
  8130. *
  8131. * _.initial([1, 2, 3]);
  8132. * // => [1, 2]
  8133. */
  8134. function initial(array) {
  8135. var length = array == null ? 0 : array.length;
  8136. return length ? baseSlice(array, 0, -1) : [];
  8137. }
  8138. /**
  8139. * Creates an array of unique values that are included in all given arrays
  8140. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8141. * for equality comparisons. The order and references of result values are
  8142. * determined by the first array.
  8143. *
  8144. * @static
  8145. * @memberOf _
  8146. * @since 0.1.0
  8147. * @category Array
  8148. * @param {...Array} [arrays] The arrays to inspect.
  8149. * @returns {Array} Returns the new array of intersecting values.
  8150. * @example
  8151. *
  8152. * _.intersection([2, 1], [2, 3]);
  8153. * // => [2]
  8154. */
  8155. var intersection = baseRest(function(arrays) {
  8156. var mapped = arrayMap(arrays, castArrayLikeObject);
  8157. return (mapped.length && mapped[0] === arrays[0])
  8158. ? baseIntersection(mapped)
  8159. : [];
  8160. });
  8161. /**
  8162. * This method is like `_.intersection` except that it accepts `iteratee`
  8163. * which is invoked for each element of each `arrays` to generate the criterion
  8164. * by which they're compared. The order and references of result values are
  8165. * determined by the first array. The iteratee is invoked with one argument:
  8166. * (value).
  8167. *
  8168. * @static
  8169. * @memberOf _
  8170. * @since 4.0.0
  8171. * @category Array
  8172. * @param {...Array} [arrays] The arrays to inspect.
  8173. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8174. * @returns {Array} Returns the new array of intersecting values.
  8175. * @example
  8176. *
  8177. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8178. * // => [2.1]
  8179. *
  8180. * // The `_.property` iteratee shorthand.
  8181. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8182. * // => [{ 'x': 1 }]
  8183. */
  8184. var intersectionBy = baseRest(function(arrays) {
  8185. var iteratee = last(arrays),
  8186. mapped = arrayMap(arrays, castArrayLikeObject);
  8187. if (iteratee === last(mapped)) {
  8188. iteratee = undefined;
  8189. } else {
  8190. mapped.pop();
  8191. }
  8192. return (mapped.length && mapped[0] === arrays[0])
  8193. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8194. : [];
  8195. });
  8196. /**
  8197. * This method is like `_.intersection` except that it accepts `comparator`
  8198. * which is invoked to compare elements of `arrays`. The order and references
  8199. * of result values are determined by the first array. The comparator is
  8200. * invoked with two arguments: (arrVal, othVal).
  8201. *
  8202. * @static
  8203. * @memberOf _
  8204. * @since 4.0.0
  8205. * @category Array
  8206. * @param {...Array} [arrays] The arrays to inspect.
  8207. * @param {Function} [comparator] The comparator invoked per element.
  8208. * @returns {Array} Returns the new array of intersecting values.
  8209. * @example
  8210. *
  8211. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8212. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8213. *
  8214. * _.intersectionWith(objects, others, _.isEqual);
  8215. * // => [{ 'x': 1, 'y': 2 }]
  8216. */
  8217. var intersectionWith = baseRest(function(arrays) {
  8218. var comparator = last(arrays),
  8219. mapped = arrayMap(arrays, castArrayLikeObject);
  8220. comparator = typeof comparator == 'function' ? comparator : undefined;
  8221. if (comparator) {
  8222. mapped.pop();
  8223. }
  8224. return (mapped.length && mapped[0] === arrays[0])
  8225. ? baseIntersection(mapped, undefined, comparator)
  8226. : [];
  8227. });
  8228. /**
  8229. * Converts all elements in `array` into a string separated by `separator`.
  8230. *
  8231. * @static
  8232. * @memberOf _
  8233. * @since 4.0.0
  8234. * @category Array
  8235. * @param {Array} array The array to convert.
  8236. * @param {string} [separator=','] The element separator.
  8237. * @returns {string} Returns the joined string.
  8238. * @example
  8239. *
  8240. * _.join(['a', 'b', 'c'], '~');
  8241. * // => 'a~b~c'
  8242. */
  8243. function join(array, separator) {
  8244. return array == null ? '' : nativeJoin.call(array, separator);
  8245. }
  8246. /**
  8247. * Gets the last element of `array`.
  8248. *
  8249. * @static
  8250. * @memberOf _
  8251. * @since 0.1.0
  8252. * @category Array
  8253. * @param {Array} array The array to query.
  8254. * @returns {*} Returns the last element of `array`.
  8255. * @example
  8256. *
  8257. * _.last([1, 2, 3]);
  8258. * // => 3
  8259. */
  8260. function last(array) {
  8261. var length = array == null ? 0 : array.length;
  8262. return length ? array[length - 1] : undefined;
  8263. }
  8264. /**
  8265. * This method is like `_.indexOf` except that it iterates over elements of
  8266. * `array` from right to left.
  8267. *
  8268. * @static
  8269. * @memberOf _
  8270. * @since 0.1.0
  8271. * @category Array
  8272. * @param {Array} array The array to inspect.
  8273. * @param {*} value The value to search for.
  8274. * @param {number} [fromIndex=array.length-1] The index to search from.
  8275. * @returns {number} Returns the index of the matched value, else `-1`.
  8276. * @example
  8277. *
  8278. * _.lastIndexOf([1, 2, 1, 2], 2);
  8279. * // => 3
  8280. *
  8281. * // Search from the `fromIndex`.
  8282. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8283. * // => 1
  8284. */
  8285. function lastIndexOf(array, value, fromIndex) {
  8286. var length = array == null ? 0 : array.length;
  8287. if (!length) {
  8288. return -1;
  8289. }
  8290. var index = length;
  8291. if (fromIndex !== undefined) {
  8292. index = toInteger(fromIndex);
  8293. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8294. }
  8295. return value === value
  8296. ? strictLastIndexOf(array, value, index)
  8297. : baseFindIndex(array, baseIsNaN, index, true);
  8298. }
  8299. /**
  8300. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8301. * element from the end is returned.
  8302. *
  8303. * @static
  8304. * @memberOf _
  8305. * @since 4.11.0
  8306. * @category Array
  8307. * @param {Array} array The array to query.
  8308. * @param {number} [n=0] The index of the element to return.
  8309. * @returns {*} Returns the nth element of `array`.
  8310. * @example
  8311. *
  8312. * var array = ['a', 'b', 'c', 'd'];
  8313. *
  8314. * _.nth(array, 1);
  8315. * // => 'b'
  8316. *
  8317. * _.nth(array, -2);
  8318. * // => 'c';
  8319. */
  8320. function nth(array, n) {
  8321. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8322. }
  8323. /**
  8324. * Removes all given values from `array` using
  8325. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8326. * for equality comparisons.
  8327. *
  8328. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8329. * to remove elements from an array by predicate.
  8330. *
  8331. * @static
  8332. * @memberOf _
  8333. * @since 2.0.0
  8334. * @category Array
  8335. * @param {Array} array The array to modify.
  8336. * @param {...*} [values] The values to remove.
  8337. * @returns {Array} Returns `array`.
  8338. * @example
  8339. *
  8340. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8341. *
  8342. * _.pull(array, 'a', 'c');
  8343. * console.log(array);
  8344. * // => ['b', 'b']
  8345. */
  8346. var pull = baseRest(pullAll);
  8347. /**
  8348. * This method is like `_.pull` except that it accepts an array of values to remove.
  8349. *
  8350. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8351. *
  8352. * @static
  8353. * @memberOf _
  8354. * @since 4.0.0
  8355. * @category Array
  8356. * @param {Array} array The array to modify.
  8357. * @param {Array} values The values to remove.
  8358. * @returns {Array} Returns `array`.
  8359. * @example
  8360. *
  8361. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8362. *
  8363. * _.pullAll(array, ['a', 'c']);
  8364. * console.log(array);
  8365. * // => ['b', 'b']
  8366. */
  8367. function pullAll(array, values) {
  8368. return (array && array.length && values && values.length)
  8369. ? basePullAll(array, values)
  8370. : array;
  8371. }
  8372. /**
  8373. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8374. * invoked for each element of `array` and `values` to generate the criterion
  8375. * by which they're compared. The iteratee is invoked with one argument: (value).
  8376. *
  8377. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8378. *
  8379. * @static
  8380. * @memberOf _
  8381. * @since 4.0.0
  8382. * @category Array
  8383. * @param {Array} array The array to modify.
  8384. * @param {Array} values The values to remove.
  8385. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8386. * @returns {Array} Returns `array`.
  8387. * @example
  8388. *
  8389. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8390. *
  8391. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8392. * console.log(array);
  8393. * // => [{ 'x': 2 }]
  8394. */
  8395. function pullAllBy(array, values, iteratee) {
  8396. return (array && array.length && values && values.length)
  8397. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8398. : array;
  8399. }
  8400. /**
  8401. * This method is like `_.pullAll` except that it accepts `comparator` which
  8402. * is invoked to compare elements of `array` to `values`. The comparator is
  8403. * invoked with two arguments: (arrVal, othVal).
  8404. *
  8405. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8406. *
  8407. * @static
  8408. * @memberOf _
  8409. * @since 4.6.0
  8410. * @category Array
  8411. * @param {Array} array The array to modify.
  8412. * @param {Array} values The values to remove.
  8413. * @param {Function} [comparator] The comparator invoked per element.
  8414. * @returns {Array} Returns `array`.
  8415. * @example
  8416. *
  8417. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8418. *
  8419. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8420. * console.log(array);
  8421. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8422. */
  8423. function pullAllWith(array, values, comparator) {
  8424. return (array && array.length && values && values.length)
  8425. ? basePullAll(array, values, undefined, comparator)
  8426. : array;
  8427. }
  8428. /**
  8429. * Removes elements from `array` corresponding to `indexes` and returns an
  8430. * array of removed elements.
  8431. *
  8432. * **Note:** Unlike `_.at`, this method mutates `array`.
  8433. *
  8434. * @static
  8435. * @memberOf _
  8436. * @since 3.0.0
  8437. * @category Array
  8438. * @param {Array} array The array to modify.
  8439. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8440. * @returns {Array} Returns the new array of removed elements.
  8441. * @example
  8442. *
  8443. * var array = ['a', 'b', 'c', 'd'];
  8444. * var pulled = _.pullAt(array, [1, 3]);
  8445. *
  8446. * console.log(array);
  8447. * // => ['a', 'c']
  8448. *
  8449. * console.log(pulled);
  8450. * // => ['b', 'd']
  8451. */
  8452. var pullAt = flatRest(function(array, indexes) {
  8453. var length = array == null ? 0 : array.length,
  8454. result = baseAt(array, indexes);
  8455. basePullAt(array, arrayMap(indexes, function(index) {
  8456. return isIndex(index, length) ? +index : index;
  8457. }).sort(compareAscending));
  8458. return result;
  8459. });
  8460. /**
  8461. * Removes all elements from `array` that `predicate` returns truthy for
  8462. * and returns an array of the removed elements. The predicate is invoked
  8463. * with three arguments: (value, index, array).
  8464. *
  8465. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8466. * to pull elements from an array by value.
  8467. *
  8468. * @static
  8469. * @memberOf _
  8470. * @since 2.0.0
  8471. * @category Array
  8472. * @param {Array} array The array to modify.
  8473. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8474. * @returns {Array} Returns the new array of removed elements.
  8475. * @example
  8476. *
  8477. * var array = [1, 2, 3, 4];
  8478. * var evens = _.remove(array, function(n) {
  8479. * return n % 2 == 0;
  8480. * });
  8481. *
  8482. * console.log(array);
  8483. * // => [1, 3]
  8484. *
  8485. * console.log(evens);
  8486. * // => [2, 4]
  8487. */
  8488. function remove(array, predicate) {
  8489. var result = [];
  8490. if (!(array && array.length)) {
  8491. return result;
  8492. }
  8493. var index = -1,
  8494. indexes = [],
  8495. length = array.length;
  8496. predicate = getIteratee(predicate, 3);
  8497. while (++index < length) {
  8498. var value = array[index];
  8499. if (predicate(value, index, array)) {
  8500. result.push(value);
  8501. indexes.push(index);
  8502. }
  8503. }
  8504. basePullAt(array, indexes);
  8505. return result;
  8506. }
  8507. /**
  8508. * Reverses `array` so that the first element becomes the last, the second
  8509. * element becomes the second to last, and so on.
  8510. *
  8511. * **Note:** This method mutates `array` and is based on
  8512. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8513. *
  8514. * @static
  8515. * @memberOf _
  8516. * @since 4.0.0
  8517. * @category Array
  8518. * @param {Array} array The array to modify.
  8519. * @returns {Array} Returns `array`.
  8520. * @example
  8521. *
  8522. * var array = [1, 2, 3];
  8523. *
  8524. * _.reverse(array);
  8525. * // => [3, 2, 1]
  8526. *
  8527. * console.log(array);
  8528. * // => [3, 2, 1]
  8529. */
  8530. function reverse(array) {
  8531. return array == null ? array : nativeReverse.call(array);
  8532. }
  8533. /**
  8534. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8535. *
  8536. * **Note:** This method is used instead of
  8537. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8538. * returned.
  8539. *
  8540. * @static
  8541. * @memberOf _
  8542. * @since 3.0.0
  8543. * @category Array
  8544. * @param {Array} array The array to slice.
  8545. * @param {number} [start=0] The start position.
  8546. * @param {number} [end=array.length] The end position.
  8547. * @returns {Array} Returns the slice of `array`.
  8548. */
  8549. function slice(array, start, end) {
  8550. var length = array == null ? 0 : array.length;
  8551. if (!length) {
  8552. return [];
  8553. }
  8554. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8555. start = 0;
  8556. end = length;
  8557. }
  8558. else {
  8559. start = start == null ? 0 : toInteger(start);
  8560. end = end === undefined ? length : toInteger(end);
  8561. }
  8562. return baseSlice(array, start, end);
  8563. }
  8564. /**
  8565. * Uses a binary search to determine the lowest index at which `value`
  8566. * should be inserted into `array` in order to maintain its sort order.
  8567. *
  8568. * @static
  8569. * @memberOf _
  8570. * @since 0.1.0
  8571. * @category Array
  8572. * @param {Array} array The sorted array to inspect.
  8573. * @param {*} value The value to evaluate.
  8574. * @returns {number} Returns the index at which `value` should be inserted
  8575. * into `array`.
  8576. * @example
  8577. *
  8578. * _.sortedIndex([30, 50], 40);
  8579. * // => 1
  8580. */
  8581. function sortedIndex(array, value) {
  8582. return baseSortedIndex(array, value);
  8583. }
  8584. /**
  8585. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8586. * which is invoked for `value` and each element of `array` to compute their
  8587. * sort ranking. The iteratee is invoked with one argument: (value).
  8588. *
  8589. * @static
  8590. * @memberOf _
  8591. * @since 4.0.0
  8592. * @category Array
  8593. * @param {Array} array The sorted array to inspect.
  8594. * @param {*} value The value to evaluate.
  8595. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8596. * @returns {number} Returns the index at which `value` should be inserted
  8597. * into `array`.
  8598. * @example
  8599. *
  8600. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8601. *
  8602. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8603. * // => 0
  8604. *
  8605. * // The `_.property` iteratee shorthand.
  8606. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8607. * // => 0
  8608. */
  8609. function sortedIndexBy(array, value, iteratee) {
  8610. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8611. }
  8612. /**
  8613. * This method is like `_.indexOf` except that it performs a binary
  8614. * search on a sorted `array`.
  8615. *
  8616. * @static
  8617. * @memberOf _
  8618. * @since 4.0.0
  8619. * @category Array
  8620. * @param {Array} array The array to inspect.
  8621. * @param {*} value The value to search for.
  8622. * @returns {number} Returns the index of the matched value, else `-1`.
  8623. * @example
  8624. *
  8625. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8626. * // => 1
  8627. */
  8628. function sortedIndexOf(array, value) {
  8629. var length = array == null ? 0 : array.length;
  8630. if (length) {
  8631. var index = baseSortedIndex(array, value);
  8632. if (index < length && eq(array[index], value)) {
  8633. return index;
  8634. }
  8635. }
  8636. return -1;
  8637. }
  8638. /**
  8639. * This method is like `_.sortedIndex` except that it returns the highest
  8640. * index at which `value` should be inserted into `array` in order to
  8641. * maintain its sort order.
  8642. *
  8643. * @static
  8644. * @memberOf _
  8645. * @since 3.0.0
  8646. * @category Array
  8647. * @param {Array} array The sorted array to inspect.
  8648. * @param {*} value The value to evaluate.
  8649. * @returns {number} Returns the index at which `value` should be inserted
  8650. * into `array`.
  8651. * @example
  8652. *
  8653. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8654. * // => 4
  8655. */
  8656. function sortedLastIndex(array, value) {
  8657. return baseSortedIndex(array, value, true);
  8658. }
  8659. /**
  8660. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8661. * which is invoked for `value` and each element of `array` to compute their
  8662. * sort ranking. The iteratee is invoked with one argument: (value).
  8663. *
  8664. * @static
  8665. * @memberOf _
  8666. * @since 4.0.0
  8667. * @category Array
  8668. * @param {Array} array The sorted array to inspect.
  8669. * @param {*} value The value to evaluate.
  8670. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8671. * @returns {number} Returns the index at which `value` should be inserted
  8672. * into `array`.
  8673. * @example
  8674. *
  8675. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8676. *
  8677. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8678. * // => 1
  8679. *
  8680. * // The `_.property` iteratee shorthand.
  8681. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8682. * // => 1
  8683. */
  8684. function sortedLastIndexBy(array, value, iteratee) {
  8685. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8686. }
  8687. /**
  8688. * This method is like `_.lastIndexOf` except that it performs a binary
  8689. * search on a sorted `array`.
  8690. *
  8691. * @static
  8692. * @memberOf _
  8693. * @since 4.0.0
  8694. * @category Array
  8695. * @param {Array} array The array to inspect.
  8696. * @param {*} value The value to search for.
  8697. * @returns {number} Returns the index of the matched value, else `-1`.
  8698. * @example
  8699. *
  8700. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8701. * // => 3
  8702. */
  8703. function sortedLastIndexOf(array, value) {
  8704. var length = array == null ? 0 : array.length;
  8705. if (length) {
  8706. var index = baseSortedIndex(array, value, true) - 1;
  8707. if (eq(array[index], value)) {
  8708. return index;
  8709. }
  8710. }
  8711. return -1;
  8712. }
  8713. /**
  8714. * This method is like `_.uniq` except that it's designed and optimized
  8715. * for sorted arrays.
  8716. *
  8717. * @static
  8718. * @memberOf _
  8719. * @since 4.0.0
  8720. * @category Array
  8721. * @param {Array} array The array to inspect.
  8722. * @returns {Array} Returns the new duplicate free array.
  8723. * @example
  8724. *
  8725. * _.sortedUniq([1, 1, 2]);
  8726. * // => [1, 2]
  8727. */
  8728. function sortedUniq(array) {
  8729. return (array && array.length)
  8730. ? baseSortedUniq(array)
  8731. : [];
  8732. }
  8733. /**
  8734. * This method is like `_.uniqBy` except that it's designed and optimized
  8735. * for sorted arrays.
  8736. *
  8737. * @static
  8738. * @memberOf _
  8739. * @since 4.0.0
  8740. * @category Array
  8741. * @param {Array} array The array to inspect.
  8742. * @param {Function} [iteratee] The iteratee invoked per element.
  8743. * @returns {Array} Returns the new duplicate free array.
  8744. * @example
  8745. *
  8746. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8747. * // => [1.1, 2.3]
  8748. */
  8749. function sortedUniqBy(array, iteratee) {
  8750. return (array && array.length)
  8751. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8752. : [];
  8753. }
  8754. /**
  8755. * Gets all but the first element of `array`.
  8756. *
  8757. * @static
  8758. * @memberOf _
  8759. * @since 4.0.0
  8760. * @category Array
  8761. * @param {Array} array The array to query.
  8762. * @returns {Array} Returns the slice of `array`.
  8763. * @example
  8764. *
  8765. * _.tail([1, 2, 3]);
  8766. * // => [2, 3]
  8767. */
  8768. function tail(array) {
  8769. var length = array == null ? 0 : array.length;
  8770. return length ? baseSlice(array, 1, length) : [];
  8771. }
  8772. /**
  8773. * Creates a slice of `array` with `n` elements taken from the beginning.
  8774. *
  8775. * @static
  8776. * @memberOf _
  8777. * @since 0.1.0
  8778. * @category Array
  8779. * @param {Array} array The array to query.
  8780. * @param {number} [n=1] The number of elements to take.
  8781. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8782. * @returns {Array} Returns the slice of `array`.
  8783. * @example
  8784. *
  8785. * _.take([1, 2, 3]);
  8786. * // => [1]
  8787. *
  8788. * _.take([1, 2, 3], 2);
  8789. * // => [1, 2]
  8790. *
  8791. * _.take([1, 2, 3], 5);
  8792. * // => [1, 2, 3]
  8793. *
  8794. * _.take([1, 2, 3], 0);
  8795. * // => []
  8796. */
  8797. function take(array, n, guard) {
  8798. if (!(array && array.length)) {
  8799. return [];
  8800. }
  8801. n = (guard || n === undefined) ? 1 : toInteger(n);
  8802. return baseSlice(array, 0, n < 0 ? 0 : n);
  8803. }
  8804. /**
  8805. * Creates a slice of `array` with `n` elements taken from the end.
  8806. *
  8807. * @static
  8808. * @memberOf _
  8809. * @since 3.0.0
  8810. * @category Array
  8811. * @param {Array} array The array to query.
  8812. * @param {number} [n=1] The number of elements to take.
  8813. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8814. * @returns {Array} Returns the slice of `array`.
  8815. * @example
  8816. *
  8817. * _.takeRight([1, 2, 3]);
  8818. * // => [3]
  8819. *
  8820. * _.takeRight([1, 2, 3], 2);
  8821. * // => [2, 3]
  8822. *
  8823. * _.takeRight([1, 2, 3], 5);
  8824. * // => [1, 2, 3]
  8825. *
  8826. * _.takeRight([1, 2, 3], 0);
  8827. * // => []
  8828. */
  8829. function takeRight(array, n, guard) {
  8830. var length = array == null ? 0 : array.length;
  8831. if (!length) {
  8832. return [];
  8833. }
  8834. n = (guard || n === undefined) ? 1 : toInteger(n);
  8835. n = length - n;
  8836. return baseSlice(array, n < 0 ? 0 : n, length);
  8837. }
  8838. /**
  8839. * Creates a slice of `array` with elements taken from the end. Elements are
  8840. * taken until `predicate` returns falsey. The predicate is invoked with
  8841. * three arguments: (value, index, array).
  8842. *
  8843. * @static
  8844. * @memberOf _
  8845. * @since 3.0.0
  8846. * @category Array
  8847. * @param {Array} array The array to query.
  8848. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8849. * @returns {Array} Returns the slice of `array`.
  8850. * @example
  8851. *
  8852. * var users = [
  8853. * { 'user': 'barney', 'active': true },
  8854. * { 'user': 'fred', 'active': false },
  8855. * { 'user': 'pebbles', 'active': false }
  8856. * ];
  8857. *
  8858. * _.takeRightWhile(users, function(o) { return !o.active; });
  8859. * // => objects for ['fred', 'pebbles']
  8860. *
  8861. * // The `_.matches` iteratee shorthand.
  8862. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8863. * // => objects for ['pebbles']
  8864. *
  8865. * // The `_.matchesProperty` iteratee shorthand.
  8866. * _.takeRightWhile(users, ['active', false]);
  8867. * // => objects for ['fred', 'pebbles']
  8868. *
  8869. * // The `_.property` iteratee shorthand.
  8870. * _.takeRightWhile(users, 'active');
  8871. * // => []
  8872. */
  8873. function takeRightWhile(array, predicate) {
  8874. return (array && array.length)
  8875. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8876. : [];
  8877. }
  8878. /**
  8879. * Creates a slice of `array` with elements taken from the beginning. Elements
  8880. * are taken until `predicate` returns falsey. The predicate is invoked with
  8881. * three arguments: (value, index, array).
  8882. *
  8883. * @static
  8884. * @memberOf _
  8885. * @since 3.0.0
  8886. * @category Array
  8887. * @param {Array} array The array to query.
  8888. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8889. * @returns {Array} Returns the slice of `array`.
  8890. * @example
  8891. *
  8892. * var users = [
  8893. * { 'user': 'barney', 'active': false },
  8894. * { 'user': 'fred', 'active': false },
  8895. * { 'user': 'pebbles', 'active': true }
  8896. * ];
  8897. *
  8898. * _.takeWhile(users, function(o) { return !o.active; });
  8899. * // => objects for ['barney', 'fred']
  8900. *
  8901. * // The `_.matches` iteratee shorthand.
  8902. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8903. * // => objects for ['barney']
  8904. *
  8905. * // The `_.matchesProperty` iteratee shorthand.
  8906. * _.takeWhile(users, ['active', false]);
  8907. * // => objects for ['barney', 'fred']
  8908. *
  8909. * // The `_.property` iteratee shorthand.
  8910. * _.takeWhile(users, 'active');
  8911. * // => []
  8912. */
  8913. function takeWhile(array, predicate) {
  8914. return (array && array.length)
  8915. ? baseWhile(array, getIteratee(predicate, 3))
  8916. : [];
  8917. }
  8918. /**
  8919. * Creates an array of unique values, in order, from all given arrays using
  8920. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8921. * for equality comparisons.
  8922. *
  8923. * @static
  8924. * @memberOf _
  8925. * @since 0.1.0
  8926. * @category Array
  8927. * @param {...Array} [arrays] The arrays to inspect.
  8928. * @returns {Array} Returns the new array of combined values.
  8929. * @example
  8930. *
  8931. * _.union([2], [1, 2]);
  8932. * // => [2, 1]
  8933. */
  8934. var union = baseRest(function(arrays) {
  8935. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8936. });
  8937. /**
  8938. * This method is like `_.union` except that it accepts `iteratee` which is
  8939. * invoked for each element of each `arrays` to generate the criterion by
  8940. * which uniqueness is computed. Result values are chosen from the first
  8941. * array in which the value occurs. The iteratee is invoked with one argument:
  8942. * (value).
  8943. *
  8944. * @static
  8945. * @memberOf _
  8946. * @since 4.0.0
  8947. * @category Array
  8948. * @param {...Array} [arrays] The arrays to inspect.
  8949. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8950. * @returns {Array} Returns the new array of combined values.
  8951. * @example
  8952. *
  8953. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8954. * // => [2.1, 1.2]
  8955. *
  8956. * // The `_.property` iteratee shorthand.
  8957. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8958. * // => [{ 'x': 1 }, { 'x': 2 }]
  8959. */
  8960. var unionBy = baseRest(function(arrays) {
  8961. var iteratee = last(arrays);
  8962. if (isArrayLikeObject(iteratee)) {
  8963. iteratee = undefined;
  8964. }
  8965. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8966. });
  8967. /**
  8968. * This method is like `_.union` except that it accepts `comparator` which
  8969. * is invoked to compare elements of `arrays`. Result values are chosen from
  8970. * the first array in which the value occurs. The comparator is invoked
  8971. * with two arguments: (arrVal, othVal).
  8972. *
  8973. * @static
  8974. * @memberOf _
  8975. * @since 4.0.0
  8976. * @category Array
  8977. * @param {...Array} [arrays] The arrays to inspect.
  8978. * @param {Function} [comparator] The comparator invoked per element.
  8979. * @returns {Array} Returns the new array of combined values.
  8980. * @example
  8981. *
  8982. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8983. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8984. *
  8985. * _.unionWith(objects, others, _.isEqual);
  8986. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8987. */
  8988. var unionWith = baseRest(function(arrays) {
  8989. var comparator = last(arrays);
  8990. comparator = typeof comparator == 'function' ? comparator : undefined;
  8991. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8992. });
  8993. /**
  8994. * Creates a duplicate-free version of an array, using
  8995. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8996. * for equality comparisons, in which only the first occurrence of each element
  8997. * is kept. The order of result values is determined by the order they occur
  8998. * in the array.
  8999. *
  9000. * @static
  9001. * @memberOf _
  9002. * @since 0.1.0
  9003. * @category Array
  9004. * @param {Array} array The array to inspect.
  9005. * @returns {Array} Returns the new duplicate free array.
  9006. * @example
  9007. *
  9008. * _.uniq([2, 1, 2]);
  9009. * // => [2, 1]
  9010. */
  9011. function uniq(array) {
  9012. return (array && array.length) ? baseUniq(array) : [];
  9013. }
  9014. /**
  9015. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9016. * invoked for each element in `array` to generate the criterion by which
  9017. * uniqueness is computed. The order of result values is determined by the
  9018. * order they occur in the array. The iteratee is invoked with one argument:
  9019. * (value).
  9020. *
  9021. * @static
  9022. * @memberOf _
  9023. * @since 4.0.0
  9024. * @category Array
  9025. * @param {Array} array The array to inspect.
  9026. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9027. * @returns {Array} Returns the new duplicate free array.
  9028. * @example
  9029. *
  9030. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9031. * // => [2.1, 1.2]
  9032. *
  9033. * // The `_.property` iteratee shorthand.
  9034. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9035. * // => [{ 'x': 1 }, { 'x': 2 }]
  9036. */
  9037. function uniqBy(array, iteratee) {
  9038. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9039. }
  9040. /**
  9041. * This method is like `_.uniq` except that it accepts `comparator` which
  9042. * is invoked to compare elements of `array`. The order of result values is
  9043. * determined by the order they occur in the array.The comparator is invoked
  9044. * with two arguments: (arrVal, othVal).
  9045. *
  9046. * @static
  9047. * @memberOf _
  9048. * @since 4.0.0
  9049. * @category Array
  9050. * @param {Array} array The array to inspect.
  9051. * @param {Function} [comparator] The comparator invoked per element.
  9052. * @returns {Array} Returns the new duplicate free array.
  9053. * @example
  9054. *
  9055. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9056. *
  9057. * _.uniqWith(objects, _.isEqual);
  9058. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9059. */
  9060. function uniqWith(array, comparator) {
  9061. comparator = typeof comparator == 'function' ? comparator : undefined;
  9062. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9063. }
  9064. /**
  9065. * This method is like `_.zip` except that it accepts an array of grouped
  9066. * elements and creates an array regrouping the elements to their pre-zip
  9067. * configuration.
  9068. *
  9069. * @static
  9070. * @memberOf _
  9071. * @since 1.2.0
  9072. * @category Array
  9073. * @param {Array} array The array of grouped elements to process.
  9074. * @returns {Array} Returns the new array of regrouped elements.
  9075. * @example
  9076. *
  9077. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9078. * // => [['a', 1, true], ['b', 2, false]]
  9079. *
  9080. * _.unzip(zipped);
  9081. * // => [['a', 'b'], [1, 2], [true, false]]
  9082. */
  9083. function unzip(array) {
  9084. if (!(array && array.length)) {
  9085. return [];
  9086. }
  9087. var length = 0;
  9088. array = arrayFilter(array, function(group) {
  9089. if (isArrayLikeObject(group)) {
  9090. length = nativeMax(group.length, length);
  9091. return true;
  9092. }
  9093. });
  9094. return baseTimes(length, function(index) {
  9095. return arrayMap(array, baseProperty(index));
  9096. });
  9097. }
  9098. /**
  9099. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9100. * how regrouped values should be combined. The iteratee is invoked with the
  9101. * elements of each group: (...group).
  9102. *
  9103. * @static
  9104. * @memberOf _
  9105. * @since 3.8.0
  9106. * @category Array
  9107. * @param {Array} array The array of grouped elements to process.
  9108. * @param {Function} [iteratee=_.identity] The function to combine
  9109. * regrouped values.
  9110. * @returns {Array} Returns the new array of regrouped elements.
  9111. * @example
  9112. *
  9113. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9114. * // => [[1, 10, 100], [2, 20, 200]]
  9115. *
  9116. * _.unzipWith(zipped, _.add);
  9117. * // => [3, 30, 300]
  9118. */
  9119. function unzipWith(array, iteratee) {
  9120. if (!(array && array.length)) {
  9121. return [];
  9122. }
  9123. var result = unzip(array);
  9124. if (iteratee == null) {
  9125. return result;
  9126. }
  9127. return arrayMap(result, function(group) {
  9128. return apply(iteratee, undefined, group);
  9129. });
  9130. }
  9131. /**
  9132. * Creates an array excluding all given values using
  9133. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9134. * for equality comparisons.
  9135. *
  9136. * **Note:** Unlike `_.pull`, this method returns a new array.
  9137. *
  9138. * @static
  9139. * @memberOf _
  9140. * @since 0.1.0
  9141. * @category Array
  9142. * @param {Array} array The array to inspect.
  9143. * @param {...*} [values] The values to exclude.
  9144. * @returns {Array} Returns the new array of filtered values.
  9145. * @see _.difference, _.xor
  9146. * @example
  9147. *
  9148. * _.without([2, 1, 2, 3], 1, 2);
  9149. * // => [3]
  9150. */
  9151. var without = baseRest(function(array, values) {
  9152. return isArrayLikeObject(array)
  9153. ? baseDifference(array, values)
  9154. : [];
  9155. });
  9156. /**
  9157. * Creates an array of unique values that is the
  9158. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9159. * of the given arrays. The order of result values is determined by the order
  9160. * they occur in the arrays.
  9161. *
  9162. * @static
  9163. * @memberOf _
  9164. * @since 2.4.0
  9165. * @category Array
  9166. * @param {...Array} [arrays] The arrays to inspect.
  9167. * @returns {Array} Returns the new array of filtered values.
  9168. * @see _.difference, _.without
  9169. * @example
  9170. *
  9171. * _.xor([2, 1], [2, 3]);
  9172. * // => [1, 3]
  9173. */
  9174. var xor = baseRest(function(arrays) {
  9175. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9176. });
  9177. /**
  9178. * This method is like `_.xor` except that it accepts `iteratee` which is
  9179. * invoked for each element of each `arrays` to generate the criterion by
  9180. * which by which they're compared. The order of result values is determined
  9181. * by the order they occur in the arrays. The iteratee is invoked with one
  9182. * argument: (value).
  9183. *
  9184. * @static
  9185. * @memberOf _
  9186. * @since 4.0.0
  9187. * @category Array
  9188. * @param {...Array} [arrays] The arrays to inspect.
  9189. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9190. * @returns {Array} Returns the new array of filtered values.
  9191. * @example
  9192. *
  9193. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9194. * // => [1.2, 3.4]
  9195. *
  9196. * // The `_.property` iteratee shorthand.
  9197. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9198. * // => [{ 'x': 2 }]
  9199. */
  9200. var xorBy = baseRest(function(arrays) {
  9201. var iteratee = last(arrays);
  9202. if (isArrayLikeObject(iteratee)) {
  9203. iteratee = undefined;
  9204. }
  9205. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9206. });
  9207. /**
  9208. * This method is like `_.xor` except that it accepts `comparator` which is
  9209. * invoked to compare elements of `arrays`. The order of result values is
  9210. * determined by the order they occur in the arrays. The comparator is invoked
  9211. * with two arguments: (arrVal, othVal).
  9212. *
  9213. * @static
  9214. * @memberOf _
  9215. * @since 4.0.0
  9216. * @category Array
  9217. * @param {...Array} [arrays] The arrays to inspect.
  9218. * @param {Function} [comparator] The comparator invoked per element.
  9219. * @returns {Array} Returns the new array of filtered values.
  9220. * @example
  9221. *
  9222. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9223. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9224. *
  9225. * _.xorWith(objects, others, _.isEqual);
  9226. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9227. */
  9228. var xorWith = baseRest(function(arrays) {
  9229. var comparator = last(arrays);
  9230. comparator = typeof comparator == 'function' ? comparator : undefined;
  9231. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9232. });
  9233. /**
  9234. * Creates an array of grouped elements, the first of which contains the
  9235. * first elements of the given arrays, the second of which contains the
  9236. * second elements of the given arrays, and so on.
  9237. *
  9238. * @static
  9239. * @memberOf _
  9240. * @since 0.1.0
  9241. * @category Array
  9242. * @param {...Array} [arrays] The arrays to process.
  9243. * @returns {Array} Returns the new array of grouped elements.
  9244. * @example
  9245. *
  9246. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9247. * // => [['a', 1, true], ['b', 2, false]]
  9248. */
  9249. var zip = baseRest(unzip);
  9250. /**
  9251. * This method is like `_.fromPairs` except that it accepts two arrays,
  9252. * one of property identifiers and one of corresponding values.
  9253. *
  9254. * @static
  9255. * @memberOf _
  9256. * @since 0.4.0
  9257. * @category Array
  9258. * @param {Array} [props=[]] The property identifiers.
  9259. * @param {Array} [values=[]] The property values.
  9260. * @returns {Object} Returns the new object.
  9261. * @example
  9262. *
  9263. * _.zipObject(['a', 'b'], [1, 2]);
  9264. * // => { 'a': 1, 'b': 2 }
  9265. */
  9266. function zipObject(props, values) {
  9267. return baseZipObject(props || [], values || [], assignValue);
  9268. }
  9269. /**
  9270. * This method is like `_.zipObject` except that it supports property paths.
  9271. *
  9272. * @static
  9273. * @memberOf _
  9274. * @since 4.1.0
  9275. * @category Array
  9276. * @param {Array} [props=[]] The property identifiers.
  9277. * @param {Array} [values=[]] The property values.
  9278. * @returns {Object} Returns the new object.
  9279. * @example
  9280. *
  9281. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9282. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9283. */
  9284. function zipObjectDeep(props, values) {
  9285. return baseZipObject(props || [], values || [], baseSet);
  9286. }
  9287. /**
  9288. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9289. * how grouped values should be combined. The iteratee is invoked with the
  9290. * elements of each group: (...group).
  9291. *
  9292. * @static
  9293. * @memberOf _
  9294. * @since 3.8.0
  9295. * @category Array
  9296. * @param {...Array} [arrays] The arrays to process.
  9297. * @param {Function} [iteratee=_.identity] The function to combine
  9298. * grouped values.
  9299. * @returns {Array} Returns the new array of grouped elements.
  9300. * @example
  9301. *
  9302. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9303. * return a + b + c;
  9304. * });
  9305. * // => [111, 222]
  9306. */
  9307. var zipWith = baseRest(function(arrays) {
  9308. var length = arrays.length,
  9309. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9310. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9311. return unzipWith(arrays, iteratee);
  9312. });
  9313. /*------------------------------------------------------------------------*/
  9314. /**
  9315. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9316. * chain sequences enabled. The result of such sequences must be unwrapped
  9317. * with `_#value`.
  9318. *
  9319. * @static
  9320. * @memberOf _
  9321. * @since 1.3.0
  9322. * @category Seq
  9323. * @param {*} value The value to wrap.
  9324. * @returns {Object} Returns the new `lodash` wrapper instance.
  9325. * @example
  9326. *
  9327. * var users = [
  9328. * { 'user': 'barney', 'age': 36 },
  9329. * { 'user': 'fred', 'age': 40 },
  9330. * { 'user': 'pebbles', 'age': 1 }
  9331. * ];
  9332. *
  9333. * var youngest = _
  9334. * .chain(users)
  9335. * .sortBy('age')
  9336. * .map(function(o) {
  9337. * return o.user + ' is ' + o.age;
  9338. * })
  9339. * .head()
  9340. * .value();
  9341. * // => 'pebbles is 1'
  9342. */
  9343. function chain(value) {
  9344. var result = lodash(value);
  9345. result.__chain__ = true;
  9346. return result;
  9347. }
  9348. /**
  9349. * This method invokes `interceptor` and returns `value`. The interceptor
  9350. * is invoked with one argument; (value). The purpose of this method is to
  9351. * "tap into" a method chain sequence in order to modify intermediate results.
  9352. *
  9353. * @static
  9354. * @memberOf _
  9355. * @since 0.1.0
  9356. * @category Seq
  9357. * @param {*} value The value to provide to `interceptor`.
  9358. * @param {Function} interceptor The function to invoke.
  9359. * @returns {*} Returns `value`.
  9360. * @example
  9361. *
  9362. * _([1, 2, 3])
  9363. * .tap(function(array) {
  9364. * // Mutate input array.
  9365. * array.pop();
  9366. * })
  9367. * .reverse()
  9368. * .value();
  9369. * // => [2, 1]
  9370. */
  9371. function tap(value, interceptor) {
  9372. interceptor(value);
  9373. return value;
  9374. }
  9375. /**
  9376. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9377. * The purpose of this method is to "pass thru" values replacing intermediate
  9378. * results in a method chain sequence.
  9379. *
  9380. * @static
  9381. * @memberOf _
  9382. * @since 3.0.0
  9383. * @category Seq
  9384. * @param {*} value The value to provide to `interceptor`.
  9385. * @param {Function} interceptor The function to invoke.
  9386. * @returns {*} Returns the result of `interceptor`.
  9387. * @example
  9388. *
  9389. * _(' abc ')
  9390. * .chain()
  9391. * .trim()
  9392. * .thru(function(value) {
  9393. * return [value];
  9394. * })
  9395. * .value();
  9396. * // => ['abc']
  9397. */
  9398. function thru(value, interceptor) {
  9399. return interceptor(value);
  9400. }
  9401. /**
  9402. * This method is the wrapper version of `_.at`.
  9403. *
  9404. * @name at
  9405. * @memberOf _
  9406. * @since 1.0.0
  9407. * @category Seq
  9408. * @param {...(string|string[])} [paths] The property paths to pick.
  9409. * @returns {Object} Returns the new `lodash` wrapper instance.
  9410. * @example
  9411. *
  9412. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9413. *
  9414. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9415. * // => [3, 4]
  9416. */
  9417. var wrapperAt = flatRest(function(paths) {
  9418. var length = paths.length,
  9419. start = length ? paths[0] : 0,
  9420. value = this.__wrapped__,
  9421. interceptor = function(object) { return baseAt(object, paths); };
  9422. if (length > 1 || this.__actions__.length ||
  9423. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9424. return this.thru(interceptor);
  9425. }
  9426. value = value.slice(start, +start + (length ? 1 : 0));
  9427. value.__actions__.push({
  9428. 'func': thru,
  9429. 'args': [interceptor],
  9430. 'thisArg': undefined
  9431. });
  9432. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9433. if (length && !array.length) {
  9434. array.push(undefined);
  9435. }
  9436. return array;
  9437. });
  9438. });
  9439. /**
  9440. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9441. *
  9442. * @name chain
  9443. * @memberOf _
  9444. * @since 0.1.0
  9445. * @category Seq
  9446. * @returns {Object} Returns the new `lodash` wrapper instance.
  9447. * @example
  9448. *
  9449. * var users = [
  9450. * { 'user': 'barney', 'age': 36 },
  9451. * { 'user': 'fred', 'age': 40 }
  9452. * ];
  9453. *
  9454. * // A sequence without explicit chaining.
  9455. * _(users).head();
  9456. * // => { 'user': 'barney', 'age': 36 }
  9457. *
  9458. * // A sequence with explicit chaining.
  9459. * _(users)
  9460. * .chain()
  9461. * .head()
  9462. * .pick('user')
  9463. * .value();
  9464. * // => { 'user': 'barney' }
  9465. */
  9466. function wrapperChain() {
  9467. return chain(this);
  9468. }
  9469. /**
  9470. * Executes the chain sequence and returns the wrapped result.
  9471. *
  9472. * @name commit
  9473. * @memberOf _
  9474. * @since 3.2.0
  9475. * @category Seq
  9476. * @returns {Object} Returns the new `lodash` wrapper instance.
  9477. * @example
  9478. *
  9479. * var array = [1, 2];
  9480. * var wrapped = _(array).push(3);
  9481. *
  9482. * console.log(array);
  9483. * // => [1, 2]
  9484. *
  9485. * wrapped = wrapped.commit();
  9486. * console.log(array);
  9487. * // => [1, 2, 3]
  9488. *
  9489. * wrapped.last();
  9490. * // => 3
  9491. *
  9492. * console.log(array);
  9493. * // => [1, 2, 3]
  9494. */
  9495. function wrapperCommit() {
  9496. return new LodashWrapper(this.value(), this.__chain__);
  9497. }
  9498. /**
  9499. * Gets the next value on a wrapped object following the
  9500. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9501. *
  9502. * @name next
  9503. * @memberOf _
  9504. * @since 4.0.0
  9505. * @category Seq
  9506. * @returns {Object} Returns the next iterator value.
  9507. * @example
  9508. *
  9509. * var wrapped = _([1, 2]);
  9510. *
  9511. * wrapped.next();
  9512. * // => { 'done': false, 'value': 1 }
  9513. *
  9514. * wrapped.next();
  9515. * // => { 'done': false, 'value': 2 }
  9516. *
  9517. * wrapped.next();
  9518. * // => { 'done': true, 'value': undefined }
  9519. */
  9520. function wrapperNext() {
  9521. if (this.__values__ === undefined) {
  9522. this.__values__ = toArray(this.value());
  9523. }
  9524. var done = this.__index__ >= this.__values__.length,
  9525. value = done ? undefined : this.__values__[this.__index__++];
  9526. return { 'done': done, 'value': value };
  9527. }
  9528. /**
  9529. * Enables the wrapper to be iterable.
  9530. *
  9531. * @name Symbol.iterator
  9532. * @memberOf _
  9533. * @since 4.0.0
  9534. * @category Seq
  9535. * @returns {Object} Returns the wrapper object.
  9536. * @example
  9537. *
  9538. * var wrapped = _([1, 2]);
  9539. *
  9540. * wrapped[Symbol.iterator]() === wrapped;
  9541. * // => true
  9542. *
  9543. * Array.from(wrapped);
  9544. * // => [1, 2]
  9545. */
  9546. function wrapperToIterator() {
  9547. return this;
  9548. }
  9549. /**
  9550. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9551. *
  9552. * @name plant
  9553. * @memberOf _
  9554. * @since 3.2.0
  9555. * @category Seq
  9556. * @param {*} value The value to plant.
  9557. * @returns {Object} Returns the new `lodash` wrapper instance.
  9558. * @example
  9559. *
  9560. * function square(n) {
  9561. * return n * n;
  9562. * }
  9563. *
  9564. * var wrapped = _([1, 2]).map(square);
  9565. * var other = wrapped.plant([3, 4]);
  9566. *
  9567. * other.value();
  9568. * // => [9, 16]
  9569. *
  9570. * wrapped.value();
  9571. * // => [1, 4]
  9572. */
  9573. function wrapperPlant(value) {
  9574. var result,
  9575. parent = this;
  9576. while (parent instanceof baseLodash) {
  9577. var clone = wrapperClone(parent);
  9578. clone.__index__ = 0;
  9579. clone.__values__ = undefined;
  9580. if (result) {
  9581. previous.__wrapped__ = clone;
  9582. } else {
  9583. result = clone;
  9584. }
  9585. var previous = clone;
  9586. parent = parent.__wrapped__;
  9587. }
  9588. previous.__wrapped__ = value;
  9589. return result;
  9590. }
  9591. /**
  9592. * This method is the wrapper version of `_.reverse`.
  9593. *
  9594. * **Note:** This method mutates the wrapped array.
  9595. *
  9596. * @name reverse
  9597. * @memberOf _
  9598. * @since 0.1.0
  9599. * @category Seq
  9600. * @returns {Object} Returns the new `lodash` wrapper instance.
  9601. * @example
  9602. *
  9603. * var array = [1, 2, 3];
  9604. *
  9605. * _(array).reverse().value()
  9606. * // => [3, 2, 1]
  9607. *
  9608. * console.log(array);
  9609. * // => [3, 2, 1]
  9610. */
  9611. function wrapperReverse() {
  9612. var value = this.__wrapped__;
  9613. if (value instanceof LazyWrapper) {
  9614. var wrapped = value;
  9615. if (this.__actions__.length) {
  9616. wrapped = new LazyWrapper(this);
  9617. }
  9618. wrapped = wrapped.reverse();
  9619. wrapped.__actions__.push({
  9620. 'func': thru,
  9621. 'args': [reverse],
  9622. 'thisArg': undefined
  9623. });
  9624. return new LodashWrapper(wrapped, this.__chain__);
  9625. }
  9626. return this.thru(reverse);
  9627. }
  9628. /**
  9629. * Executes the chain sequence to resolve the unwrapped value.
  9630. *
  9631. * @name value
  9632. * @memberOf _
  9633. * @since 0.1.0
  9634. * @alias toJSON, valueOf
  9635. * @category Seq
  9636. * @returns {*} Returns the resolved unwrapped value.
  9637. * @example
  9638. *
  9639. * _([1, 2, 3]).value();
  9640. * // => [1, 2, 3]
  9641. */
  9642. function wrapperValue() {
  9643. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9644. }
  9645. /*------------------------------------------------------------------------*/
  9646. /**
  9647. * Creates an object composed of keys generated from the results of running
  9648. * each element of `collection` thru `iteratee`. The corresponding value of
  9649. * each key is the number of times the key was returned by `iteratee`. The
  9650. * iteratee is invoked with one argument: (value).
  9651. *
  9652. * @static
  9653. * @memberOf _
  9654. * @since 0.5.0
  9655. * @category Collection
  9656. * @param {Array|Object} collection The collection to iterate over.
  9657. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9658. * @returns {Object} Returns the composed aggregate object.
  9659. * @example
  9660. *
  9661. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9662. * // => { '4': 1, '6': 2 }
  9663. *
  9664. * // The `_.property` iteratee shorthand.
  9665. * _.countBy(['one', 'two', 'three'], 'length');
  9666. * // => { '3': 2, '5': 1 }
  9667. */
  9668. var countBy = createAggregator(function(result, value, key) {
  9669. if (hasOwnProperty.call(result, key)) {
  9670. ++result[key];
  9671. } else {
  9672. baseAssignValue(result, key, 1);
  9673. }
  9674. });
  9675. /**
  9676. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9677. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9678. * invoked with three arguments: (value, index|key, collection).
  9679. *
  9680. * **Note:** This method returns `true` for
  9681. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9682. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9683. * elements of empty collections.
  9684. *
  9685. * @static
  9686. * @memberOf _
  9687. * @since 0.1.0
  9688. * @category Collection
  9689. * @param {Array|Object} collection The collection to iterate over.
  9690. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9691. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9692. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9693. * else `false`.
  9694. * @example
  9695. *
  9696. * _.every([true, 1, null, 'yes'], Boolean);
  9697. * // => false
  9698. *
  9699. * var users = [
  9700. * { 'user': 'barney', 'age': 36, 'active': false },
  9701. * { 'user': 'fred', 'age': 40, 'active': false }
  9702. * ];
  9703. *
  9704. * // The `_.matches` iteratee shorthand.
  9705. * _.every(users, { 'user': 'barney', 'active': false });
  9706. * // => false
  9707. *
  9708. * // The `_.matchesProperty` iteratee shorthand.
  9709. * _.every(users, ['active', false]);
  9710. * // => true
  9711. *
  9712. * // The `_.property` iteratee shorthand.
  9713. * _.every(users, 'active');
  9714. * // => false
  9715. */
  9716. function every(collection, predicate, guard) {
  9717. var func = isArray(collection) ? arrayEvery : baseEvery;
  9718. if (guard && isIterateeCall(collection, predicate, guard)) {
  9719. predicate = undefined;
  9720. }
  9721. return func(collection, getIteratee(predicate, 3));
  9722. }
  9723. /**
  9724. * Iterates over elements of `collection`, returning an array of all elements
  9725. * `predicate` returns truthy for. The predicate is invoked with three
  9726. * arguments: (value, index|key, collection).
  9727. *
  9728. * **Note:** Unlike `_.remove`, this method returns a new array.
  9729. *
  9730. * @static
  9731. * @memberOf _
  9732. * @since 0.1.0
  9733. * @category Collection
  9734. * @param {Array|Object} collection The collection to iterate over.
  9735. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9736. * @returns {Array} Returns the new filtered array.
  9737. * @see _.reject
  9738. * @example
  9739. *
  9740. * var users = [
  9741. * { 'user': 'barney', 'age': 36, 'active': true },
  9742. * { 'user': 'fred', 'age': 40, 'active': false }
  9743. * ];
  9744. *
  9745. * _.filter(users, function(o) { return !o.active; });
  9746. * // => objects for ['fred']
  9747. *
  9748. * // The `_.matches` iteratee shorthand.
  9749. * _.filter(users, { 'age': 36, 'active': true });
  9750. * // => objects for ['barney']
  9751. *
  9752. * // The `_.matchesProperty` iteratee shorthand.
  9753. * _.filter(users, ['active', false]);
  9754. * // => objects for ['fred']
  9755. *
  9756. * // The `_.property` iteratee shorthand.
  9757. * _.filter(users, 'active');
  9758. * // => objects for ['barney']
  9759. *
  9760. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9761. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9762. * // => objects for ['fred', 'barney']
  9763. */
  9764. function filter(collection, predicate) {
  9765. var func = isArray(collection) ? arrayFilter : baseFilter;
  9766. return func(collection, getIteratee(predicate, 3));
  9767. }
  9768. /**
  9769. * Iterates over elements of `collection`, returning the first element
  9770. * `predicate` returns truthy for. The predicate is invoked with three
  9771. * arguments: (value, index|key, collection).
  9772. *
  9773. * @static
  9774. * @memberOf _
  9775. * @since 0.1.0
  9776. * @category Collection
  9777. * @param {Array|Object} collection The collection to inspect.
  9778. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9779. * @param {number} [fromIndex=0] The index to search from.
  9780. * @returns {*} Returns the matched element, else `undefined`.
  9781. * @example
  9782. *
  9783. * var users = [
  9784. * { 'user': 'barney', 'age': 36, 'active': true },
  9785. * { 'user': 'fred', 'age': 40, 'active': false },
  9786. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9787. * ];
  9788. *
  9789. * _.find(users, function(o) { return o.age < 40; });
  9790. * // => object for 'barney'
  9791. *
  9792. * // The `_.matches` iteratee shorthand.
  9793. * _.find(users, { 'age': 1, 'active': true });
  9794. * // => object for 'pebbles'
  9795. *
  9796. * // The `_.matchesProperty` iteratee shorthand.
  9797. * _.find(users, ['active', false]);
  9798. * // => object for 'fred'
  9799. *
  9800. * // The `_.property` iteratee shorthand.
  9801. * _.find(users, 'active');
  9802. * // => object for 'barney'
  9803. */
  9804. var find = createFind(findIndex);
  9805. /**
  9806. * This method is like `_.find` except that it iterates over elements of
  9807. * `collection` from right to left.
  9808. *
  9809. * @static
  9810. * @memberOf _
  9811. * @since 2.0.0
  9812. * @category Collection
  9813. * @param {Array|Object} collection The collection to inspect.
  9814. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9815. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9816. * @returns {*} Returns the matched element, else `undefined`.
  9817. * @example
  9818. *
  9819. * _.findLast([1, 2, 3, 4], function(n) {
  9820. * return n % 2 == 1;
  9821. * });
  9822. * // => 3
  9823. */
  9824. var findLast = createFind(findLastIndex);
  9825. /**
  9826. * Creates a flattened array of values by running each element in `collection`
  9827. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9828. * with three arguments: (value, index|key, collection).
  9829. *
  9830. * @static
  9831. * @memberOf _
  9832. * @since 4.0.0
  9833. * @category Collection
  9834. * @param {Array|Object} collection The collection to iterate over.
  9835. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9836. * @returns {Array} Returns the new flattened array.
  9837. * @example
  9838. *
  9839. * function duplicate(n) {
  9840. * return [n, n];
  9841. * }
  9842. *
  9843. * _.flatMap([1, 2], duplicate);
  9844. * // => [1, 1, 2, 2]
  9845. */
  9846. function flatMap(collection, iteratee) {
  9847. return baseFlatten(map(collection, iteratee), 1);
  9848. }
  9849. /**
  9850. * This method is like `_.flatMap` except that it recursively flattens the
  9851. * mapped results.
  9852. *
  9853. * @static
  9854. * @memberOf _
  9855. * @since 4.7.0
  9856. * @category Collection
  9857. * @param {Array|Object} collection The collection to iterate over.
  9858. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9859. * @returns {Array} Returns the new flattened array.
  9860. * @example
  9861. *
  9862. * function duplicate(n) {
  9863. * return [[[n, n]]];
  9864. * }
  9865. *
  9866. * _.flatMapDeep([1, 2], duplicate);
  9867. * // => [1, 1, 2, 2]
  9868. */
  9869. function flatMapDeep(collection, iteratee) {
  9870. return baseFlatten(map(collection, iteratee), INFINITY);
  9871. }
  9872. /**
  9873. * This method is like `_.flatMap` except that it recursively flattens the
  9874. * mapped results up to `depth` times.
  9875. *
  9876. * @static
  9877. * @memberOf _
  9878. * @since 4.7.0
  9879. * @category Collection
  9880. * @param {Array|Object} collection The collection to iterate over.
  9881. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9882. * @param {number} [depth=1] The maximum recursion depth.
  9883. * @returns {Array} Returns the new flattened array.
  9884. * @example
  9885. *
  9886. * function duplicate(n) {
  9887. * return [[[n, n]]];
  9888. * }
  9889. *
  9890. * _.flatMapDepth([1, 2], duplicate, 2);
  9891. * // => [[1, 1], [2, 2]]
  9892. */
  9893. function flatMapDepth(collection, iteratee, depth) {
  9894. depth = depth === undefined ? 1 : toInteger(depth);
  9895. return baseFlatten(map(collection, iteratee), depth);
  9896. }
  9897. /**
  9898. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9899. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9900. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9901. *
  9902. * **Note:** As with other "Collections" methods, objects with a "length"
  9903. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9904. * or `_.forOwn` for object iteration.
  9905. *
  9906. * @static
  9907. * @memberOf _
  9908. * @since 0.1.0
  9909. * @alias each
  9910. * @category Collection
  9911. * @param {Array|Object} collection The collection to iterate over.
  9912. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9913. * @returns {Array|Object} Returns `collection`.
  9914. * @see _.forEachRight
  9915. * @example
  9916. *
  9917. * _.forEach([1, 2], function(value) {
  9918. * console.log(value);
  9919. * });
  9920. * // => Logs `1` then `2`.
  9921. *
  9922. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9923. * console.log(key);
  9924. * });
  9925. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9926. */
  9927. function forEach(collection, iteratee) {
  9928. var func = isArray(collection) ? arrayEach : baseEach;
  9929. return func(collection, getIteratee(iteratee, 3));
  9930. }
  9931. /**
  9932. * This method is like `_.forEach` except that it iterates over elements of
  9933. * `collection` from right to left.
  9934. *
  9935. * @static
  9936. * @memberOf _
  9937. * @since 2.0.0
  9938. * @alias eachRight
  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|Object} Returns `collection`.
  9943. * @see _.forEach
  9944. * @example
  9945. *
  9946. * _.forEachRight([1, 2], function(value) {
  9947. * console.log(value);
  9948. * });
  9949. * // => Logs `2` then `1`.
  9950. */
  9951. function forEachRight(collection, iteratee) {
  9952. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9953. return func(collection, getIteratee(iteratee, 3));
  9954. }
  9955. /**
  9956. * Creates an object composed of keys generated from the results of running
  9957. * each element of `collection` thru `iteratee`. The order of grouped values
  9958. * is determined by the order they occur in `collection`. The corresponding
  9959. * value of each key is an array of elements responsible for generating the
  9960. * key. The iteratee is invoked with one argument: (value).
  9961. *
  9962. * @static
  9963. * @memberOf _
  9964. * @since 0.1.0
  9965. * @category Collection
  9966. * @param {Array|Object} collection The collection to iterate over.
  9967. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9968. * @returns {Object} Returns the composed aggregate object.
  9969. * @example
  9970. *
  9971. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9972. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9973. *
  9974. * // The `_.property` iteratee shorthand.
  9975. * _.groupBy(['one', 'two', 'three'], 'length');
  9976. * // => { '3': ['one', 'two'], '5': ['three'] }
  9977. */
  9978. var groupBy = createAggregator(function(result, value, key) {
  9979. if (hasOwnProperty.call(result, key)) {
  9980. result[key].push(value);
  9981. } else {
  9982. baseAssignValue(result, key, [value]);
  9983. }
  9984. });
  9985. /**
  9986. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9987. * checked for a substring of `value`, otherwise
  9988. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9989. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9990. * the offset from the end of `collection`.
  9991. *
  9992. * @static
  9993. * @memberOf _
  9994. * @since 0.1.0
  9995. * @category Collection
  9996. * @param {Array|Object|string} collection The collection to inspect.
  9997. * @param {*} value The value to search for.
  9998. * @param {number} [fromIndex=0] The index to search from.
  9999. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10000. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10001. * @example
  10002. *
  10003. * _.includes([1, 2, 3], 1);
  10004. * // => true
  10005. *
  10006. * _.includes([1, 2, 3], 1, 2);
  10007. * // => false
  10008. *
  10009. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10010. * // => true
  10011. *
  10012. * _.includes('abcd', 'bc');
  10013. * // => true
  10014. */
  10015. function includes(collection, value, fromIndex, guard) {
  10016. collection = isArrayLike(collection) ? collection : values(collection);
  10017. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10018. var length = collection.length;
  10019. if (fromIndex < 0) {
  10020. fromIndex = nativeMax(length + fromIndex, 0);
  10021. }
  10022. return isString(collection)
  10023. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10024. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10025. }
  10026. /**
  10027. * Invokes the method at `path` of each element in `collection`, returning
  10028. * an array of the results of each invoked method. Any additional arguments
  10029. * are provided to each invoked method. If `path` is a function, it's invoked
  10030. * for, and `this` bound to, each element in `collection`.
  10031. *
  10032. * @static
  10033. * @memberOf _
  10034. * @since 4.0.0
  10035. * @category Collection
  10036. * @param {Array|Object} collection The collection to iterate over.
  10037. * @param {Array|Function|string} path The path of the method to invoke or
  10038. * the function invoked per iteration.
  10039. * @param {...*} [args] The arguments to invoke each method with.
  10040. * @returns {Array} Returns the array of results.
  10041. * @example
  10042. *
  10043. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10044. * // => [[1, 5, 7], [1, 2, 3]]
  10045. *
  10046. * _.invokeMap([123, 456], String.prototype.split, '');
  10047. * // => [['1', '2', '3'], ['4', '5', '6']]
  10048. */
  10049. var invokeMap = baseRest(function(collection, path, args) {
  10050. var index = -1,
  10051. isFunc = typeof path == 'function',
  10052. result = isArrayLike(collection) ? Array(collection.length) : [];
  10053. baseEach(collection, function(value) {
  10054. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10055. });
  10056. return result;
  10057. });
  10058. /**
  10059. * Creates an object composed of keys generated from the results of running
  10060. * each element of `collection` thru `iteratee`. The corresponding value of
  10061. * each key is the last element responsible for generating the key. The
  10062. * iteratee is invoked with one argument: (value).
  10063. *
  10064. * @static
  10065. * @memberOf _
  10066. * @since 4.0.0
  10067. * @category Collection
  10068. * @param {Array|Object} collection The collection to iterate over.
  10069. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10070. * @returns {Object} Returns the composed aggregate object.
  10071. * @example
  10072. *
  10073. * var array = [
  10074. * { 'dir': 'left', 'code': 97 },
  10075. * { 'dir': 'right', 'code': 100 }
  10076. * ];
  10077. *
  10078. * _.keyBy(array, function(o) {
  10079. * return String.fromCharCode(o.code);
  10080. * });
  10081. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10082. *
  10083. * _.keyBy(array, 'dir');
  10084. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10085. */
  10086. var keyBy = createAggregator(function(result, value, key) {
  10087. baseAssignValue(result, key, value);
  10088. });
  10089. /**
  10090. * Creates an array of values by running each element in `collection` thru
  10091. * `iteratee`. The iteratee is invoked with three arguments:
  10092. * (value, index|key, collection).
  10093. *
  10094. * Many lodash methods are guarded to work as iteratees for methods like
  10095. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10096. *
  10097. * The guarded methods are:
  10098. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10099. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10100. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10101. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10102. *
  10103. * @static
  10104. * @memberOf _
  10105. * @since 0.1.0
  10106. * @category Collection
  10107. * @param {Array|Object} collection The collection to iterate over.
  10108. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10109. * @returns {Array} Returns the new mapped array.
  10110. * @example
  10111. *
  10112. * function square(n) {
  10113. * return n * n;
  10114. * }
  10115. *
  10116. * _.map([4, 8], square);
  10117. * // => [16, 64]
  10118. *
  10119. * _.map({ 'a': 4, 'b': 8 }, square);
  10120. * // => [16, 64] (iteration order is not guaranteed)
  10121. *
  10122. * var users = [
  10123. * { 'user': 'barney' },
  10124. * { 'user': 'fred' }
  10125. * ];
  10126. *
  10127. * // The `_.property` iteratee shorthand.
  10128. * _.map(users, 'user');
  10129. * // => ['barney', 'fred']
  10130. */
  10131. function map(collection, iteratee) {
  10132. var func = isArray(collection) ? arrayMap : baseMap;
  10133. return func(collection, getIteratee(iteratee, 3));
  10134. }
  10135. /**
  10136. * This method is like `_.sortBy` except that it allows specifying the sort
  10137. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10138. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10139. * descending or "asc" for ascending sort order of corresponding values.
  10140. *
  10141. * @static
  10142. * @memberOf _
  10143. * @since 4.0.0
  10144. * @category Collection
  10145. * @param {Array|Object} collection The collection to iterate over.
  10146. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10147. * The iteratees to sort by.
  10148. * @param {string[]} [orders] The sort orders of `iteratees`.
  10149. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10150. * @returns {Array} Returns the new sorted array.
  10151. * @example
  10152. *
  10153. * var users = [
  10154. * { 'user': 'fred', 'age': 48 },
  10155. * { 'user': 'barney', 'age': 34 },
  10156. * { 'user': 'fred', 'age': 40 },
  10157. * { 'user': 'barney', 'age': 36 }
  10158. * ];
  10159. *
  10160. * // Sort by `user` in ascending order and by `age` in descending order.
  10161. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10162. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10163. */
  10164. function orderBy(collection, iteratees, orders, guard) {
  10165. if (collection == null) {
  10166. return [];
  10167. }
  10168. if (!isArray(iteratees)) {
  10169. iteratees = iteratees == null ? [] : [iteratees];
  10170. }
  10171. orders = guard ? undefined : orders;
  10172. if (!isArray(orders)) {
  10173. orders = orders == null ? [] : [orders];
  10174. }
  10175. return baseOrderBy(collection, iteratees, orders);
  10176. }
  10177. /**
  10178. * Creates an array of elements split into two groups, the first of which
  10179. * contains elements `predicate` returns truthy for, the second of which
  10180. * contains elements `predicate` returns falsey for. The predicate is
  10181. * invoked with one argument: (value).
  10182. *
  10183. * @static
  10184. * @memberOf _
  10185. * @since 3.0.0
  10186. * @category Collection
  10187. * @param {Array|Object} collection The collection to iterate over.
  10188. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10189. * @returns {Array} Returns the array of grouped elements.
  10190. * @example
  10191. *
  10192. * var users = [
  10193. * { 'user': 'barney', 'age': 36, 'active': false },
  10194. * { 'user': 'fred', 'age': 40, 'active': true },
  10195. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10196. * ];
  10197. *
  10198. * _.partition(users, function(o) { return o.active; });
  10199. * // => objects for [['fred'], ['barney', 'pebbles']]
  10200. *
  10201. * // The `_.matches` iteratee shorthand.
  10202. * _.partition(users, { 'age': 1, 'active': false });
  10203. * // => objects for [['pebbles'], ['barney', 'fred']]
  10204. *
  10205. * // The `_.matchesProperty` iteratee shorthand.
  10206. * _.partition(users, ['active', false]);
  10207. * // => objects for [['barney', 'pebbles'], ['fred']]
  10208. *
  10209. * // The `_.property` iteratee shorthand.
  10210. * _.partition(users, 'active');
  10211. * // => objects for [['fred'], ['barney', 'pebbles']]
  10212. */
  10213. var partition = createAggregator(function(result, value, key) {
  10214. result[key ? 0 : 1].push(value);
  10215. }, function() { return [[], []]; });
  10216. /**
  10217. * Reduces `collection` to a value which is the accumulated result of running
  10218. * each element in `collection` thru `iteratee`, where each successive
  10219. * invocation is supplied the return value of the previous. If `accumulator`
  10220. * is not given, the first element of `collection` is used as the initial
  10221. * value. The iteratee is invoked with four arguments:
  10222. * (accumulator, value, index|key, collection).
  10223. *
  10224. * Many lodash methods are guarded to work as iteratees for methods like
  10225. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10226. *
  10227. * The guarded methods are:
  10228. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10229. * and `sortBy`
  10230. *
  10231. * @static
  10232. * @memberOf _
  10233. * @since 0.1.0
  10234. * @category Collection
  10235. * @param {Array|Object} collection The collection to iterate over.
  10236. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10237. * @param {*} [accumulator] The initial value.
  10238. * @returns {*} Returns the accumulated value.
  10239. * @see _.reduceRight
  10240. * @example
  10241. *
  10242. * _.reduce([1, 2], function(sum, n) {
  10243. * return sum + n;
  10244. * }, 0);
  10245. * // => 3
  10246. *
  10247. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10248. * (result[value] || (result[value] = [])).push(key);
  10249. * return result;
  10250. * }, {});
  10251. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10252. */
  10253. function reduce(collection, iteratee, accumulator) {
  10254. var func = isArray(collection) ? arrayReduce : baseReduce,
  10255. initAccum = arguments.length < 3;
  10256. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10257. }
  10258. /**
  10259. * This method is like `_.reduce` except that it iterates over elements of
  10260. * `collection` from right to left.
  10261. *
  10262. * @static
  10263. * @memberOf _
  10264. * @since 0.1.0
  10265. * @category Collection
  10266. * @param {Array|Object} collection The collection to iterate over.
  10267. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10268. * @param {*} [accumulator] The initial value.
  10269. * @returns {*} Returns the accumulated value.
  10270. * @see _.reduce
  10271. * @example
  10272. *
  10273. * var array = [[0, 1], [2, 3], [4, 5]];
  10274. *
  10275. * _.reduceRight(array, function(flattened, other) {
  10276. * return flattened.concat(other);
  10277. * }, []);
  10278. * // => [4, 5, 2, 3, 0, 1]
  10279. */
  10280. function reduceRight(collection, iteratee, accumulator) {
  10281. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10282. initAccum = arguments.length < 3;
  10283. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10284. }
  10285. /**
  10286. * The opposite of `_.filter`; this method returns the elements of `collection`
  10287. * that `predicate` does **not** return truthy for.
  10288. *
  10289. * @static
  10290. * @memberOf _
  10291. * @since 0.1.0
  10292. * @category Collection
  10293. * @param {Array|Object} collection The collection to iterate over.
  10294. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10295. * @returns {Array} Returns the new filtered array.
  10296. * @see _.filter
  10297. * @example
  10298. *
  10299. * var users = [
  10300. * { 'user': 'barney', 'age': 36, 'active': false },
  10301. * { 'user': 'fred', 'age': 40, 'active': true }
  10302. * ];
  10303. *
  10304. * _.reject(users, function(o) { return !o.active; });
  10305. * // => objects for ['fred']
  10306. *
  10307. * // The `_.matches` iteratee shorthand.
  10308. * _.reject(users, { 'age': 40, 'active': true });
  10309. * // => objects for ['barney']
  10310. *
  10311. * // The `_.matchesProperty` iteratee shorthand.
  10312. * _.reject(users, ['active', false]);
  10313. * // => objects for ['fred']
  10314. *
  10315. * // The `_.property` iteratee shorthand.
  10316. * _.reject(users, 'active');
  10317. * // => objects for ['barney']
  10318. */
  10319. function reject(collection, predicate) {
  10320. var func = isArray(collection) ? arrayFilter : baseFilter;
  10321. return func(collection, negate(getIteratee(predicate, 3)));
  10322. }
  10323. /**
  10324. * Gets a random element from `collection`.
  10325. *
  10326. * @static
  10327. * @memberOf _
  10328. * @since 2.0.0
  10329. * @category Collection
  10330. * @param {Array|Object} collection The collection to sample.
  10331. * @returns {*} Returns the random element.
  10332. * @example
  10333. *
  10334. * _.sample([1, 2, 3, 4]);
  10335. * // => 2
  10336. */
  10337. function sample(collection) {
  10338. var func = isArray(collection) ? arraySample : baseSample;
  10339. return func(collection);
  10340. }
  10341. /**
  10342. * Gets `n` random elements at unique keys from `collection` up to the
  10343. * size of `collection`.
  10344. *
  10345. * @static
  10346. * @memberOf _
  10347. * @since 4.0.0
  10348. * @category Collection
  10349. * @param {Array|Object} collection The collection to sample.
  10350. * @param {number} [n=1] The number of elements to sample.
  10351. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10352. * @returns {Array} Returns the random elements.
  10353. * @example
  10354. *
  10355. * _.sampleSize([1, 2, 3], 2);
  10356. * // => [3, 1]
  10357. *
  10358. * _.sampleSize([1, 2, 3], 4);
  10359. * // => [2, 3, 1]
  10360. */
  10361. function sampleSize(collection, n, guard) {
  10362. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10363. n = 1;
  10364. } else {
  10365. n = toInteger(n);
  10366. }
  10367. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10368. return func(collection, n);
  10369. }
  10370. /**
  10371. * Creates an array of shuffled values, using a version of the
  10372. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10373. *
  10374. * @static
  10375. * @memberOf _
  10376. * @since 0.1.0
  10377. * @category Collection
  10378. * @param {Array|Object} collection The collection to shuffle.
  10379. * @returns {Array} Returns the new shuffled array.
  10380. * @example
  10381. *
  10382. * _.shuffle([1, 2, 3, 4]);
  10383. * // => [4, 1, 3, 2]
  10384. */
  10385. function shuffle(collection) {
  10386. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10387. return func(collection);
  10388. }
  10389. /**
  10390. * Gets the size of `collection` by returning its length for array-like
  10391. * values or the number of own enumerable string keyed properties for objects.
  10392. *
  10393. * @static
  10394. * @memberOf _
  10395. * @since 0.1.0
  10396. * @category Collection
  10397. * @param {Array|Object|string} collection The collection to inspect.
  10398. * @returns {number} Returns the collection size.
  10399. * @example
  10400. *
  10401. * _.size([1, 2, 3]);
  10402. * // => 3
  10403. *
  10404. * _.size({ 'a': 1, 'b': 2 });
  10405. * // => 2
  10406. *
  10407. * _.size('pebbles');
  10408. * // => 7
  10409. */
  10410. function size(collection) {
  10411. if (collection == null) {
  10412. return 0;
  10413. }
  10414. if (isArrayLike(collection)) {
  10415. return isString(collection) ? stringSize(collection) : collection.length;
  10416. }
  10417. var tag = getTag(collection);
  10418. if (tag == mapTag || tag == setTag) {
  10419. return collection.size;
  10420. }
  10421. return baseKeys(collection).length;
  10422. }
  10423. /**
  10424. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10425. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10426. * invoked with three arguments: (value, index|key, collection).
  10427. *
  10428. * @static
  10429. * @memberOf _
  10430. * @since 0.1.0
  10431. * @category Collection
  10432. * @param {Array|Object} collection The collection to iterate over.
  10433. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10434. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10435. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10436. * else `false`.
  10437. * @example
  10438. *
  10439. * _.some([null, 0, 'yes', false], Boolean);
  10440. * // => true
  10441. *
  10442. * var users = [
  10443. * { 'user': 'barney', 'active': true },
  10444. * { 'user': 'fred', 'active': false }
  10445. * ];
  10446. *
  10447. * // The `_.matches` iteratee shorthand.
  10448. * _.some(users, { 'user': 'barney', 'active': false });
  10449. * // => false
  10450. *
  10451. * // The `_.matchesProperty` iteratee shorthand.
  10452. * _.some(users, ['active', false]);
  10453. * // => true
  10454. *
  10455. * // The `_.property` iteratee shorthand.
  10456. * _.some(users, 'active');
  10457. * // => true
  10458. */
  10459. function some(collection, predicate, guard) {
  10460. var func = isArray(collection) ? arraySome : baseSome;
  10461. if (guard && isIterateeCall(collection, predicate, guard)) {
  10462. predicate = undefined;
  10463. }
  10464. return func(collection, getIteratee(predicate, 3));
  10465. }
  10466. /**
  10467. * Creates an array of elements, sorted in ascending order by the results of
  10468. * running each element in a collection thru each iteratee. This method
  10469. * performs a stable sort, that is, it preserves the original sort order of
  10470. * equal elements. The iteratees are invoked with one argument: (value).
  10471. *
  10472. * @static
  10473. * @memberOf _
  10474. * @since 0.1.0
  10475. * @category Collection
  10476. * @param {Array|Object} collection The collection to iterate over.
  10477. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10478. * The iteratees to sort by.
  10479. * @returns {Array} Returns the new sorted array.
  10480. * @example
  10481. *
  10482. * var users = [
  10483. * { 'user': 'fred', 'age': 48 },
  10484. * { 'user': 'barney', 'age': 36 },
  10485. * { 'user': 'fred', 'age': 30 },
  10486. * { 'user': 'barney', 'age': 34 }
  10487. * ];
  10488. *
  10489. * _.sortBy(users, [function(o) { return o.user; }]);
  10490. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10491. *
  10492. * _.sortBy(users, ['user', 'age']);
  10493. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10494. */
  10495. var sortBy = baseRest(function(collection, iteratees) {
  10496. if (collection == null) {
  10497. return [];
  10498. }
  10499. var length = iteratees.length;
  10500. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10501. iteratees = [];
  10502. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10503. iteratees = [iteratees[0]];
  10504. }
  10505. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10506. });
  10507. /*------------------------------------------------------------------------*/
  10508. /**
  10509. * Gets the timestamp of the number of milliseconds that have elapsed since
  10510. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10511. *
  10512. * @static
  10513. * @memberOf _
  10514. * @since 2.4.0
  10515. * @category Date
  10516. * @returns {number} Returns the timestamp.
  10517. * @example
  10518. *
  10519. * _.defer(function(stamp) {
  10520. * console.log(_.now() - stamp);
  10521. * }, _.now());
  10522. * // => Logs the number of milliseconds it took for the deferred invocation.
  10523. */
  10524. var now = ctxNow || function() {
  10525. return root.Date.now();
  10526. };
  10527. /*------------------------------------------------------------------------*/
  10528. /**
  10529. * The opposite of `_.before`; this method creates a function that invokes
  10530. * `func` once it's called `n` or more times.
  10531. *
  10532. * @static
  10533. * @memberOf _
  10534. * @since 0.1.0
  10535. * @category Function
  10536. * @param {number} n The number of calls before `func` is invoked.
  10537. * @param {Function} func The function to restrict.
  10538. * @returns {Function} Returns the new restricted function.
  10539. * @example
  10540. *
  10541. * var saves = ['profile', 'settings'];
  10542. *
  10543. * var done = _.after(saves.length, function() {
  10544. * console.log('done saving!');
  10545. * });
  10546. *
  10547. * _.forEach(saves, function(type) {
  10548. * asyncSave({ 'type': type, 'complete': done });
  10549. * });
  10550. * // => Logs 'done saving!' after the two async saves have completed.
  10551. */
  10552. function after(n, func) {
  10553. if (typeof func != 'function') {
  10554. throw new TypeError(FUNC_ERROR_TEXT);
  10555. }
  10556. n = toInteger(n);
  10557. return function() {
  10558. if (--n < 1) {
  10559. return func.apply(this, arguments);
  10560. }
  10561. };
  10562. }
  10563. /**
  10564. * Creates a function that invokes `func`, with up to `n` arguments,
  10565. * ignoring any additional arguments.
  10566. *
  10567. * @static
  10568. * @memberOf _
  10569. * @since 3.0.0
  10570. * @category Function
  10571. * @param {Function} func The function to cap arguments for.
  10572. * @param {number} [n=func.length] The arity cap.
  10573. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10574. * @returns {Function} Returns the new capped function.
  10575. * @example
  10576. *
  10577. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10578. * // => [6, 8, 10]
  10579. */
  10580. function ary(func, n, guard) {
  10581. n = guard ? undefined : n;
  10582. n = (func && n == null) ? func.length : n;
  10583. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10584. }
  10585. /**
  10586. * Creates a function that invokes `func`, with the `this` binding and arguments
  10587. * of the created function, while it's called less than `n` times. Subsequent
  10588. * calls to the created function return the result of the last `func` invocation.
  10589. *
  10590. * @static
  10591. * @memberOf _
  10592. * @since 3.0.0
  10593. * @category Function
  10594. * @param {number} n The number of calls at which `func` is no longer invoked.
  10595. * @param {Function} func The function to restrict.
  10596. * @returns {Function} Returns the new restricted function.
  10597. * @example
  10598. *
  10599. * jQuery(element).on('click', _.before(5, addContactToList));
  10600. * // => Allows adding up to 4 contacts to the list.
  10601. */
  10602. function before(n, func) {
  10603. var result;
  10604. if (typeof func != 'function') {
  10605. throw new TypeError(FUNC_ERROR_TEXT);
  10606. }
  10607. n = toInteger(n);
  10608. return function() {
  10609. if (--n > 0) {
  10610. result = func.apply(this, arguments);
  10611. }
  10612. if (n <= 1) {
  10613. func = undefined;
  10614. }
  10615. return result;
  10616. };
  10617. }
  10618. /**
  10619. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10620. * and `partials` prepended to the arguments it receives.
  10621. *
  10622. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10623. * may be used as a placeholder for partially applied arguments.
  10624. *
  10625. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10626. * property of bound functions.
  10627. *
  10628. * @static
  10629. * @memberOf _
  10630. * @since 0.1.0
  10631. * @category Function
  10632. * @param {Function} func The function to bind.
  10633. * @param {*} thisArg The `this` binding of `func`.
  10634. * @param {...*} [partials] The arguments to be partially applied.
  10635. * @returns {Function} Returns the new bound function.
  10636. * @example
  10637. *
  10638. * function greet(greeting, punctuation) {
  10639. * return greeting + ' ' + this.user + punctuation;
  10640. * }
  10641. *
  10642. * var object = { 'user': 'fred' };
  10643. *
  10644. * var bound = _.bind(greet, object, 'hi');
  10645. * bound('!');
  10646. * // => 'hi fred!'
  10647. *
  10648. * // Bound with placeholders.
  10649. * var bound = _.bind(greet, object, _, '!');
  10650. * bound('hi');
  10651. * // => 'hi fred!'
  10652. */
  10653. var bind = baseRest(function(func, thisArg, partials) {
  10654. var bitmask = WRAP_BIND_FLAG;
  10655. if (partials.length) {
  10656. var holders = replaceHolders(partials, getHolder(bind));
  10657. bitmask |= WRAP_PARTIAL_FLAG;
  10658. }
  10659. return createWrap(func, bitmask, thisArg, partials, holders);
  10660. });
  10661. /**
  10662. * Creates a function that invokes the method at `object[key]` with `partials`
  10663. * prepended to the arguments it receives.
  10664. *
  10665. * This method differs from `_.bind` by allowing bound functions to reference
  10666. * methods that may be redefined or don't yet exist. See
  10667. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10668. * for more details.
  10669. *
  10670. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10671. * builds, may be used as a placeholder for partially applied arguments.
  10672. *
  10673. * @static
  10674. * @memberOf _
  10675. * @since 0.10.0
  10676. * @category Function
  10677. * @param {Object} object The object to invoke the method on.
  10678. * @param {string} key The key of the method.
  10679. * @param {...*} [partials] The arguments to be partially applied.
  10680. * @returns {Function} Returns the new bound function.
  10681. * @example
  10682. *
  10683. * var object = {
  10684. * 'user': 'fred',
  10685. * 'greet': function(greeting, punctuation) {
  10686. * return greeting + ' ' + this.user + punctuation;
  10687. * }
  10688. * };
  10689. *
  10690. * var bound = _.bindKey(object, 'greet', 'hi');
  10691. * bound('!');
  10692. * // => 'hi fred!'
  10693. *
  10694. * object.greet = function(greeting, punctuation) {
  10695. * return greeting + 'ya ' + this.user + punctuation;
  10696. * };
  10697. *
  10698. * bound('!');
  10699. * // => 'hiya fred!'
  10700. *
  10701. * // Bound with placeholders.
  10702. * var bound = _.bindKey(object, 'greet', _, '!');
  10703. * bound('hi');
  10704. * // => 'hiya fred!'
  10705. */
  10706. var bindKey = baseRest(function(object, key, partials) {
  10707. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10708. if (partials.length) {
  10709. var holders = replaceHolders(partials, getHolder(bindKey));
  10710. bitmask |= WRAP_PARTIAL_FLAG;
  10711. }
  10712. return createWrap(key, bitmask, object, partials, holders);
  10713. });
  10714. /**
  10715. * Creates a function that accepts arguments of `func` and either invokes
  10716. * `func` returning its result, if at least `arity` number of arguments have
  10717. * been provided, or returns a function that accepts the remaining `func`
  10718. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10719. * is not sufficient.
  10720. *
  10721. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10722. * may be used as a placeholder for provided arguments.
  10723. *
  10724. * **Note:** This method doesn't set the "length" property of curried functions.
  10725. *
  10726. * @static
  10727. * @memberOf _
  10728. * @since 2.0.0
  10729. * @category Function
  10730. * @param {Function} func The function to curry.
  10731. * @param {number} [arity=func.length] The arity of `func`.
  10732. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10733. * @returns {Function} Returns the new curried function.
  10734. * @example
  10735. *
  10736. * var abc = function(a, b, c) {
  10737. * return [a, b, c];
  10738. * };
  10739. *
  10740. * var curried = _.curry(abc);
  10741. *
  10742. * curried(1)(2)(3);
  10743. * // => [1, 2, 3]
  10744. *
  10745. * curried(1, 2)(3);
  10746. * // => [1, 2, 3]
  10747. *
  10748. * curried(1, 2, 3);
  10749. * // => [1, 2, 3]
  10750. *
  10751. * // Curried with placeholders.
  10752. * curried(1)(_, 3)(2);
  10753. * // => [1, 2, 3]
  10754. */
  10755. function curry(func, arity, guard) {
  10756. arity = guard ? undefined : arity;
  10757. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10758. result.placeholder = curry.placeholder;
  10759. return result;
  10760. }
  10761. /**
  10762. * This method is like `_.curry` except that arguments are applied to `func`
  10763. * in the manner of `_.partialRight` instead of `_.partial`.
  10764. *
  10765. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10766. * builds, may be used as a placeholder for provided arguments.
  10767. *
  10768. * **Note:** This method doesn't set the "length" property of curried functions.
  10769. *
  10770. * @static
  10771. * @memberOf _
  10772. * @since 3.0.0
  10773. * @category Function
  10774. * @param {Function} func The function to curry.
  10775. * @param {number} [arity=func.length] The arity of `func`.
  10776. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10777. * @returns {Function} Returns the new curried function.
  10778. * @example
  10779. *
  10780. * var abc = function(a, b, c) {
  10781. * return [a, b, c];
  10782. * };
  10783. *
  10784. * var curried = _.curryRight(abc);
  10785. *
  10786. * curried(3)(2)(1);
  10787. * // => [1, 2, 3]
  10788. *
  10789. * curried(2, 3)(1);
  10790. * // => [1, 2, 3]
  10791. *
  10792. * curried(1, 2, 3);
  10793. * // => [1, 2, 3]
  10794. *
  10795. * // Curried with placeholders.
  10796. * curried(3)(1, _)(2);
  10797. * // => [1, 2, 3]
  10798. */
  10799. function curryRight(func, arity, guard) {
  10800. arity = guard ? undefined : arity;
  10801. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10802. result.placeholder = curryRight.placeholder;
  10803. return result;
  10804. }
  10805. /**
  10806. * Creates a debounced function that delays invoking `func` until after `wait`
  10807. * milliseconds have elapsed since the last time the debounced function was
  10808. * invoked. The debounced function comes with a `cancel` method to cancel
  10809. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10810. * Provide `options` to indicate whether `func` should be invoked on the
  10811. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10812. * with the last arguments provided to the debounced function. Subsequent
  10813. * calls to the debounced function return the result of the last `func`
  10814. * invocation.
  10815. *
  10816. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10817. * invoked on the trailing edge of the timeout only if the debounced function
  10818. * is invoked more than once during the `wait` timeout.
  10819. *
  10820. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10821. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10822. *
  10823. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10824. * for details over the differences between `_.debounce` and `_.throttle`.
  10825. *
  10826. * @static
  10827. * @memberOf _
  10828. * @since 0.1.0
  10829. * @category Function
  10830. * @param {Function} func The function to debounce.
  10831. * @param {number} [wait=0] The number of milliseconds to delay.
  10832. * @param {Object} [options={}] The options object.
  10833. * @param {boolean} [options.leading=false]
  10834. * Specify invoking on the leading edge of the timeout.
  10835. * @param {number} [options.maxWait]
  10836. * The maximum time `func` is allowed to be delayed before it's invoked.
  10837. * @param {boolean} [options.trailing=true]
  10838. * Specify invoking on the trailing edge of the timeout.
  10839. * @returns {Function} Returns the new debounced function.
  10840. * @example
  10841. *
  10842. * // Avoid costly calculations while the window size is in flux.
  10843. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10844. *
  10845. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10846. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10847. * 'leading': true,
  10848. * 'trailing': false
  10849. * }));
  10850. *
  10851. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10852. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10853. * var source = new EventSource('/stream');
  10854. * jQuery(source).on('message', debounced);
  10855. *
  10856. * // Cancel the trailing debounced invocation.
  10857. * jQuery(window).on('popstate', debounced.cancel);
  10858. */
  10859. function debounce(func, wait, options) {
  10860. var lastArgs,
  10861. lastThis,
  10862. maxWait,
  10863. result,
  10864. timerId,
  10865. lastCallTime,
  10866. lastInvokeTime = 0,
  10867. leading = false,
  10868. maxing = false,
  10869. trailing = true;
  10870. if (typeof func != 'function') {
  10871. throw new TypeError(FUNC_ERROR_TEXT);
  10872. }
  10873. wait = toNumber(wait) || 0;
  10874. if (isObject(options)) {
  10875. leading = !!options.leading;
  10876. maxing = 'maxWait' in options;
  10877. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10878. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10879. }
  10880. function invokeFunc(time) {
  10881. var args = lastArgs,
  10882. thisArg = lastThis;
  10883. lastArgs = lastThis = undefined;
  10884. lastInvokeTime = time;
  10885. result = func.apply(thisArg, args);
  10886. return result;
  10887. }
  10888. function leadingEdge(time) {
  10889. // Reset any `maxWait` timer.
  10890. lastInvokeTime = time;
  10891. // Start the timer for the trailing edge.
  10892. timerId = setTimeout(timerExpired, wait);
  10893. // Invoke the leading edge.
  10894. return leading ? invokeFunc(time) : result;
  10895. }
  10896. function remainingWait(time) {
  10897. var timeSinceLastCall = time - lastCallTime,
  10898. timeSinceLastInvoke = time - lastInvokeTime,
  10899. timeWaiting = wait - timeSinceLastCall;
  10900. return maxing
  10901. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10902. : timeWaiting;
  10903. }
  10904. function shouldInvoke(time) {
  10905. var timeSinceLastCall = time - lastCallTime,
  10906. timeSinceLastInvoke = time - lastInvokeTime;
  10907. // Either this is the first call, activity has stopped and we're at the
  10908. // trailing edge, the system time has gone backwards and we're treating
  10909. // it as the trailing edge, or we've hit the `maxWait` limit.
  10910. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10911. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10912. }
  10913. function timerExpired() {
  10914. var time = now();
  10915. if (shouldInvoke(time)) {
  10916. return trailingEdge(time);
  10917. }
  10918. // Restart the timer.
  10919. timerId = setTimeout(timerExpired, remainingWait(time));
  10920. }
  10921. function trailingEdge(time) {
  10922. timerId = undefined;
  10923. // Only invoke if we have `lastArgs` which means `func` has been
  10924. // debounced at least once.
  10925. if (trailing && lastArgs) {
  10926. return invokeFunc(time);
  10927. }
  10928. lastArgs = lastThis = undefined;
  10929. return result;
  10930. }
  10931. function cancel() {
  10932. if (timerId !== undefined) {
  10933. clearTimeout(timerId);
  10934. }
  10935. lastInvokeTime = 0;
  10936. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10937. }
  10938. function flush() {
  10939. return timerId === undefined ? result : trailingEdge(now());
  10940. }
  10941. function debounced() {
  10942. var time = now(),
  10943. isInvoking = shouldInvoke(time);
  10944. lastArgs = arguments;
  10945. lastThis = this;
  10946. lastCallTime = time;
  10947. if (isInvoking) {
  10948. if (timerId === undefined) {
  10949. return leadingEdge(lastCallTime);
  10950. }
  10951. if (maxing) {
  10952. // Handle invocations in a tight loop.
  10953. clearTimeout(timerId);
  10954. timerId = setTimeout(timerExpired, wait);
  10955. return invokeFunc(lastCallTime);
  10956. }
  10957. }
  10958. if (timerId === undefined) {
  10959. timerId = setTimeout(timerExpired, wait);
  10960. }
  10961. return result;
  10962. }
  10963. debounced.cancel = cancel;
  10964. debounced.flush = flush;
  10965. return debounced;
  10966. }
  10967. /**
  10968. * Defers invoking the `func` until the current call stack has cleared. Any
  10969. * additional arguments are provided to `func` when it's invoked.
  10970. *
  10971. * @static
  10972. * @memberOf _
  10973. * @since 0.1.0
  10974. * @category Function
  10975. * @param {Function} func The function to defer.
  10976. * @param {...*} [args] The arguments to invoke `func` with.
  10977. * @returns {number} Returns the timer id.
  10978. * @example
  10979. *
  10980. * _.defer(function(text) {
  10981. * console.log(text);
  10982. * }, 'deferred');
  10983. * // => Logs 'deferred' after one millisecond.
  10984. */
  10985. var defer = baseRest(function(func, args) {
  10986. return baseDelay(func, 1, args);
  10987. });
  10988. /**
  10989. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10990. * provided to `func` when it's invoked.
  10991. *
  10992. * @static
  10993. * @memberOf _
  10994. * @since 0.1.0
  10995. * @category Function
  10996. * @param {Function} func The function to delay.
  10997. * @param {number} wait The number of milliseconds to delay invocation.
  10998. * @param {...*} [args] The arguments to invoke `func` with.
  10999. * @returns {number} Returns the timer id.
  11000. * @example
  11001. *
  11002. * _.delay(function(text) {
  11003. * console.log(text);
  11004. * }, 1000, 'later');
  11005. * // => Logs 'later' after one second.
  11006. */
  11007. var delay = baseRest(function(func, wait, args) {
  11008. return baseDelay(func, toNumber(wait) || 0, args);
  11009. });
  11010. /**
  11011. * Creates a function that invokes `func` with arguments reversed.
  11012. *
  11013. * @static
  11014. * @memberOf _
  11015. * @since 4.0.0
  11016. * @category Function
  11017. * @param {Function} func The function to flip arguments for.
  11018. * @returns {Function} Returns the new flipped function.
  11019. * @example
  11020. *
  11021. * var flipped = _.flip(function() {
  11022. * return _.toArray(arguments);
  11023. * });
  11024. *
  11025. * flipped('a', 'b', 'c', 'd');
  11026. * // => ['d', 'c', 'b', 'a']
  11027. */
  11028. function flip(func) {
  11029. return createWrap(func, WRAP_FLIP_FLAG);
  11030. }
  11031. /**
  11032. * Creates a function that memoizes the result of `func`. If `resolver` is
  11033. * provided, it determines the cache key for storing the result based on the
  11034. * arguments provided to the memoized function. By default, the first argument
  11035. * provided to the memoized function is used as the map cache key. The `func`
  11036. * is invoked with the `this` binding of the memoized function.
  11037. *
  11038. * **Note:** The cache is exposed as the `cache` property on the memoized
  11039. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11040. * constructor with one whose instances implement the
  11041. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11042. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11043. *
  11044. * @static
  11045. * @memberOf _
  11046. * @since 0.1.0
  11047. * @category Function
  11048. * @param {Function} func The function to have its output memoized.
  11049. * @param {Function} [resolver] The function to resolve the cache key.
  11050. * @returns {Function} Returns the new memoized function.
  11051. * @example
  11052. *
  11053. * var object = { 'a': 1, 'b': 2 };
  11054. * var other = { 'c': 3, 'd': 4 };
  11055. *
  11056. * var values = _.memoize(_.values);
  11057. * values(object);
  11058. * // => [1, 2]
  11059. *
  11060. * values(other);
  11061. * // => [3, 4]
  11062. *
  11063. * object.a = 2;
  11064. * values(object);
  11065. * // => [1, 2]
  11066. *
  11067. * // Modify the result cache.
  11068. * values.cache.set(object, ['a', 'b']);
  11069. * values(object);
  11070. * // => ['a', 'b']
  11071. *
  11072. * // Replace `_.memoize.Cache`.
  11073. * _.memoize.Cache = WeakMap;
  11074. */
  11075. function memoize(func, resolver) {
  11076. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11077. throw new TypeError(FUNC_ERROR_TEXT);
  11078. }
  11079. var memoized = function() {
  11080. var args = arguments,
  11081. key = resolver ? resolver.apply(this, args) : args[0],
  11082. cache = memoized.cache;
  11083. if (cache.has(key)) {
  11084. return cache.get(key);
  11085. }
  11086. var result = func.apply(this, args);
  11087. memoized.cache = cache.set(key, result) || cache;
  11088. return result;
  11089. };
  11090. memoized.cache = new (memoize.Cache || MapCache);
  11091. return memoized;
  11092. }
  11093. // Expose `MapCache`.
  11094. memoize.Cache = MapCache;
  11095. /**
  11096. * Creates a function that negates the result of the predicate `func`. The
  11097. * `func` predicate is invoked with the `this` binding and arguments of the
  11098. * created function.
  11099. *
  11100. * @static
  11101. * @memberOf _
  11102. * @since 3.0.0
  11103. * @category Function
  11104. * @param {Function} predicate The predicate to negate.
  11105. * @returns {Function} Returns the new negated function.
  11106. * @example
  11107. *
  11108. * function isEven(n) {
  11109. * return n % 2 == 0;
  11110. * }
  11111. *
  11112. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11113. * // => [1, 3, 5]
  11114. */
  11115. function negate(predicate) {
  11116. if (typeof predicate != 'function') {
  11117. throw new TypeError(FUNC_ERROR_TEXT);
  11118. }
  11119. return function() {
  11120. var args = arguments;
  11121. switch (args.length) {
  11122. case 0: return !predicate.call(this);
  11123. case 1: return !predicate.call(this, args[0]);
  11124. case 2: return !predicate.call(this, args[0], args[1]);
  11125. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11126. }
  11127. return !predicate.apply(this, args);
  11128. };
  11129. }
  11130. /**
  11131. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11132. * to the function return the value of the first invocation. The `func` is
  11133. * invoked with the `this` binding and arguments of the created function.
  11134. *
  11135. * @static
  11136. * @memberOf _
  11137. * @since 0.1.0
  11138. * @category Function
  11139. * @param {Function} func The function to restrict.
  11140. * @returns {Function} Returns the new restricted function.
  11141. * @example
  11142. *
  11143. * var initialize = _.once(createApplication);
  11144. * initialize();
  11145. * initialize();
  11146. * // => `createApplication` is invoked once
  11147. */
  11148. function once(func) {
  11149. return before(2, func);
  11150. }
  11151. /**
  11152. * Creates a function that invokes `func` with its arguments transformed.
  11153. *
  11154. * @static
  11155. * @since 4.0.0
  11156. * @memberOf _
  11157. * @category Function
  11158. * @param {Function} func The function to wrap.
  11159. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11160. * The argument transforms.
  11161. * @returns {Function} Returns the new function.
  11162. * @example
  11163. *
  11164. * function doubled(n) {
  11165. * return n * 2;
  11166. * }
  11167. *
  11168. * function square(n) {
  11169. * return n * n;
  11170. * }
  11171. *
  11172. * var func = _.overArgs(function(x, y) {
  11173. * return [x, y];
  11174. * }, [square, doubled]);
  11175. *
  11176. * func(9, 3);
  11177. * // => [81, 6]
  11178. *
  11179. * func(10, 5);
  11180. * // => [100, 10]
  11181. */
  11182. var overArgs = castRest(function(func, transforms) {
  11183. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11184. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11185. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11186. var funcsLength = transforms.length;
  11187. return baseRest(function(args) {
  11188. var index = -1,
  11189. length = nativeMin(args.length, funcsLength);
  11190. while (++index < length) {
  11191. args[index] = transforms[index].call(this, args[index]);
  11192. }
  11193. return apply(func, this, args);
  11194. });
  11195. });
  11196. /**
  11197. * Creates a function that invokes `func` with `partials` prepended to the
  11198. * arguments it receives. This method is like `_.bind` except it does **not**
  11199. * alter the `this` binding.
  11200. *
  11201. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11202. * builds, may be used as a placeholder for partially applied arguments.
  11203. *
  11204. * **Note:** This method doesn't set the "length" property of partially
  11205. * applied functions.
  11206. *
  11207. * @static
  11208. * @memberOf _
  11209. * @since 0.2.0
  11210. * @category Function
  11211. * @param {Function} func The function to partially apply arguments to.
  11212. * @param {...*} [partials] The arguments to be partially applied.
  11213. * @returns {Function} Returns the new partially applied function.
  11214. * @example
  11215. *
  11216. * function greet(greeting, name) {
  11217. * return greeting + ' ' + name;
  11218. * }
  11219. *
  11220. * var sayHelloTo = _.partial(greet, 'hello');
  11221. * sayHelloTo('fred');
  11222. * // => 'hello fred'
  11223. *
  11224. * // Partially applied with placeholders.
  11225. * var greetFred = _.partial(greet, _, 'fred');
  11226. * greetFred('hi');
  11227. * // => 'hi fred'
  11228. */
  11229. var partial = baseRest(function(func, partials) {
  11230. var holders = replaceHolders(partials, getHolder(partial));
  11231. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11232. });
  11233. /**
  11234. * This method is like `_.partial` except that partially applied arguments
  11235. * are appended to the arguments it receives.
  11236. *
  11237. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11238. * builds, may be used as a placeholder for partially applied arguments.
  11239. *
  11240. * **Note:** This method doesn't set the "length" property of partially
  11241. * applied functions.
  11242. *
  11243. * @static
  11244. * @memberOf _
  11245. * @since 1.0.0
  11246. * @category Function
  11247. * @param {Function} func The function to partially apply arguments to.
  11248. * @param {...*} [partials] The arguments to be partially applied.
  11249. * @returns {Function} Returns the new partially applied function.
  11250. * @example
  11251. *
  11252. * function greet(greeting, name) {
  11253. * return greeting + ' ' + name;
  11254. * }
  11255. *
  11256. * var greetFred = _.partialRight(greet, 'fred');
  11257. * greetFred('hi');
  11258. * // => 'hi fred'
  11259. *
  11260. * // Partially applied with placeholders.
  11261. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11262. * sayHelloTo('fred');
  11263. * // => 'hello fred'
  11264. */
  11265. var partialRight = baseRest(function(func, partials) {
  11266. var holders = replaceHolders(partials, getHolder(partialRight));
  11267. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11268. });
  11269. /**
  11270. * Creates a function that invokes `func` with arguments arranged according
  11271. * to the specified `indexes` where the argument value at the first index is
  11272. * provided as the first argument, the argument value at the second index is
  11273. * provided as the second argument, and so on.
  11274. *
  11275. * @static
  11276. * @memberOf _
  11277. * @since 3.0.0
  11278. * @category Function
  11279. * @param {Function} func The function to rearrange arguments for.
  11280. * @param {...(number|number[])} indexes The arranged argument indexes.
  11281. * @returns {Function} Returns the new function.
  11282. * @example
  11283. *
  11284. * var rearged = _.rearg(function(a, b, c) {
  11285. * return [a, b, c];
  11286. * }, [2, 0, 1]);
  11287. *
  11288. * rearged('b', 'c', 'a')
  11289. * // => ['a', 'b', 'c']
  11290. */
  11291. var rearg = flatRest(function(func, indexes) {
  11292. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11293. });
  11294. /**
  11295. * Creates a function that invokes `func` with the `this` binding of the
  11296. * created function and arguments from `start` and beyond provided as
  11297. * an array.
  11298. *
  11299. * **Note:** This method is based on the
  11300. * [rest parameter](https://mdn.io/rest_parameters).
  11301. *
  11302. * @static
  11303. * @memberOf _
  11304. * @since 4.0.0
  11305. * @category Function
  11306. * @param {Function} func The function to apply a rest parameter to.
  11307. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11308. * @returns {Function} Returns the new function.
  11309. * @example
  11310. *
  11311. * var say = _.rest(function(what, names) {
  11312. * return what + ' ' + _.initial(names).join(', ') +
  11313. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11314. * });
  11315. *
  11316. * say('hello', 'fred', 'barney', 'pebbles');
  11317. * // => 'hello fred, barney, & pebbles'
  11318. */
  11319. function rest(func, start) {
  11320. if (typeof func != 'function') {
  11321. throw new TypeError(FUNC_ERROR_TEXT);
  11322. }
  11323. start = start === undefined ? start : toInteger(start);
  11324. return baseRest(func, start);
  11325. }
  11326. /**
  11327. * Creates a function that invokes `func` with the `this` binding of the
  11328. * create function and an array of arguments much like
  11329. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11330. *
  11331. * **Note:** This method is based on the
  11332. * [spread operator](https://mdn.io/spread_operator).
  11333. *
  11334. * @static
  11335. * @memberOf _
  11336. * @since 3.2.0
  11337. * @category Function
  11338. * @param {Function} func The function to spread arguments over.
  11339. * @param {number} [start=0] The start position of the spread.
  11340. * @returns {Function} Returns the new function.
  11341. * @example
  11342. *
  11343. * var say = _.spread(function(who, what) {
  11344. * return who + ' says ' + what;
  11345. * });
  11346. *
  11347. * say(['fred', 'hello']);
  11348. * // => 'fred says hello'
  11349. *
  11350. * var numbers = Promise.all([
  11351. * Promise.resolve(40),
  11352. * Promise.resolve(36)
  11353. * ]);
  11354. *
  11355. * numbers.then(_.spread(function(x, y) {
  11356. * return x + y;
  11357. * }));
  11358. * // => a Promise of 76
  11359. */
  11360. function spread(func, start) {
  11361. if (typeof func != 'function') {
  11362. throw new TypeError(FUNC_ERROR_TEXT);
  11363. }
  11364. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11365. return baseRest(function(args) {
  11366. var array = args[start],
  11367. otherArgs = castSlice(args, 0, start);
  11368. if (array) {
  11369. arrayPush(otherArgs, array);
  11370. }
  11371. return apply(func, this, otherArgs);
  11372. });
  11373. }
  11374. /**
  11375. * Creates a throttled function that only invokes `func` at most once per
  11376. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11377. * method to cancel delayed `func` invocations and a `flush` method to
  11378. * immediately invoke them. Provide `options` to indicate whether `func`
  11379. * should be invoked on the leading and/or trailing edge of the `wait`
  11380. * timeout. The `func` is invoked with the last arguments provided to the
  11381. * throttled function. Subsequent calls to the throttled function return the
  11382. * result of the last `func` invocation.
  11383. *
  11384. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11385. * invoked on the trailing edge of the timeout only if the throttled function
  11386. * is invoked more than once during the `wait` timeout.
  11387. *
  11388. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11389. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11390. *
  11391. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11392. * for details over the differences between `_.throttle` and `_.debounce`.
  11393. *
  11394. * @static
  11395. * @memberOf _
  11396. * @since 0.1.0
  11397. * @category Function
  11398. * @param {Function} func The function to throttle.
  11399. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11400. * @param {Object} [options={}] The options object.
  11401. * @param {boolean} [options.leading=true]
  11402. * Specify invoking on the leading edge of the timeout.
  11403. * @param {boolean} [options.trailing=true]
  11404. * Specify invoking on the trailing edge of the timeout.
  11405. * @returns {Function} Returns the new throttled function.
  11406. * @example
  11407. *
  11408. * // Avoid excessively updating the position while scrolling.
  11409. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11410. *
  11411. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11412. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11413. * jQuery(element).on('click', throttled);
  11414. *
  11415. * // Cancel the trailing throttled invocation.
  11416. * jQuery(window).on('popstate', throttled.cancel);
  11417. */
  11418. function throttle(func, wait, options) {
  11419. var leading = true,
  11420. trailing = true;
  11421. if (typeof func != 'function') {
  11422. throw new TypeError(FUNC_ERROR_TEXT);
  11423. }
  11424. if (isObject(options)) {
  11425. leading = 'leading' in options ? !!options.leading : leading;
  11426. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11427. }
  11428. return debounce(func, wait, {
  11429. 'leading': leading,
  11430. 'maxWait': wait,
  11431. 'trailing': trailing
  11432. });
  11433. }
  11434. /**
  11435. * Creates a function that accepts up to one argument, ignoring any
  11436. * additional arguments.
  11437. *
  11438. * @static
  11439. * @memberOf _
  11440. * @since 4.0.0
  11441. * @category Function
  11442. * @param {Function} func The function to cap arguments for.
  11443. * @returns {Function} Returns the new capped function.
  11444. * @example
  11445. *
  11446. * _.map(['6', '8', '10'], _.unary(parseInt));
  11447. * // => [6, 8, 10]
  11448. */
  11449. function unary(func) {
  11450. return ary(func, 1);
  11451. }
  11452. /**
  11453. * Creates a function that provides `value` to `wrapper` as its first
  11454. * argument. Any additional arguments provided to the function are appended
  11455. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11456. * binding of the created function.
  11457. *
  11458. * @static
  11459. * @memberOf _
  11460. * @since 0.1.0
  11461. * @category Function
  11462. * @param {*} value The value to wrap.
  11463. * @param {Function} [wrapper=identity] The wrapper function.
  11464. * @returns {Function} Returns the new function.
  11465. * @example
  11466. *
  11467. * var p = _.wrap(_.escape, function(func, text) {
  11468. * return '<p>' + func(text) + '</p>';
  11469. * });
  11470. *
  11471. * p('fred, barney, & pebbles');
  11472. * // => '<p>fred, barney, &amp; pebbles</p>'
  11473. */
  11474. function wrap(value, wrapper) {
  11475. return partial(castFunction(wrapper), value);
  11476. }
  11477. /*------------------------------------------------------------------------*/
  11478. /**
  11479. * Casts `value` as an array if it's not one.
  11480. *
  11481. * @static
  11482. * @memberOf _
  11483. * @since 4.4.0
  11484. * @category Lang
  11485. * @param {*} value The value to inspect.
  11486. * @returns {Array} Returns the cast array.
  11487. * @example
  11488. *
  11489. * _.castArray(1);
  11490. * // => [1]
  11491. *
  11492. * _.castArray({ 'a': 1 });
  11493. * // => [{ 'a': 1 }]
  11494. *
  11495. * _.castArray('abc');
  11496. * // => ['abc']
  11497. *
  11498. * _.castArray(null);
  11499. * // => [null]
  11500. *
  11501. * _.castArray(undefined);
  11502. * // => [undefined]
  11503. *
  11504. * _.castArray();
  11505. * // => []
  11506. *
  11507. * var array = [1, 2, 3];
  11508. * console.log(_.castArray(array) === array);
  11509. * // => true
  11510. */
  11511. function castArray() {
  11512. if (!arguments.length) {
  11513. return [];
  11514. }
  11515. var value = arguments[0];
  11516. return isArray(value) ? value : [value];
  11517. }
  11518. /**
  11519. * Creates a shallow clone of `value`.
  11520. *
  11521. * **Note:** This method is loosely based on the
  11522. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11523. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11524. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11525. * arrays. The own enumerable properties of `arguments` objects are cloned
  11526. * as plain objects. An empty object is returned for uncloneable values such
  11527. * as error objects, functions, DOM nodes, and WeakMaps.
  11528. *
  11529. * @static
  11530. * @memberOf _
  11531. * @since 0.1.0
  11532. * @category Lang
  11533. * @param {*} value The value to clone.
  11534. * @returns {*} Returns the cloned value.
  11535. * @see _.cloneDeep
  11536. * @example
  11537. *
  11538. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11539. *
  11540. * var shallow = _.clone(objects);
  11541. * console.log(shallow[0] === objects[0]);
  11542. * // => true
  11543. */
  11544. function clone(value) {
  11545. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11546. }
  11547. /**
  11548. * This method is like `_.clone` except that it accepts `customizer` which
  11549. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11550. * cloning is handled by the method instead. The `customizer` is invoked with
  11551. * up to four arguments; (value [, index|key, object, stack]).
  11552. *
  11553. * @static
  11554. * @memberOf _
  11555. * @since 4.0.0
  11556. * @category Lang
  11557. * @param {*} value The value to clone.
  11558. * @param {Function} [customizer] The function to customize cloning.
  11559. * @returns {*} Returns the cloned value.
  11560. * @see _.cloneDeepWith
  11561. * @example
  11562. *
  11563. * function customizer(value) {
  11564. * if (_.isElement(value)) {
  11565. * return value.cloneNode(false);
  11566. * }
  11567. * }
  11568. *
  11569. * var el = _.cloneWith(document.body, customizer);
  11570. *
  11571. * console.log(el === document.body);
  11572. * // => false
  11573. * console.log(el.nodeName);
  11574. * // => 'BODY'
  11575. * console.log(el.childNodes.length);
  11576. * // => 0
  11577. */
  11578. function cloneWith(value, customizer) {
  11579. customizer = typeof customizer == 'function' ? customizer : undefined;
  11580. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11581. }
  11582. /**
  11583. * This method is like `_.clone` except that it recursively clones `value`.
  11584. *
  11585. * @static
  11586. * @memberOf _
  11587. * @since 1.0.0
  11588. * @category Lang
  11589. * @param {*} value The value to recursively clone.
  11590. * @returns {*} Returns the deep cloned value.
  11591. * @see _.clone
  11592. * @example
  11593. *
  11594. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11595. *
  11596. * var deep = _.cloneDeep(objects);
  11597. * console.log(deep[0] === objects[0]);
  11598. * // => false
  11599. */
  11600. function cloneDeep(value) {
  11601. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11602. }
  11603. /**
  11604. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11605. *
  11606. * @static
  11607. * @memberOf _
  11608. * @since 4.0.0
  11609. * @category Lang
  11610. * @param {*} value The value to recursively clone.
  11611. * @param {Function} [customizer] The function to customize cloning.
  11612. * @returns {*} Returns the deep cloned value.
  11613. * @see _.cloneWith
  11614. * @example
  11615. *
  11616. * function customizer(value) {
  11617. * if (_.isElement(value)) {
  11618. * return value.cloneNode(true);
  11619. * }
  11620. * }
  11621. *
  11622. * var el = _.cloneDeepWith(document.body, customizer);
  11623. *
  11624. * console.log(el === document.body);
  11625. * // => false
  11626. * console.log(el.nodeName);
  11627. * // => 'BODY'
  11628. * console.log(el.childNodes.length);
  11629. * // => 20
  11630. */
  11631. function cloneDeepWith(value, customizer) {
  11632. customizer = typeof customizer == 'function' ? customizer : undefined;
  11633. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11634. }
  11635. /**
  11636. * Checks if `object` conforms to `source` by invoking the predicate
  11637. * properties of `source` with the corresponding property values of `object`.
  11638. *
  11639. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11640. * partially applied.
  11641. *
  11642. * @static
  11643. * @memberOf _
  11644. * @since 4.14.0
  11645. * @category Lang
  11646. * @param {Object} object The object to inspect.
  11647. * @param {Object} source The object of property predicates to conform to.
  11648. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11649. * @example
  11650. *
  11651. * var object = { 'a': 1, 'b': 2 };
  11652. *
  11653. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11654. * // => true
  11655. *
  11656. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11657. * // => false
  11658. */
  11659. function conformsTo(object, source) {
  11660. return source == null || baseConformsTo(object, source, keys(source));
  11661. }
  11662. /**
  11663. * Performs a
  11664. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11665. * comparison between two values to determine if they are equivalent.
  11666. *
  11667. * @static
  11668. * @memberOf _
  11669. * @since 4.0.0
  11670. * @category Lang
  11671. * @param {*} value The value to compare.
  11672. * @param {*} other The other value to compare.
  11673. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11674. * @example
  11675. *
  11676. * var object = { 'a': 1 };
  11677. * var other = { 'a': 1 };
  11678. *
  11679. * _.eq(object, object);
  11680. * // => true
  11681. *
  11682. * _.eq(object, other);
  11683. * // => false
  11684. *
  11685. * _.eq('a', 'a');
  11686. * // => true
  11687. *
  11688. * _.eq('a', Object('a'));
  11689. * // => false
  11690. *
  11691. * _.eq(NaN, NaN);
  11692. * // => true
  11693. */
  11694. function eq(value, other) {
  11695. return value === other || (value !== value && other !== other);
  11696. }
  11697. /**
  11698. * Checks if `value` is greater than `other`.
  11699. *
  11700. * @static
  11701. * @memberOf _
  11702. * @since 3.9.0
  11703. * @category Lang
  11704. * @param {*} value The value to compare.
  11705. * @param {*} other The other value to compare.
  11706. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11707. * else `false`.
  11708. * @see _.lt
  11709. * @example
  11710. *
  11711. * _.gt(3, 1);
  11712. * // => true
  11713. *
  11714. * _.gt(3, 3);
  11715. * // => false
  11716. *
  11717. * _.gt(1, 3);
  11718. * // => false
  11719. */
  11720. var gt = createRelationalOperation(baseGt);
  11721. /**
  11722. * Checks if `value` is greater than or equal to `other`.
  11723. *
  11724. * @static
  11725. * @memberOf _
  11726. * @since 3.9.0
  11727. * @category Lang
  11728. * @param {*} value The value to compare.
  11729. * @param {*} other The other value to compare.
  11730. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11731. * `other`, else `false`.
  11732. * @see _.lte
  11733. * @example
  11734. *
  11735. * _.gte(3, 1);
  11736. * // => true
  11737. *
  11738. * _.gte(3, 3);
  11739. * // => true
  11740. *
  11741. * _.gte(1, 3);
  11742. * // => false
  11743. */
  11744. var gte = createRelationalOperation(function(value, other) {
  11745. return value >= other;
  11746. });
  11747. /**
  11748. * Checks if `value` is likely an `arguments` object.
  11749. *
  11750. * @static
  11751. * @memberOf _
  11752. * @since 0.1.0
  11753. * @category Lang
  11754. * @param {*} value The value to check.
  11755. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11756. * else `false`.
  11757. * @example
  11758. *
  11759. * _.isArguments(function() { return arguments; }());
  11760. * // => true
  11761. *
  11762. * _.isArguments([1, 2, 3]);
  11763. * // => false
  11764. */
  11765. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11766. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11767. !propertyIsEnumerable.call(value, 'callee');
  11768. };
  11769. /**
  11770. * Checks if `value` is classified as an `Array` object.
  11771. *
  11772. * @static
  11773. * @memberOf _
  11774. * @since 0.1.0
  11775. * @category Lang
  11776. * @param {*} value The value to check.
  11777. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11778. * @example
  11779. *
  11780. * _.isArray([1, 2, 3]);
  11781. * // => true
  11782. *
  11783. * _.isArray(document.body.children);
  11784. * // => false
  11785. *
  11786. * _.isArray('abc');
  11787. * // => false
  11788. *
  11789. * _.isArray(_.noop);
  11790. * // => false
  11791. */
  11792. var isArray = Array.isArray;
  11793. /**
  11794. * Checks if `value` is classified as an `ArrayBuffer` object.
  11795. *
  11796. * @static
  11797. * @memberOf _
  11798. * @since 4.3.0
  11799. * @category Lang
  11800. * @param {*} value The value to check.
  11801. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11802. * @example
  11803. *
  11804. * _.isArrayBuffer(new ArrayBuffer(2));
  11805. * // => true
  11806. *
  11807. * _.isArrayBuffer(new Array(2));
  11808. * // => false
  11809. */
  11810. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11811. /**
  11812. * Checks if `value` is array-like. A value is considered array-like if it's
  11813. * not a function and has a `value.length` that's an integer greater than or
  11814. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11815. *
  11816. * @static
  11817. * @memberOf _
  11818. * @since 4.0.0
  11819. * @category Lang
  11820. * @param {*} value The value to check.
  11821. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11822. * @example
  11823. *
  11824. * _.isArrayLike([1, 2, 3]);
  11825. * // => true
  11826. *
  11827. * _.isArrayLike(document.body.children);
  11828. * // => true
  11829. *
  11830. * _.isArrayLike('abc');
  11831. * // => true
  11832. *
  11833. * _.isArrayLike(_.noop);
  11834. * // => false
  11835. */
  11836. function isArrayLike(value) {
  11837. return value != null && isLength(value.length) && !isFunction(value);
  11838. }
  11839. /**
  11840. * This method is like `_.isArrayLike` except that it also checks if `value`
  11841. * is an object.
  11842. *
  11843. * @static
  11844. * @memberOf _
  11845. * @since 4.0.0
  11846. * @category Lang
  11847. * @param {*} value The value to check.
  11848. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11849. * else `false`.
  11850. * @example
  11851. *
  11852. * _.isArrayLikeObject([1, 2, 3]);
  11853. * // => true
  11854. *
  11855. * _.isArrayLikeObject(document.body.children);
  11856. * // => true
  11857. *
  11858. * _.isArrayLikeObject('abc');
  11859. * // => false
  11860. *
  11861. * _.isArrayLikeObject(_.noop);
  11862. * // => false
  11863. */
  11864. function isArrayLikeObject(value) {
  11865. return isObjectLike(value) && isArrayLike(value);
  11866. }
  11867. /**
  11868. * Checks if `value` is classified as a boolean primitive or object.
  11869. *
  11870. * @static
  11871. * @memberOf _
  11872. * @since 0.1.0
  11873. * @category Lang
  11874. * @param {*} value The value to check.
  11875. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11876. * @example
  11877. *
  11878. * _.isBoolean(false);
  11879. * // => true
  11880. *
  11881. * _.isBoolean(null);
  11882. * // => false
  11883. */
  11884. function isBoolean(value) {
  11885. return value === true || value === false ||
  11886. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11887. }
  11888. /**
  11889. * Checks if `value` is a buffer.
  11890. *
  11891. * @static
  11892. * @memberOf _
  11893. * @since 4.3.0
  11894. * @category Lang
  11895. * @param {*} value The value to check.
  11896. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11897. * @example
  11898. *
  11899. * _.isBuffer(new Buffer(2));
  11900. * // => true
  11901. *
  11902. * _.isBuffer(new Uint8Array(2));
  11903. * // => false
  11904. */
  11905. var isBuffer = nativeIsBuffer || stubFalse;
  11906. /**
  11907. * Checks if `value` is classified as a `Date` object.
  11908. *
  11909. * @static
  11910. * @memberOf _
  11911. * @since 0.1.0
  11912. * @category Lang
  11913. * @param {*} value The value to check.
  11914. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11915. * @example
  11916. *
  11917. * _.isDate(new Date);
  11918. * // => true
  11919. *
  11920. * _.isDate('Mon April 23 2012');
  11921. * // => false
  11922. */
  11923. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11924. /**
  11925. * Checks if `value` is likely a DOM element.
  11926. *
  11927. * @static
  11928. * @memberOf _
  11929. * @since 0.1.0
  11930. * @category Lang
  11931. * @param {*} value The value to check.
  11932. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11933. * @example
  11934. *
  11935. * _.isElement(document.body);
  11936. * // => true
  11937. *
  11938. * _.isElement('<body>');
  11939. * // => false
  11940. */
  11941. function isElement(value) {
  11942. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11943. }
  11944. /**
  11945. * Checks if `value` is an empty object, collection, map, or set.
  11946. *
  11947. * Objects are considered empty if they have no own enumerable string keyed
  11948. * properties.
  11949. *
  11950. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11951. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11952. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11953. *
  11954. * @static
  11955. * @memberOf _
  11956. * @since 0.1.0
  11957. * @category Lang
  11958. * @param {*} value The value to check.
  11959. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11960. * @example
  11961. *
  11962. * _.isEmpty(null);
  11963. * // => true
  11964. *
  11965. * _.isEmpty(true);
  11966. * // => true
  11967. *
  11968. * _.isEmpty(1);
  11969. * // => true
  11970. *
  11971. * _.isEmpty([1, 2, 3]);
  11972. * // => false
  11973. *
  11974. * _.isEmpty({ 'a': 1 });
  11975. * // => false
  11976. */
  11977. function isEmpty(value) {
  11978. if (value == null) {
  11979. return true;
  11980. }
  11981. if (isArrayLike(value) &&
  11982. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11983. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11984. return !value.length;
  11985. }
  11986. var tag = getTag(value);
  11987. if (tag == mapTag || tag == setTag) {
  11988. return !value.size;
  11989. }
  11990. if (isPrototype(value)) {
  11991. return !baseKeys(value).length;
  11992. }
  11993. for (var key in value) {
  11994. if (hasOwnProperty.call(value, key)) {
  11995. return false;
  11996. }
  11997. }
  11998. return true;
  11999. }
  12000. /**
  12001. * Performs a deep comparison between two values to determine if they are
  12002. * equivalent.
  12003. *
  12004. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12005. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12006. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12007. * by their own, not inherited, enumerable properties. Functions and DOM
  12008. * nodes are compared by strict equality, i.e. `===`.
  12009. *
  12010. * @static
  12011. * @memberOf _
  12012. * @since 0.1.0
  12013. * @category Lang
  12014. * @param {*} value The value to compare.
  12015. * @param {*} other The other value to compare.
  12016. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12017. * @example
  12018. *
  12019. * var object = { 'a': 1 };
  12020. * var other = { 'a': 1 };
  12021. *
  12022. * _.isEqual(object, other);
  12023. * // => true
  12024. *
  12025. * object === other;
  12026. * // => false
  12027. */
  12028. function isEqual(value, other) {
  12029. return baseIsEqual(value, other);
  12030. }
  12031. /**
  12032. * This method is like `_.isEqual` except that it accepts `customizer` which
  12033. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12034. * are handled by the method instead. The `customizer` is invoked with up to
  12035. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12036. *
  12037. * @static
  12038. * @memberOf _
  12039. * @since 4.0.0
  12040. * @category Lang
  12041. * @param {*} value The value to compare.
  12042. * @param {*} other The other value to compare.
  12043. * @param {Function} [customizer] The function to customize comparisons.
  12044. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12045. * @example
  12046. *
  12047. * function isGreeting(value) {
  12048. * return /^h(?:i|ello)$/.test(value);
  12049. * }
  12050. *
  12051. * function customizer(objValue, othValue) {
  12052. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12053. * return true;
  12054. * }
  12055. * }
  12056. *
  12057. * var array = ['hello', 'goodbye'];
  12058. * var other = ['hi', 'goodbye'];
  12059. *
  12060. * _.isEqualWith(array, other, customizer);
  12061. * // => true
  12062. */
  12063. function isEqualWith(value, other, customizer) {
  12064. customizer = typeof customizer == 'function' ? customizer : undefined;
  12065. var result = customizer ? customizer(value, other) : undefined;
  12066. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12067. }
  12068. /**
  12069. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12070. * `SyntaxError`, `TypeError`, or `URIError` object.
  12071. *
  12072. * @static
  12073. * @memberOf _
  12074. * @since 3.0.0
  12075. * @category Lang
  12076. * @param {*} value The value to check.
  12077. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12078. * @example
  12079. *
  12080. * _.isError(new Error);
  12081. * // => true
  12082. *
  12083. * _.isError(Error);
  12084. * // => false
  12085. */
  12086. function isError(value) {
  12087. if (!isObjectLike(value)) {
  12088. return false;
  12089. }
  12090. var tag = baseGetTag(value);
  12091. return tag == errorTag || tag == domExcTag ||
  12092. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12093. }
  12094. /**
  12095. * Checks if `value` is a finite primitive number.
  12096. *
  12097. * **Note:** This method is based on
  12098. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12099. *
  12100. * @static
  12101. * @memberOf _
  12102. * @since 0.1.0
  12103. * @category Lang
  12104. * @param {*} value The value to check.
  12105. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12106. * @example
  12107. *
  12108. * _.isFinite(3);
  12109. * // => true
  12110. *
  12111. * _.isFinite(Number.MIN_VALUE);
  12112. * // => true
  12113. *
  12114. * _.isFinite(Infinity);
  12115. * // => false
  12116. *
  12117. * _.isFinite('3');
  12118. * // => false
  12119. */
  12120. function isFinite(value) {
  12121. return typeof value == 'number' && nativeIsFinite(value);
  12122. }
  12123. /**
  12124. * Checks if `value` is classified as a `Function` object.
  12125. *
  12126. * @static
  12127. * @memberOf _
  12128. * @since 0.1.0
  12129. * @category Lang
  12130. * @param {*} value The value to check.
  12131. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12132. * @example
  12133. *
  12134. * _.isFunction(_);
  12135. * // => true
  12136. *
  12137. * _.isFunction(/abc/);
  12138. * // => false
  12139. */
  12140. function isFunction(value) {
  12141. if (!isObject(value)) {
  12142. return false;
  12143. }
  12144. // The use of `Object#toString` avoids issues with the `typeof` operator
  12145. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12146. var tag = baseGetTag(value);
  12147. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12148. }
  12149. /**
  12150. * Checks if `value` is an integer.
  12151. *
  12152. * **Note:** This method is based on
  12153. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12154. *
  12155. * @static
  12156. * @memberOf _
  12157. * @since 4.0.0
  12158. * @category Lang
  12159. * @param {*} value The value to check.
  12160. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12161. * @example
  12162. *
  12163. * _.isInteger(3);
  12164. * // => true
  12165. *
  12166. * _.isInteger(Number.MIN_VALUE);
  12167. * // => false
  12168. *
  12169. * _.isInteger(Infinity);
  12170. * // => false
  12171. *
  12172. * _.isInteger('3');
  12173. * // => false
  12174. */
  12175. function isInteger(value) {
  12176. return typeof value == 'number' && value == toInteger(value);
  12177. }
  12178. /**
  12179. * Checks if `value` is a valid array-like length.
  12180. *
  12181. * **Note:** This method is loosely based on
  12182. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12183. *
  12184. * @static
  12185. * @memberOf _
  12186. * @since 4.0.0
  12187. * @category Lang
  12188. * @param {*} value The value to check.
  12189. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12190. * @example
  12191. *
  12192. * _.isLength(3);
  12193. * // => true
  12194. *
  12195. * _.isLength(Number.MIN_VALUE);
  12196. * // => false
  12197. *
  12198. * _.isLength(Infinity);
  12199. * // => false
  12200. *
  12201. * _.isLength('3');
  12202. * // => false
  12203. */
  12204. function isLength(value) {
  12205. return typeof value == 'number' &&
  12206. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12207. }
  12208. /**
  12209. * Checks if `value` is the
  12210. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12211. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12212. *
  12213. * @static
  12214. * @memberOf _
  12215. * @since 0.1.0
  12216. * @category Lang
  12217. * @param {*} value The value to check.
  12218. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12219. * @example
  12220. *
  12221. * _.isObject({});
  12222. * // => true
  12223. *
  12224. * _.isObject([1, 2, 3]);
  12225. * // => true
  12226. *
  12227. * _.isObject(_.noop);
  12228. * // => true
  12229. *
  12230. * _.isObject(null);
  12231. * // => false
  12232. */
  12233. function isObject(value) {
  12234. var type = typeof value;
  12235. return value != null && (type == 'object' || type == 'function');
  12236. }
  12237. /**
  12238. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12239. * and has a `typeof` result of "object".
  12240. *
  12241. * @static
  12242. * @memberOf _
  12243. * @since 4.0.0
  12244. * @category Lang
  12245. * @param {*} value The value to check.
  12246. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12247. * @example
  12248. *
  12249. * _.isObjectLike({});
  12250. * // => true
  12251. *
  12252. * _.isObjectLike([1, 2, 3]);
  12253. * // => true
  12254. *
  12255. * _.isObjectLike(_.noop);
  12256. * // => false
  12257. *
  12258. * _.isObjectLike(null);
  12259. * // => false
  12260. */
  12261. function isObjectLike(value) {
  12262. return value != null && typeof value == 'object';
  12263. }
  12264. /**
  12265. * Checks if `value` is classified as a `Map` object.
  12266. *
  12267. * @static
  12268. * @memberOf _
  12269. * @since 4.3.0
  12270. * @category Lang
  12271. * @param {*} value The value to check.
  12272. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12273. * @example
  12274. *
  12275. * _.isMap(new Map);
  12276. * // => true
  12277. *
  12278. * _.isMap(new WeakMap);
  12279. * // => false
  12280. */
  12281. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12282. /**
  12283. * Performs a partial deep comparison between `object` and `source` to
  12284. * determine if `object` contains equivalent property values.
  12285. *
  12286. * **Note:** This method is equivalent to `_.matches` when `source` is
  12287. * partially applied.
  12288. *
  12289. * Partial comparisons will match empty array and empty object `source`
  12290. * values against any array or object value, respectively. See `_.isEqual`
  12291. * for a list of supported value comparisons.
  12292. *
  12293. * @static
  12294. * @memberOf _
  12295. * @since 3.0.0
  12296. * @category Lang
  12297. * @param {Object} object The object to inspect.
  12298. * @param {Object} source The object of property values to match.
  12299. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12300. * @example
  12301. *
  12302. * var object = { 'a': 1, 'b': 2 };
  12303. *
  12304. * _.isMatch(object, { 'b': 2 });
  12305. * // => true
  12306. *
  12307. * _.isMatch(object, { 'b': 1 });
  12308. * // => false
  12309. */
  12310. function isMatch(object, source) {
  12311. return object === source || baseIsMatch(object, source, getMatchData(source));
  12312. }
  12313. /**
  12314. * This method is like `_.isMatch` except that it accepts `customizer` which
  12315. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12316. * are handled by the method instead. The `customizer` is invoked with five
  12317. * arguments: (objValue, srcValue, index|key, object, source).
  12318. *
  12319. * @static
  12320. * @memberOf _
  12321. * @since 4.0.0
  12322. * @category Lang
  12323. * @param {Object} object The object to inspect.
  12324. * @param {Object} source The object of property values to match.
  12325. * @param {Function} [customizer] The function to customize comparisons.
  12326. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12327. * @example
  12328. *
  12329. * function isGreeting(value) {
  12330. * return /^h(?:i|ello)$/.test(value);
  12331. * }
  12332. *
  12333. * function customizer(objValue, srcValue) {
  12334. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12335. * return true;
  12336. * }
  12337. * }
  12338. *
  12339. * var object = { 'greeting': 'hello' };
  12340. * var source = { 'greeting': 'hi' };
  12341. *
  12342. * _.isMatchWith(object, source, customizer);
  12343. * // => true
  12344. */
  12345. function isMatchWith(object, source, customizer) {
  12346. customizer = typeof customizer == 'function' ? customizer : undefined;
  12347. return baseIsMatch(object, source, getMatchData(source), customizer);
  12348. }
  12349. /**
  12350. * Checks if `value` is `NaN`.
  12351. *
  12352. * **Note:** This method is based on
  12353. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12354. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12355. * `undefined` and other non-number values.
  12356. *
  12357. * @static
  12358. * @memberOf _
  12359. * @since 0.1.0
  12360. * @category Lang
  12361. * @param {*} value The value to check.
  12362. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12363. * @example
  12364. *
  12365. * _.isNaN(NaN);
  12366. * // => true
  12367. *
  12368. * _.isNaN(new Number(NaN));
  12369. * // => true
  12370. *
  12371. * isNaN(undefined);
  12372. * // => true
  12373. *
  12374. * _.isNaN(undefined);
  12375. * // => false
  12376. */
  12377. function isNaN(value) {
  12378. // An `NaN` primitive is the only value that is not equal to itself.
  12379. // Perform the `toStringTag` check first to avoid errors with some
  12380. // ActiveX objects in IE.
  12381. return isNumber(value) && value != +value;
  12382. }
  12383. /**
  12384. * Checks if `value` is a pristine native function.
  12385. *
  12386. * **Note:** This method can't reliably detect native functions in the presence
  12387. * of the core-js package because core-js circumvents this kind of detection.
  12388. * Despite multiple requests, the core-js maintainer has made it clear: any
  12389. * attempt to fix the detection will be obstructed. As a result, we're left
  12390. * with little choice but to throw an error. Unfortunately, this also affects
  12391. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12392. * which rely on core-js.
  12393. *
  12394. * @static
  12395. * @memberOf _
  12396. * @since 3.0.0
  12397. * @category Lang
  12398. * @param {*} value The value to check.
  12399. * @returns {boolean} Returns `true` if `value` is a native function,
  12400. * else `false`.
  12401. * @example
  12402. *
  12403. * _.isNative(Array.prototype.push);
  12404. * // => true
  12405. *
  12406. * _.isNative(_);
  12407. * // => false
  12408. */
  12409. function isNative(value) {
  12410. if (isMaskable(value)) {
  12411. throw new Error(CORE_ERROR_TEXT);
  12412. }
  12413. return baseIsNative(value);
  12414. }
  12415. /**
  12416. * Checks if `value` is `null`.
  12417. *
  12418. * @static
  12419. * @memberOf _
  12420. * @since 0.1.0
  12421. * @category Lang
  12422. * @param {*} value The value to check.
  12423. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12424. * @example
  12425. *
  12426. * _.isNull(null);
  12427. * // => true
  12428. *
  12429. * _.isNull(void 0);
  12430. * // => false
  12431. */
  12432. function isNull(value) {
  12433. return value === null;
  12434. }
  12435. /**
  12436. * Checks if `value` is `null` or `undefined`.
  12437. *
  12438. * @static
  12439. * @memberOf _
  12440. * @since 4.0.0
  12441. * @category Lang
  12442. * @param {*} value The value to check.
  12443. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12444. * @example
  12445. *
  12446. * _.isNil(null);
  12447. * // => true
  12448. *
  12449. * _.isNil(void 0);
  12450. * // => true
  12451. *
  12452. * _.isNil(NaN);
  12453. * // => false
  12454. */
  12455. function isNil(value) {
  12456. return value == null;
  12457. }
  12458. /**
  12459. * Checks if `value` is classified as a `Number` primitive or object.
  12460. *
  12461. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12462. * classified as numbers, use the `_.isFinite` method.
  12463. *
  12464. * @static
  12465. * @memberOf _
  12466. * @since 0.1.0
  12467. * @category Lang
  12468. * @param {*} value The value to check.
  12469. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12470. * @example
  12471. *
  12472. * _.isNumber(3);
  12473. * // => true
  12474. *
  12475. * _.isNumber(Number.MIN_VALUE);
  12476. * // => true
  12477. *
  12478. * _.isNumber(Infinity);
  12479. * // => true
  12480. *
  12481. * _.isNumber('3');
  12482. * // => false
  12483. */
  12484. function isNumber(value) {
  12485. return typeof value == 'number' ||
  12486. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12487. }
  12488. /**
  12489. * Checks if `value` is a plain object, that is, an object created by the
  12490. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12491. *
  12492. * @static
  12493. * @memberOf _
  12494. * @since 0.8.0
  12495. * @category Lang
  12496. * @param {*} value The value to check.
  12497. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12498. * @example
  12499. *
  12500. * function Foo() {
  12501. * this.a = 1;
  12502. * }
  12503. *
  12504. * _.isPlainObject(new Foo);
  12505. * // => false
  12506. *
  12507. * _.isPlainObject([1, 2, 3]);
  12508. * // => false
  12509. *
  12510. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12511. * // => true
  12512. *
  12513. * _.isPlainObject(Object.create(null));
  12514. * // => true
  12515. */
  12516. function isPlainObject(value) {
  12517. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12518. return false;
  12519. }
  12520. var proto = getPrototype(value);
  12521. if (proto === null) {
  12522. return true;
  12523. }
  12524. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12525. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12526. funcToString.call(Ctor) == objectCtorString;
  12527. }
  12528. /**
  12529. * Checks if `value` is classified as a `RegExp` object.
  12530. *
  12531. * @static
  12532. * @memberOf _
  12533. * @since 0.1.0
  12534. * @category Lang
  12535. * @param {*} value The value to check.
  12536. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12537. * @example
  12538. *
  12539. * _.isRegExp(/abc/);
  12540. * // => true
  12541. *
  12542. * _.isRegExp('/abc/');
  12543. * // => false
  12544. */
  12545. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12546. /**
  12547. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12548. * double precision number which isn't the result of a rounded unsafe integer.
  12549. *
  12550. * **Note:** This method is based on
  12551. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12552. *
  12553. * @static
  12554. * @memberOf _
  12555. * @since 4.0.0
  12556. * @category Lang
  12557. * @param {*} value The value to check.
  12558. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12559. * @example
  12560. *
  12561. * _.isSafeInteger(3);
  12562. * // => true
  12563. *
  12564. * _.isSafeInteger(Number.MIN_VALUE);
  12565. * // => false
  12566. *
  12567. * _.isSafeInteger(Infinity);
  12568. * // => false
  12569. *
  12570. * _.isSafeInteger('3');
  12571. * // => false
  12572. */
  12573. function isSafeInteger(value) {
  12574. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12575. }
  12576. /**
  12577. * Checks if `value` is classified as a `Set` object.
  12578. *
  12579. * @static
  12580. * @memberOf _
  12581. * @since 4.3.0
  12582. * @category Lang
  12583. * @param {*} value The value to check.
  12584. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12585. * @example
  12586. *
  12587. * _.isSet(new Set);
  12588. * // => true
  12589. *
  12590. * _.isSet(new WeakSet);
  12591. * // => false
  12592. */
  12593. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12594. /**
  12595. * Checks if `value` is classified as a `String` primitive or object.
  12596. *
  12597. * @static
  12598. * @since 0.1.0
  12599. * @memberOf _
  12600. * @category Lang
  12601. * @param {*} value The value to check.
  12602. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12603. * @example
  12604. *
  12605. * _.isString('abc');
  12606. * // => true
  12607. *
  12608. * _.isString(1);
  12609. * // => false
  12610. */
  12611. function isString(value) {
  12612. return typeof value == 'string' ||
  12613. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12614. }
  12615. /**
  12616. * Checks if `value` is classified as a `Symbol` primitive or object.
  12617. *
  12618. * @static
  12619. * @memberOf _
  12620. * @since 4.0.0
  12621. * @category Lang
  12622. * @param {*} value The value to check.
  12623. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12624. * @example
  12625. *
  12626. * _.isSymbol(Symbol.iterator);
  12627. * // => true
  12628. *
  12629. * _.isSymbol('abc');
  12630. * // => false
  12631. */
  12632. function isSymbol(value) {
  12633. return typeof value == 'symbol' ||
  12634. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12635. }
  12636. /**
  12637. * Checks if `value` is classified as a typed array.
  12638. *
  12639. * @static
  12640. * @memberOf _
  12641. * @since 3.0.0
  12642. * @category Lang
  12643. * @param {*} value The value to check.
  12644. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12645. * @example
  12646. *
  12647. * _.isTypedArray(new Uint8Array);
  12648. * // => true
  12649. *
  12650. * _.isTypedArray([]);
  12651. * // => false
  12652. */
  12653. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12654. /**
  12655. * Checks if `value` is `undefined`.
  12656. *
  12657. * @static
  12658. * @since 0.1.0
  12659. * @memberOf _
  12660. * @category Lang
  12661. * @param {*} value The value to check.
  12662. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12663. * @example
  12664. *
  12665. * _.isUndefined(void 0);
  12666. * // => true
  12667. *
  12668. * _.isUndefined(null);
  12669. * // => false
  12670. */
  12671. function isUndefined(value) {
  12672. return value === undefined;
  12673. }
  12674. /**
  12675. * Checks if `value` is classified as a `WeakMap` object.
  12676. *
  12677. * @static
  12678. * @memberOf _
  12679. * @since 4.3.0
  12680. * @category Lang
  12681. * @param {*} value The value to check.
  12682. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12683. * @example
  12684. *
  12685. * _.isWeakMap(new WeakMap);
  12686. * // => true
  12687. *
  12688. * _.isWeakMap(new Map);
  12689. * // => false
  12690. */
  12691. function isWeakMap(value) {
  12692. return isObjectLike(value) && getTag(value) == weakMapTag;
  12693. }
  12694. /**
  12695. * Checks if `value` is classified as a `WeakSet` object.
  12696. *
  12697. * @static
  12698. * @memberOf _
  12699. * @since 4.3.0
  12700. * @category Lang
  12701. * @param {*} value The value to check.
  12702. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12703. * @example
  12704. *
  12705. * _.isWeakSet(new WeakSet);
  12706. * // => true
  12707. *
  12708. * _.isWeakSet(new Set);
  12709. * // => false
  12710. */
  12711. function isWeakSet(value) {
  12712. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12713. }
  12714. /**
  12715. * Checks if `value` is less than `other`.
  12716. *
  12717. * @static
  12718. * @memberOf _
  12719. * @since 3.9.0
  12720. * @category Lang
  12721. * @param {*} value The value to compare.
  12722. * @param {*} other The other value to compare.
  12723. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12724. * else `false`.
  12725. * @see _.gt
  12726. * @example
  12727. *
  12728. * _.lt(1, 3);
  12729. * // => true
  12730. *
  12731. * _.lt(3, 3);
  12732. * // => false
  12733. *
  12734. * _.lt(3, 1);
  12735. * // => false
  12736. */
  12737. var lt = createRelationalOperation(baseLt);
  12738. /**
  12739. * Checks if `value` is less than or equal to `other`.
  12740. *
  12741. * @static
  12742. * @memberOf _
  12743. * @since 3.9.0
  12744. * @category Lang
  12745. * @param {*} value The value to compare.
  12746. * @param {*} other The other value to compare.
  12747. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12748. * `other`, else `false`.
  12749. * @see _.gte
  12750. * @example
  12751. *
  12752. * _.lte(1, 3);
  12753. * // => true
  12754. *
  12755. * _.lte(3, 3);
  12756. * // => true
  12757. *
  12758. * _.lte(3, 1);
  12759. * // => false
  12760. */
  12761. var lte = createRelationalOperation(function(value, other) {
  12762. return value <= other;
  12763. });
  12764. /**
  12765. * Converts `value` to an array.
  12766. *
  12767. * @static
  12768. * @since 0.1.0
  12769. * @memberOf _
  12770. * @category Lang
  12771. * @param {*} value The value to convert.
  12772. * @returns {Array} Returns the converted array.
  12773. * @example
  12774. *
  12775. * _.toArray({ 'a': 1, 'b': 2 });
  12776. * // => [1, 2]
  12777. *
  12778. * _.toArray('abc');
  12779. * // => ['a', 'b', 'c']
  12780. *
  12781. * _.toArray(1);
  12782. * // => []
  12783. *
  12784. * _.toArray(null);
  12785. * // => []
  12786. */
  12787. function toArray(value) {
  12788. if (!value) {
  12789. return [];
  12790. }
  12791. if (isArrayLike(value)) {
  12792. return isString(value) ? stringToArray(value) : copyArray(value);
  12793. }
  12794. if (symIterator && value[symIterator]) {
  12795. return iteratorToArray(value[symIterator]());
  12796. }
  12797. var tag = getTag(value),
  12798. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12799. return func(value);
  12800. }
  12801. /**
  12802. * Converts `value` to a finite number.
  12803. *
  12804. * @static
  12805. * @memberOf _
  12806. * @since 4.12.0
  12807. * @category Lang
  12808. * @param {*} value The value to convert.
  12809. * @returns {number} Returns the converted number.
  12810. * @example
  12811. *
  12812. * _.toFinite(3.2);
  12813. * // => 3.2
  12814. *
  12815. * _.toFinite(Number.MIN_VALUE);
  12816. * // => 5e-324
  12817. *
  12818. * _.toFinite(Infinity);
  12819. * // => 1.7976931348623157e+308
  12820. *
  12821. * _.toFinite('3.2');
  12822. * // => 3.2
  12823. */
  12824. function toFinite(value) {
  12825. if (!value) {
  12826. return value === 0 ? value : 0;
  12827. }
  12828. value = toNumber(value);
  12829. if (value === INFINITY || value === -INFINITY) {
  12830. var sign = (value < 0 ? -1 : 1);
  12831. return sign * MAX_INTEGER;
  12832. }
  12833. return value === value ? value : 0;
  12834. }
  12835. /**
  12836. * Converts `value` to an integer.
  12837. *
  12838. * **Note:** This method is loosely based on
  12839. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12840. *
  12841. * @static
  12842. * @memberOf _
  12843. * @since 4.0.0
  12844. * @category Lang
  12845. * @param {*} value The value to convert.
  12846. * @returns {number} Returns the converted integer.
  12847. * @example
  12848. *
  12849. * _.toInteger(3.2);
  12850. * // => 3
  12851. *
  12852. * _.toInteger(Number.MIN_VALUE);
  12853. * // => 0
  12854. *
  12855. * _.toInteger(Infinity);
  12856. * // => 1.7976931348623157e+308
  12857. *
  12858. * _.toInteger('3.2');
  12859. * // => 3
  12860. */
  12861. function toInteger(value) {
  12862. var result = toFinite(value),
  12863. remainder = result % 1;
  12864. return result === result ? (remainder ? result - remainder : result) : 0;
  12865. }
  12866. /**
  12867. * Converts `value` to an integer suitable for use as the length of an
  12868. * array-like object.
  12869. *
  12870. * **Note:** This method is based on
  12871. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12872. *
  12873. * @static
  12874. * @memberOf _
  12875. * @since 4.0.0
  12876. * @category Lang
  12877. * @param {*} value The value to convert.
  12878. * @returns {number} Returns the converted integer.
  12879. * @example
  12880. *
  12881. * _.toLength(3.2);
  12882. * // => 3
  12883. *
  12884. * _.toLength(Number.MIN_VALUE);
  12885. * // => 0
  12886. *
  12887. * _.toLength(Infinity);
  12888. * // => 4294967295
  12889. *
  12890. * _.toLength('3.2');
  12891. * // => 3
  12892. */
  12893. function toLength(value) {
  12894. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12895. }
  12896. /**
  12897. * Converts `value` to a number.
  12898. *
  12899. * @static
  12900. * @memberOf _
  12901. * @since 4.0.0
  12902. * @category Lang
  12903. * @param {*} value The value to process.
  12904. * @returns {number} Returns the number.
  12905. * @example
  12906. *
  12907. * _.toNumber(3.2);
  12908. * // => 3.2
  12909. *
  12910. * _.toNumber(Number.MIN_VALUE);
  12911. * // => 5e-324
  12912. *
  12913. * _.toNumber(Infinity);
  12914. * // => Infinity
  12915. *
  12916. * _.toNumber('3.2');
  12917. * // => 3.2
  12918. */
  12919. function toNumber(value) {
  12920. if (typeof value == 'number') {
  12921. return value;
  12922. }
  12923. if (isSymbol(value)) {
  12924. return NAN;
  12925. }
  12926. if (isObject(value)) {
  12927. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12928. value = isObject(other) ? (other + '') : other;
  12929. }
  12930. if (typeof value != 'string') {
  12931. return value === 0 ? value : +value;
  12932. }
  12933. value = baseTrim(value);
  12934. var isBinary = reIsBinary.test(value);
  12935. return (isBinary || reIsOctal.test(value))
  12936. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12937. : (reIsBadHex.test(value) ? NAN : +value);
  12938. }
  12939. /**
  12940. * Converts `value` to a plain object flattening inherited enumerable string
  12941. * keyed properties of `value` to own properties of the plain object.
  12942. *
  12943. * @static
  12944. * @memberOf _
  12945. * @since 3.0.0
  12946. * @category Lang
  12947. * @param {*} value The value to convert.
  12948. * @returns {Object} Returns the converted plain object.
  12949. * @example
  12950. *
  12951. * function Foo() {
  12952. * this.b = 2;
  12953. * }
  12954. *
  12955. * Foo.prototype.c = 3;
  12956. *
  12957. * _.assign({ 'a': 1 }, new Foo);
  12958. * // => { 'a': 1, 'b': 2 }
  12959. *
  12960. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12961. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12962. */
  12963. function toPlainObject(value) {
  12964. return copyObject(value, keysIn(value));
  12965. }
  12966. /**
  12967. * Converts `value` to a safe integer. A safe integer can be compared and
  12968. * represented correctly.
  12969. *
  12970. * @static
  12971. * @memberOf _
  12972. * @since 4.0.0
  12973. * @category Lang
  12974. * @param {*} value The value to convert.
  12975. * @returns {number} Returns the converted integer.
  12976. * @example
  12977. *
  12978. * _.toSafeInteger(3.2);
  12979. * // => 3
  12980. *
  12981. * _.toSafeInteger(Number.MIN_VALUE);
  12982. * // => 0
  12983. *
  12984. * _.toSafeInteger(Infinity);
  12985. * // => 9007199254740991
  12986. *
  12987. * _.toSafeInteger('3.2');
  12988. * // => 3
  12989. */
  12990. function toSafeInteger(value) {
  12991. return value
  12992. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12993. : (value === 0 ? value : 0);
  12994. }
  12995. /**
  12996. * Converts `value` to a string. An empty string is returned for `null`
  12997. * and `undefined` values. The sign of `-0` is preserved.
  12998. *
  12999. * @static
  13000. * @memberOf _
  13001. * @since 4.0.0
  13002. * @category Lang
  13003. * @param {*} value The value to convert.
  13004. * @returns {string} Returns the converted string.
  13005. * @example
  13006. *
  13007. * _.toString(null);
  13008. * // => ''
  13009. *
  13010. * _.toString(-0);
  13011. * // => '-0'
  13012. *
  13013. * _.toString([1, 2, 3]);
  13014. * // => '1,2,3'
  13015. */
  13016. function toString(value) {
  13017. return value == null ? '' : baseToString(value);
  13018. }
  13019. /*------------------------------------------------------------------------*/
  13020. /**
  13021. * Assigns own enumerable string keyed properties of source objects to the
  13022. * destination object. Source objects are applied from left to right.
  13023. * Subsequent sources overwrite property assignments of previous sources.
  13024. *
  13025. * **Note:** This method mutates `object` and is loosely based on
  13026. * [`Object.assign`](https://mdn.io/Object/assign).
  13027. *
  13028. * @static
  13029. * @memberOf _
  13030. * @since 0.10.0
  13031. * @category Object
  13032. * @param {Object} object The destination object.
  13033. * @param {...Object} [sources] The source objects.
  13034. * @returns {Object} Returns `object`.
  13035. * @see _.assignIn
  13036. * @example
  13037. *
  13038. * function Foo() {
  13039. * this.a = 1;
  13040. * }
  13041. *
  13042. * function Bar() {
  13043. * this.c = 3;
  13044. * }
  13045. *
  13046. * Foo.prototype.b = 2;
  13047. * Bar.prototype.d = 4;
  13048. *
  13049. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13050. * // => { 'a': 1, 'c': 3 }
  13051. */
  13052. var assign = createAssigner(function(object, source) {
  13053. if (isPrototype(source) || isArrayLike(source)) {
  13054. copyObject(source, keys(source), object);
  13055. return;
  13056. }
  13057. for (var key in source) {
  13058. if (hasOwnProperty.call(source, key)) {
  13059. assignValue(object, key, source[key]);
  13060. }
  13061. }
  13062. });
  13063. /**
  13064. * This method is like `_.assign` except that it iterates over own and
  13065. * inherited source properties.
  13066. *
  13067. * **Note:** This method mutates `object`.
  13068. *
  13069. * @static
  13070. * @memberOf _
  13071. * @since 4.0.0
  13072. * @alias extend
  13073. * @category Object
  13074. * @param {Object} object The destination object.
  13075. * @param {...Object} [sources] The source objects.
  13076. * @returns {Object} Returns `object`.
  13077. * @see _.assign
  13078. * @example
  13079. *
  13080. * function Foo() {
  13081. * this.a = 1;
  13082. * }
  13083. *
  13084. * function Bar() {
  13085. * this.c = 3;
  13086. * }
  13087. *
  13088. * Foo.prototype.b = 2;
  13089. * Bar.prototype.d = 4;
  13090. *
  13091. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13092. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13093. */
  13094. var assignIn = createAssigner(function(object, source) {
  13095. copyObject(source, keysIn(source), object);
  13096. });
  13097. /**
  13098. * This method is like `_.assignIn` except that it accepts `customizer`
  13099. * which is invoked to produce the assigned values. If `customizer` returns
  13100. * `undefined`, assignment is handled by the method instead. The `customizer`
  13101. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13102. *
  13103. * **Note:** This method mutates `object`.
  13104. *
  13105. * @static
  13106. * @memberOf _
  13107. * @since 4.0.0
  13108. * @alias extendWith
  13109. * @category Object
  13110. * @param {Object} object The destination object.
  13111. * @param {...Object} sources The source objects.
  13112. * @param {Function} [customizer] The function to customize assigned values.
  13113. * @returns {Object} Returns `object`.
  13114. * @see _.assignWith
  13115. * @example
  13116. *
  13117. * function customizer(objValue, srcValue) {
  13118. * return _.isUndefined(objValue) ? srcValue : objValue;
  13119. * }
  13120. *
  13121. * var defaults = _.partialRight(_.assignInWith, customizer);
  13122. *
  13123. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13124. * // => { 'a': 1, 'b': 2 }
  13125. */
  13126. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13127. copyObject(source, keysIn(source), object, customizer);
  13128. });
  13129. /**
  13130. * This method is like `_.assign` except that it accepts `customizer`
  13131. * which is invoked to produce the assigned values. If `customizer` returns
  13132. * `undefined`, assignment is handled by the method instead. The `customizer`
  13133. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13134. *
  13135. * **Note:** This method mutates `object`.
  13136. *
  13137. * @static
  13138. * @memberOf _
  13139. * @since 4.0.0
  13140. * @category Object
  13141. * @param {Object} object The destination object.
  13142. * @param {...Object} sources The source objects.
  13143. * @param {Function} [customizer] The function to customize assigned values.
  13144. * @returns {Object} Returns `object`.
  13145. * @see _.assignInWith
  13146. * @example
  13147. *
  13148. * function customizer(objValue, srcValue) {
  13149. * return _.isUndefined(objValue) ? srcValue : objValue;
  13150. * }
  13151. *
  13152. * var defaults = _.partialRight(_.assignWith, customizer);
  13153. *
  13154. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13155. * // => { 'a': 1, 'b': 2 }
  13156. */
  13157. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13158. copyObject(source, keys(source), object, customizer);
  13159. });
  13160. /**
  13161. * Creates an array of values corresponding to `paths` of `object`.
  13162. *
  13163. * @static
  13164. * @memberOf _
  13165. * @since 1.0.0
  13166. * @category Object
  13167. * @param {Object} object The object to iterate over.
  13168. * @param {...(string|string[])} [paths] The property paths to pick.
  13169. * @returns {Array} Returns the picked values.
  13170. * @example
  13171. *
  13172. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13173. *
  13174. * _.at(object, ['a[0].b.c', 'a[1]']);
  13175. * // => [3, 4]
  13176. */
  13177. var at = flatRest(baseAt);
  13178. /**
  13179. * Creates an object that inherits from the `prototype` object. If a
  13180. * `properties` object is given, its own enumerable string keyed properties
  13181. * are assigned to the created object.
  13182. *
  13183. * @static
  13184. * @memberOf _
  13185. * @since 2.3.0
  13186. * @category Object
  13187. * @param {Object} prototype The object to inherit from.
  13188. * @param {Object} [properties] The properties to assign to the object.
  13189. * @returns {Object} Returns the new object.
  13190. * @example
  13191. *
  13192. * function Shape() {
  13193. * this.x = 0;
  13194. * this.y = 0;
  13195. * }
  13196. *
  13197. * function Circle() {
  13198. * Shape.call(this);
  13199. * }
  13200. *
  13201. * Circle.prototype = _.create(Shape.prototype, {
  13202. * 'constructor': Circle
  13203. * });
  13204. *
  13205. * var circle = new Circle;
  13206. * circle instanceof Circle;
  13207. * // => true
  13208. *
  13209. * circle instanceof Shape;
  13210. * // => true
  13211. */
  13212. function create(prototype, properties) {
  13213. var result = baseCreate(prototype);
  13214. return properties == null ? result : baseAssign(result, properties);
  13215. }
  13216. /**
  13217. * Assigns own and inherited enumerable string keyed properties of source
  13218. * objects to the destination object for all destination properties that
  13219. * resolve to `undefined`. Source objects are applied from left to right.
  13220. * Once a property is set, additional values of the same property are ignored.
  13221. *
  13222. * **Note:** This method mutates `object`.
  13223. *
  13224. * @static
  13225. * @since 0.1.0
  13226. * @memberOf _
  13227. * @category Object
  13228. * @param {Object} object The destination object.
  13229. * @param {...Object} [sources] The source objects.
  13230. * @returns {Object} Returns `object`.
  13231. * @see _.defaultsDeep
  13232. * @example
  13233. *
  13234. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13235. * // => { 'a': 1, 'b': 2 }
  13236. */
  13237. var defaults = baseRest(function(object, sources) {
  13238. object = Object(object);
  13239. var index = -1;
  13240. var length = sources.length;
  13241. var guard = length > 2 ? sources[2] : undefined;
  13242. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13243. length = 1;
  13244. }
  13245. while (++index < length) {
  13246. var source = sources[index];
  13247. var props = keysIn(source);
  13248. var propsIndex = -1;
  13249. var propsLength = props.length;
  13250. while (++propsIndex < propsLength) {
  13251. var key = props[propsIndex];
  13252. var value = object[key];
  13253. if (value === undefined ||
  13254. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13255. object[key] = source[key];
  13256. }
  13257. }
  13258. }
  13259. return object;
  13260. });
  13261. /**
  13262. * This method is like `_.defaults` except that it recursively assigns
  13263. * default properties.
  13264. *
  13265. * **Note:** This method mutates `object`.
  13266. *
  13267. * @static
  13268. * @memberOf _
  13269. * @since 3.10.0
  13270. * @category Object
  13271. * @param {Object} object The destination object.
  13272. * @param {...Object} [sources] The source objects.
  13273. * @returns {Object} Returns `object`.
  13274. * @see _.defaults
  13275. * @example
  13276. *
  13277. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13278. * // => { 'a': { 'b': 2, 'c': 3 } }
  13279. */
  13280. var defaultsDeep = baseRest(function(args) {
  13281. args.push(undefined, customDefaultsMerge);
  13282. return apply(mergeWith, undefined, args);
  13283. });
  13284. /**
  13285. * This method is like `_.find` except that it returns the key of the first
  13286. * element `predicate` returns truthy for instead of the element itself.
  13287. *
  13288. * @static
  13289. * @memberOf _
  13290. * @since 1.1.0
  13291. * @category Object
  13292. * @param {Object} object The object to inspect.
  13293. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13294. * @returns {string|undefined} Returns the key of the matched element,
  13295. * else `undefined`.
  13296. * @example
  13297. *
  13298. * var users = {
  13299. * 'barney': { 'age': 36, 'active': true },
  13300. * 'fred': { 'age': 40, 'active': false },
  13301. * 'pebbles': { 'age': 1, 'active': true }
  13302. * };
  13303. *
  13304. * _.findKey(users, function(o) { return o.age < 40; });
  13305. * // => 'barney' (iteration order is not guaranteed)
  13306. *
  13307. * // The `_.matches` iteratee shorthand.
  13308. * _.findKey(users, { 'age': 1, 'active': true });
  13309. * // => 'pebbles'
  13310. *
  13311. * // The `_.matchesProperty` iteratee shorthand.
  13312. * _.findKey(users, ['active', false]);
  13313. * // => 'fred'
  13314. *
  13315. * // The `_.property` iteratee shorthand.
  13316. * _.findKey(users, 'active');
  13317. * // => 'barney'
  13318. */
  13319. function findKey(object, predicate) {
  13320. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13321. }
  13322. /**
  13323. * This method is like `_.findKey` except that it iterates over elements of
  13324. * a collection in the opposite order.
  13325. *
  13326. * @static
  13327. * @memberOf _
  13328. * @since 2.0.0
  13329. * @category Object
  13330. * @param {Object} object The object to inspect.
  13331. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13332. * @returns {string|undefined} Returns the key of the matched element,
  13333. * else `undefined`.
  13334. * @example
  13335. *
  13336. * var users = {
  13337. * 'barney': { 'age': 36, 'active': true },
  13338. * 'fred': { 'age': 40, 'active': false },
  13339. * 'pebbles': { 'age': 1, 'active': true }
  13340. * };
  13341. *
  13342. * _.findLastKey(users, function(o) { return o.age < 40; });
  13343. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13344. *
  13345. * // The `_.matches` iteratee shorthand.
  13346. * _.findLastKey(users, { 'age': 36, 'active': true });
  13347. * // => 'barney'
  13348. *
  13349. * // The `_.matchesProperty` iteratee shorthand.
  13350. * _.findLastKey(users, ['active', false]);
  13351. * // => 'fred'
  13352. *
  13353. * // The `_.property` iteratee shorthand.
  13354. * _.findLastKey(users, 'active');
  13355. * // => 'pebbles'
  13356. */
  13357. function findLastKey(object, predicate) {
  13358. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13359. }
  13360. /**
  13361. * Iterates over own and inherited enumerable string keyed properties of an
  13362. * object and invokes `iteratee` for each property. The iteratee is invoked
  13363. * with three arguments: (value, key, object). Iteratee functions may exit
  13364. * iteration early by explicitly returning `false`.
  13365. *
  13366. * @static
  13367. * @memberOf _
  13368. * @since 0.3.0
  13369. * @category Object
  13370. * @param {Object} object The object to iterate over.
  13371. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13372. * @returns {Object} Returns `object`.
  13373. * @see _.forInRight
  13374. * @example
  13375. *
  13376. * function Foo() {
  13377. * this.a = 1;
  13378. * this.b = 2;
  13379. * }
  13380. *
  13381. * Foo.prototype.c = 3;
  13382. *
  13383. * _.forIn(new Foo, function(value, key) {
  13384. * console.log(key);
  13385. * });
  13386. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13387. */
  13388. function forIn(object, iteratee) {
  13389. return object == null
  13390. ? object
  13391. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13392. }
  13393. /**
  13394. * This method is like `_.forIn` except that it iterates over properties of
  13395. * `object` in the opposite order.
  13396. *
  13397. * @static
  13398. * @memberOf _
  13399. * @since 2.0.0
  13400. * @category Object
  13401. * @param {Object} object The object to iterate over.
  13402. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13403. * @returns {Object} Returns `object`.
  13404. * @see _.forIn
  13405. * @example
  13406. *
  13407. * function Foo() {
  13408. * this.a = 1;
  13409. * this.b = 2;
  13410. * }
  13411. *
  13412. * Foo.prototype.c = 3;
  13413. *
  13414. * _.forInRight(new Foo, function(value, key) {
  13415. * console.log(key);
  13416. * });
  13417. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13418. */
  13419. function forInRight(object, iteratee) {
  13420. return object == null
  13421. ? object
  13422. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13423. }
  13424. /**
  13425. * Iterates over own enumerable string keyed properties of an object and
  13426. * invokes `iteratee` for each property. The iteratee is invoked with three
  13427. * arguments: (value, key, object). Iteratee functions may exit iteration
  13428. * early by explicitly returning `false`.
  13429. *
  13430. * @static
  13431. * @memberOf _
  13432. * @since 0.3.0
  13433. * @category Object
  13434. * @param {Object} object The object to iterate over.
  13435. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13436. * @returns {Object} Returns `object`.
  13437. * @see _.forOwnRight
  13438. * @example
  13439. *
  13440. * function Foo() {
  13441. * this.a = 1;
  13442. * this.b = 2;
  13443. * }
  13444. *
  13445. * Foo.prototype.c = 3;
  13446. *
  13447. * _.forOwn(new Foo, function(value, key) {
  13448. * console.log(key);
  13449. * });
  13450. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13451. */
  13452. function forOwn(object, iteratee) {
  13453. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13454. }
  13455. /**
  13456. * This method is like `_.forOwn` except that it iterates over properties of
  13457. * `object` in the opposite order.
  13458. *
  13459. * @static
  13460. * @memberOf _
  13461. * @since 2.0.0
  13462. * @category Object
  13463. * @param {Object} object The object to iterate over.
  13464. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13465. * @returns {Object} Returns `object`.
  13466. * @see _.forOwn
  13467. * @example
  13468. *
  13469. * function Foo() {
  13470. * this.a = 1;
  13471. * this.b = 2;
  13472. * }
  13473. *
  13474. * Foo.prototype.c = 3;
  13475. *
  13476. * _.forOwnRight(new Foo, function(value, key) {
  13477. * console.log(key);
  13478. * });
  13479. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13480. */
  13481. function forOwnRight(object, iteratee) {
  13482. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13483. }
  13484. /**
  13485. * Creates an array of function property names from own enumerable properties
  13486. * of `object`.
  13487. *
  13488. * @static
  13489. * @since 0.1.0
  13490. * @memberOf _
  13491. * @category Object
  13492. * @param {Object} object The object to inspect.
  13493. * @returns {Array} Returns the function names.
  13494. * @see _.functionsIn
  13495. * @example
  13496. *
  13497. * function Foo() {
  13498. * this.a = _.constant('a');
  13499. * this.b = _.constant('b');
  13500. * }
  13501. *
  13502. * Foo.prototype.c = _.constant('c');
  13503. *
  13504. * _.functions(new Foo);
  13505. * // => ['a', 'b']
  13506. */
  13507. function functions(object) {
  13508. return object == null ? [] : baseFunctions(object, keys(object));
  13509. }
  13510. /**
  13511. * Creates an array of function property names from own and inherited
  13512. * enumerable properties of `object`.
  13513. *
  13514. * @static
  13515. * @memberOf _
  13516. * @since 4.0.0
  13517. * @category Object
  13518. * @param {Object} object The object to inspect.
  13519. * @returns {Array} Returns the function names.
  13520. * @see _.functions
  13521. * @example
  13522. *
  13523. * function Foo() {
  13524. * this.a = _.constant('a');
  13525. * this.b = _.constant('b');
  13526. * }
  13527. *
  13528. * Foo.prototype.c = _.constant('c');
  13529. *
  13530. * _.functionsIn(new Foo);
  13531. * // => ['a', 'b', 'c']
  13532. */
  13533. function functionsIn(object) {
  13534. return object == null ? [] : baseFunctions(object, keysIn(object));
  13535. }
  13536. /**
  13537. * Gets the value at `path` of `object`. If the resolved value is
  13538. * `undefined`, the `defaultValue` is returned in its place.
  13539. *
  13540. * @static
  13541. * @memberOf _
  13542. * @since 3.7.0
  13543. * @category Object
  13544. * @param {Object} object The object to query.
  13545. * @param {Array|string} path The path of the property to get.
  13546. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13547. * @returns {*} Returns the resolved value.
  13548. * @example
  13549. *
  13550. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13551. *
  13552. * _.get(object, 'a[0].b.c');
  13553. * // => 3
  13554. *
  13555. * _.get(object, ['a', '0', 'b', 'c']);
  13556. * // => 3
  13557. *
  13558. * _.get(object, 'a.b.c', 'default');
  13559. * // => 'default'
  13560. */
  13561. function get(object, path, defaultValue) {
  13562. var result = object == null ? undefined : baseGet(object, path);
  13563. return result === undefined ? defaultValue : result;
  13564. }
  13565. /**
  13566. * Checks if `path` is a direct property of `object`.
  13567. *
  13568. * @static
  13569. * @since 0.1.0
  13570. * @memberOf _
  13571. * @category Object
  13572. * @param {Object} object The object to query.
  13573. * @param {Array|string} path The path to check.
  13574. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13575. * @example
  13576. *
  13577. * var object = { 'a': { 'b': 2 } };
  13578. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13579. *
  13580. * _.has(object, 'a');
  13581. * // => true
  13582. *
  13583. * _.has(object, 'a.b');
  13584. * // => true
  13585. *
  13586. * _.has(object, ['a', 'b']);
  13587. * // => true
  13588. *
  13589. * _.has(other, 'a');
  13590. * // => false
  13591. */
  13592. function has(object, path) {
  13593. return object != null && hasPath(object, path, baseHas);
  13594. }
  13595. /**
  13596. * Checks if `path` is a direct or inherited property of `object`.
  13597. *
  13598. * @static
  13599. * @memberOf _
  13600. * @since 4.0.0
  13601. * @category Object
  13602. * @param {Object} object The object to query.
  13603. * @param {Array|string} path The path to check.
  13604. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13605. * @example
  13606. *
  13607. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13608. *
  13609. * _.hasIn(object, 'a');
  13610. * // => true
  13611. *
  13612. * _.hasIn(object, 'a.b');
  13613. * // => true
  13614. *
  13615. * _.hasIn(object, ['a', 'b']);
  13616. * // => true
  13617. *
  13618. * _.hasIn(object, 'b');
  13619. * // => false
  13620. */
  13621. function hasIn(object, path) {
  13622. return object != null && hasPath(object, path, baseHasIn);
  13623. }
  13624. /**
  13625. * Creates an object composed of the inverted keys and values of `object`.
  13626. * If `object` contains duplicate values, subsequent values overwrite
  13627. * property assignments of previous values.
  13628. *
  13629. * @static
  13630. * @memberOf _
  13631. * @since 0.7.0
  13632. * @category Object
  13633. * @param {Object} object The object to invert.
  13634. * @returns {Object} Returns the new inverted object.
  13635. * @example
  13636. *
  13637. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13638. *
  13639. * _.invert(object);
  13640. * // => { '1': 'c', '2': 'b' }
  13641. */
  13642. var invert = createInverter(function(result, value, key) {
  13643. if (value != null &&
  13644. typeof value.toString != 'function') {
  13645. value = nativeObjectToString.call(value);
  13646. }
  13647. result[value] = key;
  13648. }, constant(identity));
  13649. /**
  13650. * This method is like `_.invert` except that the inverted object is generated
  13651. * from the results of running each element of `object` thru `iteratee`. The
  13652. * corresponding inverted value of each inverted key is an array of keys
  13653. * responsible for generating the inverted value. The iteratee is invoked
  13654. * with one argument: (value).
  13655. *
  13656. * @static
  13657. * @memberOf _
  13658. * @since 4.1.0
  13659. * @category Object
  13660. * @param {Object} object The object to invert.
  13661. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13662. * @returns {Object} Returns the new inverted object.
  13663. * @example
  13664. *
  13665. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13666. *
  13667. * _.invertBy(object);
  13668. * // => { '1': ['a', 'c'], '2': ['b'] }
  13669. *
  13670. * _.invertBy(object, function(value) {
  13671. * return 'group' + value;
  13672. * });
  13673. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13674. */
  13675. var invertBy = createInverter(function(result, value, key) {
  13676. if (value != null &&
  13677. typeof value.toString != 'function') {
  13678. value = nativeObjectToString.call(value);
  13679. }
  13680. if (hasOwnProperty.call(result, value)) {
  13681. result[value].push(key);
  13682. } else {
  13683. result[value] = [key];
  13684. }
  13685. }, getIteratee);
  13686. /**
  13687. * Invokes the method at `path` of `object`.
  13688. *
  13689. * @static
  13690. * @memberOf _
  13691. * @since 4.0.0
  13692. * @category Object
  13693. * @param {Object} object The object to query.
  13694. * @param {Array|string} path The path of the method to invoke.
  13695. * @param {...*} [args] The arguments to invoke the method with.
  13696. * @returns {*} Returns the result of the invoked method.
  13697. * @example
  13698. *
  13699. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13700. *
  13701. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13702. * // => [2, 3]
  13703. */
  13704. var invoke = baseRest(baseInvoke);
  13705. /**
  13706. * Creates an array of the own enumerable property names of `object`.
  13707. *
  13708. * **Note:** Non-object values are coerced to objects. See the
  13709. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13710. * for more details.
  13711. *
  13712. * @static
  13713. * @since 0.1.0
  13714. * @memberOf _
  13715. * @category Object
  13716. * @param {Object} object The object to query.
  13717. * @returns {Array} Returns the array of property names.
  13718. * @example
  13719. *
  13720. * function Foo() {
  13721. * this.a = 1;
  13722. * this.b = 2;
  13723. * }
  13724. *
  13725. * Foo.prototype.c = 3;
  13726. *
  13727. * _.keys(new Foo);
  13728. * // => ['a', 'b'] (iteration order is not guaranteed)
  13729. *
  13730. * _.keys('hi');
  13731. * // => ['0', '1']
  13732. */
  13733. function keys(object) {
  13734. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13735. }
  13736. /**
  13737. * Creates an array of the own and inherited enumerable property names of `object`.
  13738. *
  13739. * **Note:** Non-object values are coerced to objects.
  13740. *
  13741. * @static
  13742. * @memberOf _
  13743. * @since 3.0.0
  13744. * @category Object
  13745. * @param {Object} object The object to query.
  13746. * @returns {Array} Returns the array of property names.
  13747. * @example
  13748. *
  13749. * function Foo() {
  13750. * this.a = 1;
  13751. * this.b = 2;
  13752. * }
  13753. *
  13754. * Foo.prototype.c = 3;
  13755. *
  13756. * _.keysIn(new Foo);
  13757. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13758. */
  13759. function keysIn(object) {
  13760. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13761. }
  13762. /**
  13763. * The opposite of `_.mapValues`; this method creates an object with the
  13764. * same values as `object` and keys generated by running each own enumerable
  13765. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13766. * with three arguments: (value, key, object).
  13767. *
  13768. * @static
  13769. * @memberOf _
  13770. * @since 3.8.0
  13771. * @category Object
  13772. * @param {Object} object The object to iterate over.
  13773. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13774. * @returns {Object} Returns the new mapped object.
  13775. * @see _.mapValues
  13776. * @example
  13777. *
  13778. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13779. * return key + value;
  13780. * });
  13781. * // => { 'a1': 1, 'b2': 2 }
  13782. */
  13783. function mapKeys(object, iteratee) {
  13784. var result = {};
  13785. iteratee = getIteratee(iteratee, 3);
  13786. baseForOwn(object, function(value, key, object) {
  13787. baseAssignValue(result, iteratee(value, key, object), value);
  13788. });
  13789. return result;
  13790. }
  13791. /**
  13792. * Creates an object with the same keys as `object` and values generated
  13793. * by running each own enumerable string keyed property of `object` thru
  13794. * `iteratee`. The iteratee is invoked with three arguments:
  13795. * (value, key, object).
  13796. *
  13797. * @static
  13798. * @memberOf _
  13799. * @since 2.4.0
  13800. * @category Object
  13801. * @param {Object} object The object to iterate over.
  13802. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13803. * @returns {Object} Returns the new mapped object.
  13804. * @see _.mapKeys
  13805. * @example
  13806. *
  13807. * var users = {
  13808. * 'fred': { 'user': 'fred', 'age': 40 },
  13809. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13810. * };
  13811. *
  13812. * _.mapValues(users, function(o) { return o.age; });
  13813. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13814. *
  13815. * // The `_.property` iteratee shorthand.
  13816. * _.mapValues(users, 'age');
  13817. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13818. */
  13819. function mapValues(object, iteratee) {
  13820. var result = {};
  13821. iteratee = getIteratee(iteratee, 3);
  13822. baseForOwn(object, function(value, key, object) {
  13823. baseAssignValue(result, key, iteratee(value, key, object));
  13824. });
  13825. return result;
  13826. }
  13827. /**
  13828. * This method is like `_.assign` except that it recursively merges own and
  13829. * inherited enumerable string keyed properties of source objects into the
  13830. * destination object. Source properties that resolve to `undefined` are
  13831. * skipped if a destination value exists. Array and plain object properties
  13832. * are merged recursively. Other objects and value types are overridden by
  13833. * assignment. Source objects are applied from left to right. Subsequent
  13834. * sources overwrite property assignments of previous sources.
  13835. *
  13836. * **Note:** This method mutates `object`.
  13837. *
  13838. * @static
  13839. * @memberOf _
  13840. * @since 0.5.0
  13841. * @category Object
  13842. * @param {Object} object The destination object.
  13843. * @param {...Object} [sources] The source objects.
  13844. * @returns {Object} Returns `object`.
  13845. * @example
  13846. *
  13847. * var object = {
  13848. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13849. * };
  13850. *
  13851. * var other = {
  13852. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13853. * };
  13854. *
  13855. * _.merge(object, other);
  13856. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13857. */
  13858. var merge = createAssigner(function(object, source, srcIndex) {
  13859. baseMerge(object, source, srcIndex);
  13860. });
  13861. /**
  13862. * This method is like `_.merge` except that it accepts `customizer` which
  13863. * is invoked to produce the merged values of the destination and source
  13864. * properties. If `customizer` returns `undefined`, merging is handled by the
  13865. * method instead. The `customizer` is invoked with six arguments:
  13866. * (objValue, srcValue, key, object, source, stack).
  13867. *
  13868. * **Note:** This method mutates `object`.
  13869. *
  13870. * @static
  13871. * @memberOf _
  13872. * @since 4.0.0
  13873. * @category Object
  13874. * @param {Object} object The destination object.
  13875. * @param {...Object} sources The source objects.
  13876. * @param {Function} customizer The function to customize assigned values.
  13877. * @returns {Object} Returns `object`.
  13878. * @example
  13879. *
  13880. * function customizer(objValue, srcValue) {
  13881. * if (_.isArray(objValue)) {
  13882. * return objValue.concat(srcValue);
  13883. * }
  13884. * }
  13885. *
  13886. * var object = { 'a': [1], 'b': [2] };
  13887. * var other = { 'a': [3], 'b': [4] };
  13888. *
  13889. * _.mergeWith(object, other, customizer);
  13890. * // => { 'a': [1, 3], 'b': [2, 4] }
  13891. */
  13892. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13893. baseMerge(object, source, srcIndex, customizer);
  13894. });
  13895. /**
  13896. * The opposite of `_.pick`; this method creates an object composed of the
  13897. * own and inherited enumerable property paths of `object` that are not omitted.
  13898. *
  13899. * **Note:** This method is considerably slower than `_.pick`.
  13900. *
  13901. * @static
  13902. * @since 0.1.0
  13903. * @memberOf _
  13904. * @category Object
  13905. * @param {Object} object The source object.
  13906. * @param {...(string|string[])} [paths] The property paths to omit.
  13907. * @returns {Object} Returns the new object.
  13908. * @example
  13909. *
  13910. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13911. *
  13912. * _.omit(object, ['a', 'c']);
  13913. * // => { 'b': '2' }
  13914. */
  13915. var omit = flatRest(function(object, paths) {
  13916. var result = {};
  13917. if (object == null) {
  13918. return result;
  13919. }
  13920. var isDeep = false;
  13921. paths = arrayMap(paths, function(path) {
  13922. path = castPath(path, object);
  13923. isDeep || (isDeep = path.length > 1);
  13924. return path;
  13925. });
  13926. copyObject(object, getAllKeysIn(object), result);
  13927. if (isDeep) {
  13928. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13929. }
  13930. var length = paths.length;
  13931. while (length--) {
  13932. baseUnset(result, paths[length]);
  13933. }
  13934. return result;
  13935. });
  13936. /**
  13937. * The opposite of `_.pickBy`; this method creates an object composed of
  13938. * the own and inherited enumerable string keyed properties of `object` that
  13939. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13940. * arguments: (value, key).
  13941. *
  13942. * @static
  13943. * @memberOf _
  13944. * @since 4.0.0
  13945. * @category Object
  13946. * @param {Object} object The source object.
  13947. * @param {Function} [predicate=_.identity] The function invoked per property.
  13948. * @returns {Object} Returns the new object.
  13949. * @example
  13950. *
  13951. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13952. *
  13953. * _.omitBy(object, _.isNumber);
  13954. * // => { 'b': '2' }
  13955. */
  13956. function omitBy(object, predicate) {
  13957. return pickBy(object, negate(getIteratee(predicate)));
  13958. }
  13959. /**
  13960. * Creates an object composed of the picked `object` properties.
  13961. *
  13962. * @static
  13963. * @since 0.1.0
  13964. * @memberOf _
  13965. * @category Object
  13966. * @param {Object} object The source object.
  13967. * @param {...(string|string[])} [paths] The property paths to pick.
  13968. * @returns {Object} Returns the new object.
  13969. * @example
  13970. *
  13971. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13972. *
  13973. * _.pick(object, ['a', 'c']);
  13974. * // => { 'a': 1, 'c': 3 }
  13975. */
  13976. var pick = flatRest(function(object, paths) {
  13977. return object == null ? {} : basePick(object, paths);
  13978. });
  13979. /**
  13980. * Creates an object composed of the `object` properties `predicate` returns
  13981. * truthy for. The predicate is invoked with two arguments: (value, key).
  13982. *
  13983. * @static
  13984. * @memberOf _
  13985. * @since 4.0.0
  13986. * @category Object
  13987. * @param {Object} object The source object.
  13988. * @param {Function} [predicate=_.identity] The function invoked per property.
  13989. * @returns {Object} Returns the new object.
  13990. * @example
  13991. *
  13992. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13993. *
  13994. * _.pickBy(object, _.isNumber);
  13995. * // => { 'a': 1, 'c': 3 }
  13996. */
  13997. function pickBy(object, predicate) {
  13998. if (object == null) {
  13999. return {};
  14000. }
  14001. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14002. return [prop];
  14003. });
  14004. predicate = getIteratee(predicate);
  14005. return basePickBy(object, props, function(value, path) {
  14006. return predicate(value, path[0]);
  14007. });
  14008. }
  14009. /**
  14010. * This method is like `_.get` except that if the resolved value is a
  14011. * function it's invoked with the `this` binding of its parent object and
  14012. * its result is returned.
  14013. *
  14014. * @static
  14015. * @since 0.1.0
  14016. * @memberOf _
  14017. * @category Object
  14018. * @param {Object} object The object to query.
  14019. * @param {Array|string} path The path of the property to resolve.
  14020. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14021. * @returns {*} Returns the resolved value.
  14022. * @example
  14023. *
  14024. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14025. *
  14026. * _.result(object, 'a[0].b.c1');
  14027. * // => 3
  14028. *
  14029. * _.result(object, 'a[0].b.c2');
  14030. * // => 4
  14031. *
  14032. * _.result(object, 'a[0].b.c3', 'default');
  14033. * // => 'default'
  14034. *
  14035. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14036. * // => 'default'
  14037. */
  14038. function result(object, path, defaultValue) {
  14039. path = castPath(path, object);
  14040. var index = -1,
  14041. length = path.length;
  14042. // Ensure the loop is entered when path is empty.
  14043. if (!length) {
  14044. length = 1;
  14045. object = undefined;
  14046. }
  14047. while (++index < length) {
  14048. var value = object == null ? undefined : object[toKey(path[index])];
  14049. if (value === undefined) {
  14050. index = length;
  14051. value = defaultValue;
  14052. }
  14053. object = isFunction(value) ? value.call(object) : value;
  14054. }
  14055. return object;
  14056. }
  14057. /**
  14058. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14059. * it's created. Arrays are created for missing index properties while objects
  14060. * are created for all other missing properties. Use `_.setWith` to customize
  14061. * `path` creation.
  14062. *
  14063. * **Note:** This method mutates `object`.
  14064. *
  14065. * @static
  14066. * @memberOf _
  14067. * @since 3.7.0
  14068. * @category Object
  14069. * @param {Object} object The object to modify.
  14070. * @param {Array|string} path The path of the property to set.
  14071. * @param {*} value The value to set.
  14072. * @returns {Object} Returns `object`.
  14073. * @example
  14074. *
  14075. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14076. *
  14077. * _.set(object, 'a[0].b.c', 4);
  14078. * console.log(object.a[0].b.c);
  14079. * // => 4
  14080. *
  14081. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14082. * console.log(object.x[0].y.z);
  14083. * // => 5
  14084. */
  14085. function set(object, path, value) {
  14086. return object == null ? object : baseSet(object, path, value);
  14087. }
  14088. /**
  14089. * This method is like `_.set` except that it accepts `customizer` which is
  14090. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14091. * path creation is handled by the method instead. The `customizer` is invoked
  14092. * with three arguments: (nsValue, key, nsObject).
  14093. *
  14094. * **Note:** This method mutates `object`.
  14095. *
  14096. * @static
  14097. * @memberOf _
  14098. * @since 4.0.0
  14099. * @category Object
  14100. * @param {Object} object The object to modify.
  14101. * @param {Array|string} path The path of the property to set.
  14102. * @param {*} value The value to set.
  14103. * @param {Function} [customizer] The function to customize assigned values.
  14104. * @returns {Object} Returns `object`.
  14105. * @example
  14106. *
  14107. * var object = {};
  14108. *
  14109. * _.setWith(object, '[0][1]', 'a', Object);
  14110. * // => { '0': { '1': 'a' } }
  14111. */
  14112. function setWith(object, path, value, customizer) {
  14113. customizer = typeof customizer == 'function' ? customizer : undefined;
  14114. return object == null ? object : baseSet(object, path, value, customizer);
  14115. }
  14116. /**
  14117. * Creates an array of own enumerable string keyed-value pairs for `object`
  14118. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14119. * entries are returned.
  14120. *
  14121. * @static
  14122. * @memberOf _
  14123. * @since 4.0.0
  14124. * @alias entries
  14125. * @category Object
  14126. * @param {Object} object The object to query.
  14127. * @returns {Array} Returns the key-value pairs.
  14128. * @example
  14129. *
  14130. * function Foo() {
  14131. * this.a = 1;
  14132. * this.b = 2;
  14133. * }
  14134. *
  14135. * Foo.prototype.c = 3;
  14136. *
  14137. * _.toPairs(new Foo);
  14138. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14139. */
  14140. var toPairs = createToPairs(keys);
  14141. /**
  14142. * Creates an array of own and inherited enumerable string keyed-value pairs
  14143. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14144. * or set, its entries are returned.
  14145. *
  14146. * @static
  14147. * @memberOf _
  14148. * @since 4.0.0
  14149. * @alias entriesIn
  14150. * @category Object
  14151. * @param {Object} object The object to query.
  14152. * @returns {Array} Returns the key-value pairs.
  14153. * @example
  14154. *
  14155. * function Foo() {
  14156. * this.a = 1;
  14157. * this.b = 2;
  14158. * }
  14159. *
  14160. * Foo.prototype.c = 3;
  14161. *
  14162. * _.toPairsIn(new Foo);
  14163. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14164. */
  14165. var toPairsIn = createToPairs(keysIn);
  14166. /**
  14167. * An alternative to `_.reduce`; this method transforms `object` to a new
  14168. * `accumulator` object which is the result of running each of its own
  14169. * enumerable string keyed properties thru `iteratee`, with each invocation
  14170. * potentially mutating the `accumulator` object. If `accumulator` is not
  14171. * provided, a new object with the same `[[Prototype]]` will be used. The
  14172. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14173. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14174. *
  14175. * @static
  14176. * @memberOf _
  14177. * @since 1.3.0
  14178. * @category Object
  14179. * @param {Object} object The object to iterate over.
  14180. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14181. * @param {*} [accumulator] The custom accumulator value.
  14182. * @returns {*} Returns the accumulated value.
  14183. * @example
  14184. *
  14185. * _.transform([2, 3, 4], function(result, n) {
  14186. * result.push(n *= n);
  14187. * return n % 2 == 0;
  14188. * }, []);
  14189. * // => [4, 9]
  14190. *
  14191. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14192. * (result[value] || (result[value] = [])).push(key);
  14193. * }, {});
  14194. * // => { '1': ['a', 'c'], '2': ['b'] }
  14195. */
  14196. function transform(object, iteratee, accumulator) {
  14197. var isArr = isArray(object),
  14198. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14199. iteratee = getIteratee(iteratee, 4);
  14200. if (accumulator == null) {
  14201. var Ctor = object && object.constructor;
  14202. if (isArrLike) {
  14203. accumulator = isArr ? new Ctor : [];
  14204. }
  14205. else if (isObject(object)) {
  14206. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14207. }
  14208. else {
  14209. accumulator = {};
  14210. }
  14211. }
  14212. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14213. return iteratee(accumulator, value, index, object);
  14214. });
  14215. return accumulator;
  14216. }
  14217. /**
  14218. * Removes the property at `path` of `object`.
  14219. *
  14220. * **Note:** This method mutates `object`.
  14221. *
  14222. * @static
  14223. * @memberOf _
  14224. * @since 4.0.0
  14225. * @category Object
  14226. * @param {Object} object The object to modify.
  14227. * @param {Array|string} path The path of the property to unset.
  14228. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14229. * @example
  14230. *
  14231. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14232. * _.unset(object, 'a[0].b.c');
  14233. * // => true
  14234. *
  14235. * console.log(object);
  14236. * // => { 'a': [{ 'b': {} }] };
  14237. *
  14238. * _.unset(object, ['a', '0', 'b', 'c']);
  14239. * // => true
  14240. *
  14241. * console.log(object);
  14242. * // => { 'a': [{ 'b': {} }] };
  14243. */
  14244. function unset(object, path) {
  14245. return object == null ? true : baseUnset(object, path);
  14246. }
  14247. /**
  14248. * This method is like `_.set` except that accepts `updater` to produce the
  14249. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14250. * is invoked with one argument: (value).
  14251. *
  14252. * **Note:** This method mutates `object`.
  14253. *
  14254. * @static
  14255. * @memberOf _
  14256. * @since 4.6.0
  14257. * @category Object
  14258. * @param {Object} object The object to modify.
  14259. * @param {Array|string} path The path of the property to set.
  14260. * @param {Function} updater The function to produce the updated value.
  14261. * @returns {Object} Returns `object`.
  14262. * @example
  14263. *
  14264. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14265. *
  14266. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14267. * console.log(object.a[0].b.c);
  14268. * // => 9
  14269. *
  14270. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14271. * console.log(object.x[0].y.z);
  14272. * // => 0
  14273. */
  14274. function update(object, path, updater) {
  14275. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14276. }
  14277. /**
  14278. * This method is like `_.update` except that it accepts `customizer` which is
  14279. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14280. * path creation is handled by the method instead. The `customizer` is invoked
  14281. * with three arguments: (nsValue, key, nsObject).
  14282. *
  14283. * **Note:** This method mutates `object`.
  14284. *
  14285. * @static
  14286. * @memberOf _
  14287. * @since 4.6.0
  14288. * @category Object
  14289. * @param {Object} object The object to modify.
  14290. * @param {Array|string} path The path of the property to set.
  14291. * @param {Function} updater The function to produce the updated value.
  14292. * @param {Function} [customizer] The function to customize assigned values.
  14293. * @returns {Object} Returns `object`.
  14294. * @example
  14295. *
  14296. * var object = {};
  14297. *
  14298. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14299. * // => { '0': { '1': 'a' } }
  14300. */
  14301. function updateWith(object, path, updater, customizer) {
  14302. customizer = typeof customizer == 'function' ? customizer : undefined;
  14303. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14304. }
  14305. /**
  14306. * Creates an array of the own enumerable string keyed property values of `object`.
  14307. *
  14308. * **Note:** Non-object values are coerced to objects.
  14309. *
  14310. * @static
  14311. * @since 0.1.0
  14312. * @memberOf _
  14313. * @category Object
  14314. * @param {Object} object The object to query.
  14315. * @returns {Array} Returns the array of property values.
  14316. * @example
  14317. *
  14318. * function Foo() {
  14319. * this.a = 1;
  14320. * this.b = 2;
  14321. * }
  14322. *
  14323. * Foo.prototype.c = 3;
  14324. *
  14325. * _.values(new Foo);
  14326. * // => [1, 2] (iteration order is not guaranteed)
  14327. *
  14328. * _.values('hi');
  14329. * // => ['h', 'i']
  14330. */
  14331. function values(object) {
  14332. return object == null ? [] : baseValues(object, keys(object));
  14333. }
  14334. /**
  14335. * Creates an array of the own and inherited enumerable string keyed property
  14336. * values of `object`.
  14337. *
  14338. * **Note:** Non-object values are coerced to objects.
  14339. *
  14340. * @static
  14341. * @memberOf _
  14342. * @since 3.0.0
  14343. * @category Object
  14344. * @param {Object} object The object to query.
  14345. * @returns {Array} Returns the array of property values.
  14346. * @example
  14347. *
  14348. * function Foo() {
  14349. * this.a = 1;
  14350. * this.b = 2;
  14351. * }
  14352. *
  14353. * Foo.prototype.c = 3;
  14354. *
  14355. * _.valuesIn(new Foo);
  14356. * // => [1, 2, 3] (iteration order is not guaranteed)
  14357. */
  14358. function valuesIn(object) {
  14359. return object == null ? [] : baseValues(object, keysIn(object));
  14360. }
  14361. /*------------------------------------------------------------------------*/
  14362. /**
  14363. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14364. *
  14365. * @static
  14366. * @memberOf _
  14367. * @since 4.0.0
  14368. * @category Number
  14369. * @param {number} number The number to clamp.
  14370. * @param {number} [lower] The lower bound.
  14371. * @param {number} upper The upper bound.
  14372. * @returns {number} Returns the clamped number.
  14373. * @example
  14374. *
  14375. * _.clamp(-10, -5, 5);
  14376. * // => -5
  14377. *
  14378. * _.clamp(10, -5, 5);
  14379. * // => 5
  14380. */
  14381. function clamp(number, lower, upper) {
  14382. if (upper === undefined) {
  14383. upper = lower;
  14384. lower = undefined;
  14385. }
  14386. if (upper !== undefined) {
  14387. upper = toNumber(upper);
  14388. upper = upper === upper ? upper : 0;
  14389. }
  14390. if (lower !== undefined) {
  14391. lower = toNumber(lower);
  14392. lower = lower === lower ? lower : 0;
  14393. }
  14394. return baseClamp(toNumber(number), lower, upper);
  14395. }
  14396. /**
  14397. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14398. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14399. * If `start` is greater than `end` the params are swapped to support
  14400. * negative ranges.
  14401. *
  14402. * @static
  14403. * @memberOf _
  14404. * @since 3.3.0
  14405. * @category Number
  14406. * @param {number} number The number to check.
  14407. * @param {number} [start=0] The start of the range.
  14408. * @param {number} end The end of the range.
  14409. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14410. * @see _.range, _.rangeRight
  14411. * @example
  14412. *
  14413. * _.inRange(3, 2, 4);
  14414. * // => true
  14415. *
  14416. * _.inRange(4, 8);
  14417. * // => true
  14418. *
  14419. * _.inRange(4, 2);
  14420. * // => false
  14421. *
  14422. * _.inRange(2, 2);
  14423. * // => false
  14424. *
  14425. * _.inRange(1.2, 2);
  14426. * // => true
  14427. *
  14428. * _.inRange(5.2, 4);
  14429. * // => false
  14430. *
  14431. * _.inRange(-3, -2, -6);
  14432. * // => true
  14433. */
  14434. function inRange(number, start, end) {
  14435. start = toFinite(start);
  14436. if (end === undefined) {
  14437. end = start;
  14438. start = 0;
  14439. } else {
  14440. end = toFinite(end);
  14441. }
  14442. number = toNumber(number);
  14443. return baseInRange(number, start, end);
  14444. }
  14445. /**
  14446. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14447. * If only one argument is provided a number between `0` and the given number
  14448. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14449. * floats, a floating-point number is returned instead of an integer.
  14450. *
  14451. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14452. * floating-point values which can produce unexpected results.
  14453. *
  14454. * @static
  14455. * @memberOf _
  14456. * @since 0.7.0
  14457. * @category Number
  14458. * @param {number} [lower=0] The lower bound.
  14459. * @param {number} [upper=1] The upper bound.
  14460. * @param {boolean} [floating] Specify returning a floating-point number.
  14461. * @returns {number} Returns the random number.
  14462. * @example
  14463. *
  14464. * _.random(0, 5);
  14465. * // => an integer between 0 and 5
  14466. *
  14467. * _.random(5);
  14468. * // => also an integer between 0 and 5
  14469. *
  14470. * _.random(5, true);
  14471. * // => a floating-point number between 0 and 5
  14472. *
  14473. * _.random(1.2, 5.2);
  14474. * // => a floating-point number between 1.2 and 5.2
  14475. */
  14476. function random(lower, upper, floating) {
  14477. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14478. upper = floating = undefined;
  14479. }
  14480. if (floating === undefined) {
  14481. if (typeof upper == 'boolean') {
  14482. floating = upper;
  14483. upper = undefined;
  14484. }
  14485. else if (typeof lower == 'boolean') {
  14486. floating = lower;
  14487. lower = undefined;
  14488. }
  14489. }
  14490. if (lower === undefined && upper === undefined) {
  14491. lower = 0;
  14492. upper = 1;
  14493. }
  14494. else {
  14495. lower = toFinite(lower);
  14496. if (upper === undefined) {
  14497. upper = lower;
  14498. lower = 0;
  14499. } else {
  14500. upper = toFinite(upper);
  14501. }
  14502. }
  14503. if (lower > upper) {
  14504. var temp = lower;
  14505. lower = upper;
  14506. upper = temp;
  14507. }
  14508. if (floating || lower % 1 || upper % 1) {
  14509. var rand = nativeRandom();
  14510. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14511. }
  14512. return baseRandom(lower, upper);
  14513. }
  14514. /*------------------------------------------------------------------------*/
  14515. /**
  14516. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14517. *
  14518. * @static
  14519. * @memberOf _
  14520. * @since 3.0.0
  14521. * @category String
  14522. * @param {string} [string=''] The string to convert.
  14523. * @returns {string} Returns the camel cased string.
  14524. * @example
  14525. *
  14526. * _.camelCase('Foo Bar');
  14527. * // => 'fooBar'
  14528. *
  14529. * _.camelCase('--foo-bar--');
  14530. * // => 'fooBar'
  14531. *
  14532. * _.camelCase('__FOO_BAR__');
  14533. * // => 'fooBar'
  14534. */
  14535. var camelCase = createCompounder(function(result, word, index) {
  14536. word = word.toLowerCase();
  14537. return result + (index ? capitalize(word) : word);
  14538. });
  14539. /**
  14540. * Converts the first character of `string` to upper case and the remaining
  14541. * to lower case.
  14542. *
  14543. * @static
  14544. * @memberOf _
  14545. * @since 3.0.0
  14546. * @category String
  14547. * @param {string} [string=''] The string to capitalize.
  14548. * @returns {string} Returns the capitalized string.
  14549. * @example
  14550. *
  14551. * _.capitalize('FRED');
  14552. * // => 'Fred'
  14553. */
  14554. function capitalize(string) {
  14555. return upperFirst(toString(string).toLowerCase());
  14556. }
  14557. /**
  14558. * Deburrs `string` by converting
  14559. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14560. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14561. * letters to basic Latin letters and removing
  14562. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14563. *
  14564. * @static
  14565. * @memberOf _
  14566. * @since 3.0.0
  14567. * @category String
  14568. * @param {string} [string=''] The string to deburr.
  14569. * @returns {string} Returns the deburred string.
  14570. * @example
  14571. *
  14572. * _.deburr('déjà vu');
  14573. * // => 'deja vu'
  14574. */
  14575. function deburr(string) {
  14576. string = toString(string);
  14577. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14578. }
  14579. /**
  14580. * Checks if `string` ends with the given target string.
  14581. *
  14582. * @static
  14583. * @memberOf _
  14584. * @since 3.0.0
  14585. * @category String
  14586. * @param {string} [string=''] The string to inspect.
  14587. * @param {string} [target] The string to search for.
  14588. * @param {number} [position=string.length] The position to search up to.
  14589. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14590. * else `false`.
  14591. * @example
  14592. *
  14593. * _.endsWith('abc', 'c');
  14594. * // => true
  14595. *
  14596. * _.endsWith('abc', 'b');
  14597. * // => false
  14598. *
  14599. * _.endsWith('abc', 'b', 2);
  14600. * // => true
  14601. */
  14602. function endsWith(string, target, position) {
  14603. string = toString(string);
  14604. target = baseToString(target);
  14605. var length = string.length;
  14606. position = position === undefined
  14607. ? length
  14608. : baseClamp(toInteger(position), 0, length);
  14609. var end = position;
  14610. position -= target.length;
  14611. return position >= 0 && string.slice(position, end) == target;
  14612. }
  14613. /**
  14614. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14615. * corresponding HTML entities.
  14616. *
  14617. * **Note:** No other characters are escaped. To escape additional
  14618. * characters use a third-party library like [_he_](https://mths.be/he).
  14619. *
  14620. * Though the ">" character is escaped for symmetry, characters like
  14621. * ">" and "/" don't need escaping in HTML and have no special meaning
  14622. * unless they're part of a tag or unquoted attribute value. See
  14623. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14624. * (under "semi-related fun fact") for more details.
  14625. *
  14626. * When working with HTML you should always
  14627. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14628. * XSS vectors.
  14629. *
  14630. * @static
  14631. * @since 0.1.0
  14632. * @memberOf _
  14633. * @category String
  14634. * @param {string} [string=''] The string to escape.
  14635. * @returns {string} Returns the escaped string.
  14636. * @example
  14637. *
  14638. * _.escape('fred, barney, & pebbles');
  14639. * // => 'fred, barney, &amp; pebbles'
  14640. */
  14641. function escape(string) {
  14642. string = toString(string);
  14643. return (string && reHasUnescapedHtml.test(string))
  14644. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14645. : string;
  14646. }
  14647. /**
  14648. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14649. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14650. *
  14651. * @static
  14652. * @memberOf _
  14653. * @since 3.0.0
  14654. * @category String
  14655. * @param {string} [string=''] The string to escape.
  14656. * @returns {string} Returns the escaped string.
  14657. * @example
  14658. *
  14659. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14660. * // => '\[lodash\]\(https://lodash\.com/\)'
  14661. */
  14662. function escapeRegExp(string) {
  14663. string = toString(string);
  14664. return (string && reHasRegExpChar.test(string))
  14665. ? string.replace(reRegExpChar, '\\$&')
  14666. : string;
  14667. }
  14668. /**
  14669. * Converts `string` to
  14670. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14671. *
  14672. * @static
  14673. * @memberOf _
  14674. * @since 3.0.0
  14675. * @category String
  14676. * @param {string} [string=''] The string to convert.
  14677. * @returns {string} Returns the kebab cased string.
  14678. * @example
  14679. *
  14680. * _.kebabCase('Foo Bar');
  14681. * // => 'foo-bar'
  14682. *
  14683. * _.kebabCase('fooBar');
  14684. * // => 'foo-bar'
  14685. *
  14686. * _.kebabCase('__FOO_BAR__');
  14687. * // => 'foo-bar'
  14688. */
  14689. var kebabCase = createCompounder(function(result, word, index) {
  14690. return result + (index ? '-' : '') + word.toLowerCase();
  14691. });
  14692. /**
  14693. * Converts `string`, as space separated words, to lower case.
  14694. *
  14695. * @static
  14696. * @memberOf _
  14697. * @since 4.0.0
  14698. * @category String
  14699. * @param {string} [string=''] The string to convert.
  14700. * @returns {string} Returns the lower cased string.
  14701. * @example
  14702. *
  14703. * _.lowerCase('--Foo-Bar--');
  14704. * // => 'foo bar'
  14705. *
  14706. * _.lowerCase('fooBar');
  14707. * // => 'foo bar'
  14708. *
  14709. * _.lowerCase('__FOO_BAR__');
  14710. * // => 'foo bar'
  14711. */
  14712. var lowerCase = createCompounder(function(result, word, index) {
  14713. return result + (index ? ' ' : '') + word.toLowerCase();
  14714. });
  14715. /**
  14716. * Converts the first character of `string` to lower case.
  14717. *
  14718. * @static
  14719. * @memberOf _
  14720. * @since 4.0.0
  14721. * @category String
  14722. * @param {string} [string=''] The string to convert.
  14723. * @returns {string} Returns the converted string.
  14724. * @example
  14725. *
  14726. * _.lowerFirst('Fred');
  14727. * // => 'fred'
  14728. *
  14729. * _.lowerFirst('FRED');
  14730. * // => 'fRED'
  14731. */
  14732. var lowerFirst = createCaseFirst('toLowerCase');
  14733. /**
  14734. * Pads `string` on the left and right sides if it's shorter than `length`.
  14735. * Padding characters are truncated if they can't be evenly divided by `length`.
  14736. *
  14737. * @static
  14738. * @memberOf _
  14739. * @since 3.0.0
  14740. * @category String
  14741. * @param {string} [string=''] The string to pad.
  14742. * @param {number} [length=0] The padding length.
  14743. * @param {string} [chars=' '] The string used as padding.
  14744. * @returns {string} Returns the padded string.
  14745. * @example
  14746. *
  14747. * _.pad('abc', 8);
  14748. * // => ' abc '
  14749. *
  14750. * _.pad('abc', 8, '_-');
  14751. * // => '_-abc_-_'
  14752. *
  14753. * _.pad('abc', 3);
  14754. * // => 'abc'
  14755. */
  14756. function pad(string, length, chars) {
  14757. string = toString(string);
  14758. length = toInteger(length);
  14759. var strLength = length ? stringSize(string) : 0;
  14760. if (!length || strLength >= length) {
  14761. return string;
  14762. }
  14763. var mid = (length - strLength) / 2;
  14764. return (
  14765. createPadding(nativeFloor(mid), chars) +
  14766. string +
  14767. createPadding(nativeCeil(mid), chars)
  14768. );
  14769. }
  14770. /**
  14771. * Pads `string` on the right side if it's shorter than `length`. Padding
  14772. * characters are truncated if they exceed `length`.
  14773. *
  14774. * @static
  14775. * @memberOf _
  14776. * @since 4.0.0
  14777. * @category String
  14778. * @param {string} [string=''] The string to pad.
  14779. * @param {number} [length=0] The padding length.
  14780. * @param {string} [chars=' '] The string used as padding.
  14781. * @returns {string} Returns the padded string.
  14782. * @example
  14783. *
  14784. * _.padEnd('abc', 6);
  14785. * // => 'abc '
  14786. *
  14787. * _.padEnd('abc', 6, '_-');
  14788. * // => 'abc_-_'
  14789. *
  14790. * _.padEnd('abc', 3);
  14791. * // => 'abc'
  14792. */
  14793. function padEnd(string, length, chars) {
  14794. string = toString(string);
  14795. length = toInteger(length);
  14796. var strLength = length ? stringSize(string) : 0;
  14797. return (length && strLength < length)
  14798. ? (string + createPadding(length - strLength, chars))
  14799. : string;
  14800. }
  14801. /**
  14802. * Pads `string` on the left side if it's shorter than `length`. Padding
  14803. * characters are truncated if they exceed `length`.
  14804. *
  14805. * @static
  14806. * @memberOf _
  14807. * @since 4.0.0
  14808. * @category String
  14809. * @param {string} [string=''] The string to pad.
  14810. * @param {number} [length=0] The padding length.
  14811. * @param {string} [chars=' '] The string used as padding.
  14812. * @returns {string} Returns the padded string.
  14813. * @example
  14814. *
  14815. * _.padStart('abc', 6);
  14816. * // => ' abc'
  14817. *
  14818. * _.padStart('abc', 6, '_-');
  14819. * // => '_-_abc'
  14820. *
  14821. * _.padStart('abc', 3);
  14822. * // => 'abc'
  14823. */
  14824. function padStart(string, length, chars) {
  14825. string = toString(string);
  14826. length = toInteger(length);
  14827. var strLength = length ? stringSize(string) : 0;
  14828. return (length && strLength < length)
  14829. ? (createPadding(length - strLength, chars) + string)
  14830. : string;
  14831. }
  14832. /**
  14833. * Converts `string` to an integer of the specified radix. If `radix` is
  14834. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14835. * hexadecimal, in which case a `radix` of `16` is used.
  14836. *
  14837. * **Note:** This method aligns with the
  14838. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14839. *
  14840. * @static
  14841. * @memberOf _
  14842. * @since 1.1.0
  14843. * @category String
  14844. * @param {string} string The string to convert.
  14845. * @param {number} [radix=10] The radix to interpret `value` by.
  14846. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14847. * @returns {number} Returns the converted integer.
  14848. * @example
  14849. *
  14850. * _.parseInt('08');
  14851. * // => 8
  14852. *
  14853. * _.map(['6', '08', '10'], _.parseInt);
  14854. * // => [6, 8, 10]
  14855. */
  14856. function parseInt(string, radix, guard) {
  14857. if (guard || radix == null) {
  14858. radix = 0;
  14859. } else if (radix) {
  14860. radix = +radix;
  14861. }
  14862. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14863. }
  14864. /**
  14865. * Repeats the given string `n` times.
  14866. *
  14867. * @static
  14868. * @memberOf _
  14869. * @since 3.0.0
  14870. * @category String
  14871. * @param {string} [string=''] The string to repeat.
  14872. * @param {number} [n=1] The number of times to repeat the string.
  14873. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14874. * @returns {string} Returns the repeated string.
  14875. * @example
  14876. *
  14877. * _.repeat('*', 3);
  14878. * // => '***'
  14879. *
  14880. * _.repeat('abc', 2);
  14881. * // => 'abcabc'
  14882. *
  14883. * _.repeat('abc', 0);
  14884. * // => ''
  14885. */
  14886. function repeat(string, n, guard) {
  14887. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14888. n = 1;
  14889. } else {
  14890. n = toInteger(n);
  14891. }
  14892. return baseRepeat(toString(string), n);
  14893. }
  14894. /**
  14895. * Replaces matches for `pattern` in `string` with `replacement`.
  14896. *
  14897. * **Note:** This method is based on
  14898. * [`String#replace`](https://mdn.io/String/replace).
  14899. *
  14900. * @static
  14901. * @memberOf _
  14902. * @since 4.0.0
  14903. * @category String
  14904. * @param {string} [string=''] The string to modify.
  14905. * @param {RegExp|string} pattern The pattern to replace.
  14906. * @param {Function|string} replacement The match replacement.
  14907. * @returns {string} Returns the modified string.
  14908. * @example
  14909. *
  14910. * _.replace('Hi Fred', 'Fred', 'Barney');
  14911. * // => 'Hi Barney'
  14912. */
  14913. function replace() {
  14914. var args = arguments,
  14915. string = toString(args[0]);
  14916. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14917. }
  14918. /**
  14919. * Converts `string` to
  14920. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14921. *
  14922. * @static
  14923. * @memberOf _
  14924. * @since 3.0.0
  14925. * @category String
  14926. * @param {string} [string=''] The string to convert.
  14927. * @returns {string} Returns the snake cased string.
  14928. * @example
  14929. *
  14930. * _.snakeCase('Foo Bar');
  14931. * // => 'foo_bar'
  14932. *
  14933. * _.snakeCase('fooBar');
  14934. * // => 'foo_bar'
  14935. *
  14936. * _.snakeCase('--FOO-BAR--');
  14937. * // => 'foo_bar'
  14938. */
  14939. var snakeCase = createCompounder(function(result, word, index) {
  14940. return result + (index ? '_' : '') + word.toLowerCase();
  14941. });
  14942. /**
  14943. * Splits `string` by `separator`.
  14944. *
  14945. * **Note:** This method is based on
  14946. * [`String#split`](https://mdn.io/String/split).
  14947. *
  14948. * @static
  14949. * @memberOf _
  14950. * @since 4.0.0
  14951. * @category String
  14952. * @param {string} [string=''] The string to split.
  14953. * @param {RegExp|string} separator The separator pattern to split by.
  14954. * @param {number} [limit] The length to truncate results to.
  14955. * @returns {Array} Returns the string segments.
  14956. * @example
  14957. *
  14958. * _.split('a-b-c', '-', 2);
  14959. * // => ['a', 'b']
  14960. */
  14961. function split(string, separator, limit) {
  14962. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14963. separator = limit = undefined;
  14964. }
  14965. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14966. if (!limit) {
  14967. return [];
  14968. }
  14969. string = toString(string);
  14970. if (string && (
  14971. typeof separator == 'string' ||
  14972. (separator != null && !isRegExp(separator))
  14973. )) {
  14974. separator = baseToString(separator);
  14975. if (!separator && hasUnicode(string)) {
  14976. return castSlice(stringToArray(string), 0, limit);
  14977. }
  14978. }
  14979. return string.split(separator, limit);
  14980. }
  14981. /**
  14982. * Converts `string` to
  14983. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14984. *
  14985. * @static
  14986. * @memberOf _
  14987. * @since 3.1.0
  14988. * @category String
  14989. * @param {string} [string=''] The string to convert.
  14990. * @returns {string} Returns the start cased string.
  14991. * @example
  14992. *
  14993. * _.startCase('--foo-bar--');
  14994. * // => 'Foo Bar'
  14995. *
  14996. * _.startCase('fooBar');
  14997. * // => 'Foo Bar'
  14998. *
  14999. * _.startCase('__FOO_BAR__');
  15000. * // => 'FOO BAR'
  15001. */
  15002. var startCase = createCompounder(function(result, word, index) {
  15003. return result + (index ? ' ' : '') + upperFirst(word);
  15004. });
  15005. /**
  15006. * Checks if `string` starts with the given target string.
  15007. *
  15008. * @static
  15009. * @memberOf _
  15010. * @since 3.0.0
  15011. * @category String
  15012. * @param {string} [string=''] The string to inspect.
  15013. * @param {string} [target] The string to search for.
  15014. * @param {number} [position=0] The position to search from.
  15015. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15016. * else `false`.
  15017. * @example
  15018. *
  15019. * _.startsWith('abc', 'a');
  15020. * // => true
  15021. *
  15022. * _.startsWith('abc', 'b');
  15023. * // => false
  15024. *
  15025. * _.startsWith('abc', 'b', 1);
  15026. * // => true
  15027. */
  15028. function startsWith(string, target, position) {
  15029. string = toString(string);
  15030. position = position == null
  15031. ? 0
  15032. : baseClamp(toInteger(position), 0, string.length);
  15033. target = baseToString(target);
  15034. return string.slice(position, position + target.length) == target;
  15035. }
  15036. /**
  15037. * Creates a compiled template function that can interpolate data properties
  15038. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15039. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15040. * properties may be accessed as free variables in the template. If a setting
  15041. * object is given, it takes precedence over `_.templateSettings` values.
  15042. *
  15043. * **Note:** In the development build `_.template` utilizes
  15044. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15045. * for easier debugging.
  15046. *
  15047. * For more information on precompiling templates see
  15048. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15049. *
  15050. * For more information on Chrome extension sandboxes see
  15051. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15052. *
  15053. * @static
  15054. * @since 0.1.0
  15055. * @memberOf _
  15056. * @category String
  15057. * @param {string} [string=''] The template string.
  15058. * @param {Object} [options={}] The options object.
  15059. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15060. * The HTML "escape" delimiter.
  15061. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15062. * The "evaluate" delimiter.
  15063. * @param {Object} [options.imports=_.templateSettings.imports]
  15064. * An object to import into the template as free variables.
  15065. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15066. * The "interpolate" delimiter.
  15067. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15068. * The sourceURL of the compiled template.
  15069. * @param {string} [options.variable='obj']
  15070. * The data object variable name.
  15071. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15072. * @returns {Function} Returns the compiled template function.
  15073. * @example
  15074. *
  15075. * // Use the "interpolate" delimiter to create a compiled template.
  15076. * var compiled = _.template('hello <%= user %>!');
  15077. * compiled({ 'user': 'fred' });
  15078. * // => 'hello fred!'
  15079. *
  15080. * // Use the HTML "escape" delimiter to escape data property values.
  15081. * var compiled = _.template('<b><%- value %></b>');
  15082. * compiled({ 'value': '<script>' });
  15083. * // => '<b>&lt;script&gt;</b>'
  15084. *
  15085. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15086. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15087. * compiled({ 'users': ['fred', 'barney'] });
  15088. * // => '<li>fred</li><li>barney</li>'
  15089. *
  15090. * // Use the internal `print` function in "evaluate" delimiters.
  15091. * var compiled = _.template('<% print("hello " + user); %>!');
  15092. * compiled({ 'user': 'barney' });
  15093. * // => 'hello barney!'
  15094. *
  15095. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15096. * // Disable support by replacing the "interpolate" delimiter.
  15097. * var compiled = _.template('hello ${ user }!');
  15098. * compiled({ 'user': 'pebbles' });
  15099. * // => 'hello pebbles!'
  15100. *
  15101. * // Use backslashes to treat delimiters as plain text.
  15102. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15103. * compiled({ 'value': 'ignored' });
  15104. * // => '<%- value %>'
  15105. *
  15106. * // Use the `imports` option to import `jQuery` as `jq`.
  15107. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15108. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15109. * compiled({ 'users': ['fred', 'barney'] });
  15110. * // => '<li>fred</li><li>barney</li>'
  15111. *
  15112. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15113. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15114. * compiled(data);
  15115. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15116. *
  15117. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15118. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15119. * compiled.source;
  15120. * // => function(data) {
  15121. * // var __t, __p = '';
  15122. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15123. * // return __p;
  15124. * // }
  15125. *
  15126. * // Use custom template delimiters.
  15127. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15128. * var compiled = _.template('hello {{ user }}!');
  15129. * compiled({ 'user': 'mustache' });
  15130. * // => 'hello mustache!'
  15131. *
  15132. * // Use the `source` property to inline compiled templates for meaningful
  15133. * // line numbers in error messages and stack traces.
  15134. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15135. * var JST = {\
  15136. * "main": ' + _.template(mainText).source + '\
  15137. * };\
  15138. * ');
  15139. */
  15140. function template(string, options, guard) {
  15141. // Based on John Resig's `tmpl` implementation
  15142. // (http://ejohn.org/blog/javascript-micro-templating/)
  15143. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15144. var settings = lodash.templateSettings;
  15145. if (guard && isIterateeCall(string, options, guard)) {
  15146. options = undefined;
  15147. }
  15148. string = toString(string);
  15149. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15150. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15151. importsKeys = keys(imports),
  15152. importsValues = baseValues(imports, importsKeys);
  15153. var isEscaping,
  15154. isEvaluating,
  15155. index = 0,
  15156. interpolate = options.interpolate || reNoMatch,
  15157. source = "__p += '";
  15158. // Compile the regexp to match each delimiter.
  15159. var reDelimiters = RegExp(
  15160. (options.escape || reNoMatch).source + '|' +
  15161. interpolate.source + '|' +
  15162. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15163. (options.evaluate || reNoMatch).source + '|$'
  15164. , 'g');
  15165. // Use a sourceURL for easier debugging.
  15166. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15167. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15168. // and escape the comment, thus injecting code that gets evaled.
  15169. var sourceURL = '//# sourceURL=' +
  15170. (hasOwnProperty.call(options, 'sourceURL')
  15171. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15172. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15173. ) + '\n';
  15174. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15175. interpolateValue || (interpolateValue = esTemplateValue);
  15176. // Escape characters that can't be included in string literals.
  15177. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15178. // Replace delimiters with snippets.
  15179. if (escapeValue) {
  15180. isEscaping = true;
  15181. source += "' +\n__e(" + escapeValue + ") +\n'";
  15182. }
  15183. if (evaluateValue) {
  15184. isEvaluating = true;
  15185. source += "';\n" + evaluateValue + ";\n__p += '";
  15186. }
  15187. if (interpolateValue) {
  15188. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15189. }
  15190. index = offset + match.length;
  15191. // The JS engine embedded in Adobe products needs `match` returned in
  15192. // order to produce the correct `offset` value.
  15193. return match;
  15194. });
  15195. source += "';\n";
  15196. // If `variable` is not specified wrap a with-statement around the generated
  15197. // code to add the data object to the top of the scope chain.
  15198. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15199. if (!variable) {
  15200. source = 'with (obj) {\n' + source + '\n}\n';
  15201. }
  15202. // Throw an error if a forbidden character was found in `variable`, to prevent
  15203. // potential command injection attacks.
  15204. else if (reForbiddenIdentifierChars.test(variable)) {
  15205. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15206. }
  15207. // Cleanup code by stripping empty strings.
  15208. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15209. .replace(reEmptyStringMiddle, '$1')
  15210. .replace(reEmptyStringTrailing, '$1;');
  15211. // Frame code as the function body.
  15212. source = 'function(' + (variable || 'obj') + ') {\n' +
  15213. (variable
  15214. ? ''
  15215. : 'obj || (obj = {});\n'
  15216. ) +
  15217. "var __t, __p = ''" +
  15218. (isEscaping
  15219. ? ', __e = _.escape'
  15220. : ''
  15221. ) +
  15222. (isEvaluating
  15223. ? ', __j = Array.prototype.join;\n' +
  15224. "function print() { __p += __j.call(arguments, '') }\n"
  15225. : ';\n'
  15226. ) +
  15227. source +
  15228. 'return __p\n}';
  15229. var result = attempt(function() {
  15230. return Function(importsKeys, sourceURL + 'return ' + source)
  15231. .apply(undefined, importsValues);
  15232. });
  15233. // Provide the compiled function's source by its `toString` method or
  15234. // the `source` property as a convenience for inlining compiled templates.
  15235. result.source = source;
  15236. if (isError(result)) {
  15237. throw result;
  15238. }
  15239. return result;
  15240. }
  15241. /**
  15242. * Converts `string`, as a whole, to lower case just like
  15243. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15244. *
  15245. * @static
  15246. * @memberOf _
  15247. * @since 4.0.0
  15248. * @category String
  15249. * @param {string} [string=''] The string to convert.
  15250. * @returns {string} Returns the lower cased string.
  15251. * @example
  15252. *
  15253. * _.toLower('--Foo-Bar--');
  15254. * // => '--foo-bar--'
  15255. *
  15256. * _.toLower('fooBar');
  15257. * // => 'foobar'
  15258. *
  15259. * _.toLower('__FOO_BAR__');
  15260. * // => '__foo_bar__'
  15261. */
  15262. function toLower(value) {
  15263. return toString(value).toLowerCase();
  15264. }
  15265. /**
  15266. * Converts `string`, as a whole, to upper case just like
  15267. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15268. *
  15269. * @static
  15270. * @memberOf _
  15271. * @since 4.0.0
  15272. * @category String
  15273. * @param {string} [string=''] The string to convert.
  15274. * @returns {string} Returns the upper cased string.
  15275. * @example
  15276. *
  15277. * _.toUpper('--foo-bar--');
  15278. * // => '--FOO-BAR--'
  15279. *
  15280. * _.toUpper('fooBar');
  15281. * // => 'FOOBAR'
  15282. *
  15283. * _.toUpper('__foo_bar__');
  15284. * // => '__FOO_BAR__'
  15285. */
  15286. function toUpper(value) {
  15287. return toString(value).toUpperCase();
  15288. }
  15289. /**
  15290. * Removes leading and trailing whitespace or specified characters from `string`.
  15291. *
  15292. * @static
  15293. * @memberOf _
  15294. * @since 3.0.0
  15295. * @category String
  15296. * @param {string} [string=''] The string to trim.
  15297. * @param {string} [chars=whitespace] The characters to trim.
  15298. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15299. * @returns {string} Returns the trimmed string.
  15300. * @example
  15301. *
  15302. * _.trim(' abc ');
  15303. * // => 'abc'
  15304. *
  15305. * _.trim('-_-abc-_-', '_-');
  15306. * // => 'abc'
  15307. *
  15308. * _.map([' foo ', ' bar '], _.trim);
  15309. * // => ['foo', 'bar']
  15310. */
  15311. function trim(string, chars, guard) {
  15312. string = toString(string);
  15313. if (string && (guard || chars === undefined)) {
  15314. return baseTrim(string);
  15315. }
  15316. if (!string || !(chars = baseToString(chars))) {
  15317. return string;
  15318. }
  15319. var strSymbols = stringToArray(string),
  15320. chrSymbols = stringToArray(chars),
  15321. start = charsStartIndex(strSymbols, chrSymbols),
  15322. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15323. return castSlice(strSymbols, start, end).join('');
  15324. }
  15325. /**
  15326. * Removes trailing whitespace or specified characters from `string`.
  15327. *
  15328. * @static
  15329. * @memberOf _
  15330. * @since 4.0.0
  15331. * @category String
  15332. * @param {string} [string=''] The string to trim.
  15333. * @param {string} [chars=whitespace] The characters to trim.
  15334. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15335. * @returns {string} Returns the trimmed string.
  15336. * @example
  15337. *
  15338. * _.trimEnd(' abc ');
  15339. * // => ' abc'
  15340. *
  15341. * _.trimEnd('-_-abc-_-', '_-');
  15342. * // => '-_-abc'
  15343. */
  15344. function trimEnd(string, chars, guard) {
  15345. string = toString(string);
  15346. if (string && (guard || chars === undefined)) {
  15347. return string.slice(0, trimmedEndIndex(string) + 1);
  15348. }
  15349. if (!string || !(chars = baseToString(chars))) {
  15350. return string;
  15351. }
  15352. var strSymbols = stringToArray(string),
  15353. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15354. return castSlice(strSymbols, 0, end).join('');
  15355. }
  15356. /**
  15357. * Removes leading whitespace or specified characters from `string`.
  15358. *
  15359. * @static
  15360. * @memberOf _
  15361. * @since 4.0.0
  15362. * @category String
  15363. * @param {string} [string=''] The string to trim.
  15364. * @param {string} [chars=whitespace] The characters to trim.
  15365. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15366. * @returns {string} Returns the trimmed string.
  15367. * @example
  15368. *
  15369. * _.trimStart(' abc ');
  15370. * // => 'abc '
  15371. *
  15372. * _.trimStart('-_-abc-_-', '_-');
  15373. * // => 'abc-_-'
  15374. */
  15375. function trimStart(string, chars, guard) {
  15376. string = toString(string);
  15377. if (string && (guard || chars === undefined)) {
  15378. return string.replace(reTrimStart, '');
  15379. }
  15380. if (!string || !(chars = baseToString(chars))) {
  15381. return string;
  15382. }
  15383. var strSymbols = stringToArray(string),
  15384. start = charsStartIndex(strSymbols, stringToArray(chars));
  15385. return castSlice(strSymbols, start).join('');
  15386. }
  15387. /**
  15388. * Truncates `string` if it's longer than the given maximum string length.
  15389. * The last characters of the truncated string are replaced with the omission
  15390. * string which defaults to "...".
  15391. *
  15392. * @static
  15393. * @memberOf _
  15394. * @since 4.0.0
  15395. * @category String
  15396. * @param {string} [string=''] The string to truncate.
  15397. * @param {Object} [options={}] The options object.
  15398. * @param {number} [options.length=30] The maximum string length.
  15399. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15400. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15401. * @returns {string} Returns the truncated string.
  15402. * @example
  15403. *
  15404. * _.truncate('hi-diddly-ho there, neighborino');
  15405. * // => 'hi-diddly-ho there, neighbo...'
  15406. *
  15407. * _.truncate('hi-diddly-ho there, neighborino', {
  15408. * 'length': 24,
  15409. * 'separator': ' '
  15410. * });
  15411. * // => 'hi-diddly-ho there,...'
  15412. *
  15413. * _.truncate('hi-diddly-ho there, neighborino', {
  15414. * 'length': 24,
  15415. * 'separator': /,? +/
  15416. * });
  15417. * // => 'hi-diddly-ho there...'
  15418. *
  15419. * _.truncate('hi-diddly-ho there, neighborino', {
  15420. * 'omission': ' [...]'
  15421. * });
  15422. * // => 'hi-diddly-ho there, neig [...]'
  15423. */
  15424. function truncate(string, options) {
  15425. var length = DEFAULT_TRUNC_LENGTH,
  15426. omission = DEFAULT_TRUNC_OMISSION;
  15427. if (isObject(options)) {
  15428. var separator = 'separator' in options ? options.separator : separator;
  15429. length = 'length' in options ? toInteger(options.length) : length;
  15430. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15431. }
  15432. string = toString(string);
  15433. var strLength = string.length;
  15434. if (hasUnicode(string)) {
  15435. var strSymbols = stringToArray(string);
  15436. strLength = strSymbols.length;
  15437. }
  15438. if (length >= strLength) {
  15439. return string;
  15440. }
  15441. var end = length - stringSize(omission);
  15442. if (end < 1) {
  15443. return omission;
  15444. }
  15445. var result = strSymbols
  15446. ? castSlice(strSymbols, 0, end).join('')
  15447. : string.slice(0, end);
  15448. if (separator === undefined) {
  15449. return result + omission;
  15450. }
  15451. if (strSymbols) {
  15452. end += (result.length - end);
  15453. }
  15454. if (isRegExp(separator)) {
  15455. if (string.slice(end).search(separator)) {
  15456. var match,
  15457. substring = result;
  15458. if (!separator.global) {
  15459. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15460. }
  15461. separator.lastIndex = 0;
  15462. while ((match = separator.exec(substring))) {
  15463. var newEnd = match.index;
  15464. }
  15465. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15466. }
  15467. } else if (string.indexOf(baseToString(separator), end) != end) {
  15468. var index = result.lastIndexOf(separator);
  15469. if (index > -1) {
  15470. result = result.slice(0, index);
  15471. }
  15472. }
  15473. return result + omission;
  15474. }
  15475. /**
  15476. * The inverse of `_.escape`; this method converts the HTML entities
  15477. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15478. * their corresponding characters.
  15479. *
  15480. * **Note:** No other HTML entities are unescaped. To unescape additional
  15481. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15482. *
  15483. * @static
  15484. * @memberOf _
  15485. * @since 0.6.0
  15486. * @category String
  15487. * @param {string} [string=''] The string to unescape.
  15488. * @returns {string} Returns the unescaped string.
  15489. * @example
  15490. *
  15491. * _.unescape('fred, barney, &amp; pebbles');
  15492. * // => 'fred, barney, & pebbles'
  15493. */
  15494. function unescape(string) {
  15495. string = toString(string);
  15496. return (string && reHasEscapedHtml.test(string))
  15497. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15498. : string;
  15499. }
  15500. /**
  15501. * Converts `string`, as space separated words, to upper case.
  15502. *
  15503. * @static
  15504. * @memberOf _
  15505. * @since 4.0.0
  15506. * @category String
  15507. * @param {string} [string=''] The string to convert.
  15508. * @returns {string} Returns the upper cased string.
  15509. * @example
  15510. *
  15511. * _.upperCase('--foo-bar');
  15512. * // => 'FOO BAR'
  15513. *
  15514. * _.upperCase('fooBar');
  15515. * // => 'FOO BAR'
  15516. *
  15517. * _.upperCase('__foo_bar__');
  15518. * // => 'FOO BAR'
  15519. */
  15520. var upperCase = createCompounder(function(result, word, index) {
  15521. return result + (index ? ' ' : '') + word.toUpperCase();
  15522. });
  15523. /**
  15524. * Converts the first character of `string` to upper case.
  15525. *
  15526. * @static
  15527. * @memberOf _
  15528. * @since 4.0.0
  15529. * @category String
  15530. * @param {string} [string=''] The string to convert.
  15531. * @returns {string} Returns the converted string.
  15532. * @example
  15533. *
  15534. * _.upperFirst('fred');
  15535. * // => 'Fred'
  15536. *
  15537. * _.upperFirst('FRED');
  15538. * // => 'FRED'
  15539. */
  15540. var upperFirst = createCaseFirst('toUpperCase');
  15541. /**
  15542. * Splits `string` into an array of its words.
  15543. *
  15544. * @static
  15545. * @memberOf _
  15546. * @since 3.0.0
  15547. * @category String
  15548. * @param {string} [string=''] The string to inspect.
  15549. * @param {RegExp|string} [pattern] The pattern to match words.
  15550. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15551. * @returns {Array} Returns the words of `string`.
  15552. * @example
  15553. *
  15554. * _.words('fred, barney, & pebbles');
  15555. * // => ['fred', 'barney', 'pebbles']
  15556. *
  15557. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15558. * // => ['fred', 'barney', '&', 'pebbles']
  15559. */
  15560. function words(string, pattern, guard) {
  15561. string = toString(string);
  15562. pattern = guard ? undefined : pattern;
  15563. if (pattern === undefined) {
  15564. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15565. }
  15566. return string.match(pattern) || [];
  15567. }
  15568. /*------------------------------------------------------------------------*/
  15569. /**
  15570. * Attempts to invoke `func`, returning either the result or the caught error
  15571. * object. Any additional arguments are provided to `func` when it's invoked.
  15572. *
  15573. * @static
  15574. * @memberOf _
  15575. * @since 3.0.0
  15576. * @category Util
  15577. * @param {Function} func The function to attempt.
  15578. * @param {...*} [args] The arguments to invoke `func` with.
  15579. * @returns {*} Returns the `func` result or error object.
  15580. * @example
  15581. *
  15582. * // Avoid throwing errors for invalid selectors.
  15583. * var elements = _.attempt(function(selector) {
  15584. * return document.querySelectorAll(selector);
  15585. * }, '>_>');
  15586. *
  15587. * if (_.isError(elements)) {
  15588. * elements = [];
  15589. * }
  15590. */
  15591. var attempt = baseRest(function(func, args) {
  15592. try {
  15593. return apply(func, undefined, args);
  15594. } catch (e) {
  15595. return isError(e) ? e : new Error(e);
  15596. }
  15597. });
  15598. /**
  15599. * Binds methods of an object to the object itself, overwriting the existing
  15600. * method.
  15601. *
  15602. * **Note:** This method doesn't set the "length" property of bound functions.
  15603. *
  15604. * @static
  15605. * @since 0.1.0
  15606. * @memberOf _
  15607. * @category Util
  15608. * @param {Object} object The object to bind and assign the bound methods to.
  15609. * @param {...(string|string[])} methodNames The object method names to bind.
  15610. * @returns {Object} Returns `object`.
  15611. * @example
  15612. *
  15613. * var view = {
  15614. * 'label': 'docs',
  15615. * 'click': function() {
  15616. * console.log('clicked ' + this.label);
  15617. * }
  15618. * };
  15619. *
  15620. * _.bindAll(view, ['click']);
  15621. * jQuery(element).on('click', view.click);
  15622. * // => Logs 'clicked docs' when clicked.
  15623. */
  15624. var bindAll = flatRest(function(object, methodNames) {
  15625. arrayEach(methodNames, function(key) {
  15626. key = toKey(key);
  15627. baseAssignValue(object, key, bind(object[key], object));
  15628. });
  15629. return object;
  15630. });
  15631. /**
  15632. * Creates a function that iterates over `pairs` and invokes the corresponding
  15633. * function of the first predicate to return truthy. The predicate-function
  15634. * pairs are invoked with the `this` binding and arguments of the created
  15635. * function.
  15636. *
  15637. * @static
  15638. * @memberOf _
  15639. * @since 4.0.0
  15640. * @category Util
  15641. * @param {Array} pairs The predicate-function pairs.
  15642. * @returns {Function} Returns the new composite function.
  15643. * @example
  15644. *
  15645. * var func = _.cond([
  15646. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15647. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15648. * [_.stubTrue, _.constant('no match')]
  15649. * ]);
  15650. *
  15651. * func({ 'a': 1, 'b': 2 });
  15652. * // => 'matches A'
  15653. *
  15654. * func({ 'a': 0, 'b': 1 });
  15655. * // => 'matches B'
  15656. *
  15657. * func({ 'a': '1', 'b': '2' });
  15658. * // => 'no match'
  15659. */
  15660. function cond(pairs) {
  15661. var length = pairs == null ? 0 : pairs.length,
  15662. toIteratee = getIteratee();
  15663. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15664. if (typeof pair[1] != 'function') {
  15665. throw new TypeError(FUNC_ERROR_TEXT);
  15666. }
  15667. return [toIteratee(pair[0]), pair[1]];
  15668. });
  15669. return baseRest(function(args) {
  15670. var index = -1;
  15671. while (++index < length) {
  15672. var pair = pairs[index];
  15673. if (apply(pair[0], this, args)) {
  15674. return apply(pair[1], this, args);
  15675. }
  15676. }
  15677. });
  15678. }
  15679. /**
  15680. * Creates a function that invokes the predicate properties of `source` with
  15681. * the corresponding property values of a given object, returning `true` if
  15682. * all predicates return truthy, else `false`.
  15683. *
  15684. * **Note:** The created function is equivalent to `_.conformsTo` with
  15685. * `source` partially applied.
  15686. *
  15687. * @static
  15688. * @memberOf _
  15689. * @since 4.0.0
  15690. * @category Util
  15691. * @param {Object} source The object of property predicates to conform to.
  15692. * @returns {Function} Returns the new spec function.
  15693. * @example
  15694. *
  15695. * var objects = [
  15696. * { 'a': 2, 'b': 1 },
  15697. * { 'a': 1, 'b': 2 }
  15698. * ];
  15699. *
  15700. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15701. * // => [{ 'a': 1, 'b': 2 }]
  15702. */
  15703. function conforms(source) {
  15704. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15705. }
  15706. /**
  15707. * Creates a function that returns `value`.
  15708. *
  15709. * @static
  15710. * @memberOf _
  15711. * @since 2.4.0
  15712. * @category Util
  15713. * @param {*} value The value to return from the new function.
  15714. * @returns {Function} Returns the new constant function.
  15715. * @example
  15716. *
  15717. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15718. *
  15719. * console.log(objects);
  15720. * // => [{ 'a': 1 }, { 'a': 1 }]
  15721. *
  15722. * console.log(objects[0] === objects[1]);
  15723. * // => true
  15724. */
  15725. function constant(value) {
  15726. return function() {
  15727. return value;
  15728. };
  15729. }
  15730. /**
  15731. * Checks `value` to determine whether a default value should be returned in
  15732. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15733. * or `undefined`.
  15734. *
  15735. * @static
  15736. * @memberOf _
  15737. * @since 4.14.0
  15738. * @category Util
  15739. * @param {*} value The value to check.
  15740. * @param {*} defaultValue The default value.
  15741. * @returns {*} Returns the resolved value.
  15742. * @example
  15743. *
  15744. * _.defaultTo(1, 10);
  15745. * // => 1
  15746. *
  15747. * _.defaultTo(undefined, 10);
  15748. * // => 10
  15749. */
  15750. function defaultTo(value, defaultValue) {
  15751. return (value == null || value !== value) ? defaultValue : value;
  15752. }
  15753. /**
  15754. * Creates a function that returns the result of invoking the given functions
  15755. * with the `this` binding of the created function, where each successive
  15756. * invocation is supplied the return value of the previous.
  15757. *
  15758. * @static
  15759. * @memberOf _
  15760. * @since 3.0.0
  15761. * @category Util
  15762. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15763. * @returns {Function} Returns the new composite function.
  15764. * @see _.flowRight
  15765. * @example
  15766. *
  15767. * function square(n) {
  15768. * return n * n;
  15769. * }
  15770. *
  15771. * var addSquare = _.flow([_.add, square]);
  15772. * addSquare(1, 2);
  15773. * // => 9
  15774. */
  15775. var flow = createFlow();
  15776. /**
  15777. * This method is like `_.flow` except that it creates a function that
  15778. * invokes the given functions from right to left.
  15779. *
  15780. * @static
  15781. * @since 3.0.0
  15782. * @memberOf _
  15783. * @category Util
  15784. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15785. * @returns {Function} Returns the new composite function.
  15786. * @see _.flow
  15787. * @example
  15788. *
  15789. * function square(n) {
  15790. * return n * n;
  15791. * }
  15792. *
  15793. * var addSquare = _.flowRight([square, _.add]);
  15794. * addSquare(1, 2);
  15795. * // => 9
  15796. */
  15797. var flowRight = createFlow(true);
  15798. /**
  15799. * This method returns the first argument it receives.
  15800. *
  15801. * @static
  15802. * @since 0.1.0
  15803. * @memberOf _
  15804. * @category Util
  15805. * @param {*} value Any value.
  15806. * @returns {*} Returns `value`.
  15807. * @example
  15808. *
  15809. * var object = { 'a': 1 };
  15810. *
  15811. * console.log(_.identity(object) === object);
  15812. * // => true
  15813. */
  15814. function identity(value) {
  15815. return value;
  15816. }
  15817. /**
  15818. * Creates a function that invokes `func` with the arguments of the created
  15819. * function. If `func` is a property name, the created function returns the
  15820. * property value for a given element. If `func` is an array or object, the
  15821. * created function returns `true` for elements that contain the equivalent
  15822. * source properties, otherwise it returns `false`.
  15823. *
  15824. * @static
  15825. * @since 4.0.0
  15826. * @memberOf _
  15827. * @category Util
  15828. * @param {*} [func=_.identity] The value to convert to a callback.
  15829. * @returns {Function} Returns the callback.
  15830. * @example
  15831. *
  15832. * var users = [
  15833. * { 'user': 'barney', 'age': 36, 'active': true },
  15834. * { 'user': 'fred', 'age': 40, 'active': false }
  15835. * ];
  15836. *
  15837. * // The `_.matches` iteratee shorthand.
  15838. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15839. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15840. *
  15841. * // The `_.matchesProperty` iteratee shorthand.
  15842. * _.filter(users, _.iteratee(['user', 'fred']));
  15843. * // => [{ 'user': 'fred', 'age': 40 }]
  15844. *
  15845. * // The `_.property` iteratee shorthand.
  15846. * _.map(users, _.iteratee('user'));
  15847. * // => ['barney', 'fred']
  15848. *
  15849. * // Create custom iteratee shorthands.
  15850. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15851. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15852. * return func.test(string);
  15853. * };
  15854. * });
  15855. *
  15856. * _.filter(['abc', 'def'], /ef/);
  15857. * // => ['def']
  15858. */
  15859. function iteratee(func) {
  15860. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15861. }
  15862. /**
  15863. * Creates a function that performs a partial deep comparison between a given
  15864. * object and `source`, returning `true` if the given object has equivalent
  15865. * property values, else `false`.
  15866. *
  15867. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15868. * partially applied.
  15869. *
  15870. * Partial comparisons will match empty array and empty object `source`
  15871. * values against any array or object value, respectively. See `_.isEqual`
  15872. * for a list of supported value comparisons.
  15873. *
  15874. * **Note:** Multiple values can be checked by combining several matchers
  15875. * using `_.overSome`
  15876. *
  15877. * @static
  15878. * @memberOf _
  15879. * @since 3.0.0
  15880. * @category Util
  15881. * @param {Object} source The object of property values to match.
  15882. * @returns {Function} Returns the new spec function.
  15883. * @example
  15884. *
  15885. * var objects = [
  15886. * { 'a': 1, 'b': 2, 'c': 3 },
  15887. * { 'a': 4, 'b': 5, 'c': 6 }
  15888. * ];
  15889. *
  15890. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15891. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15892. *
  15893. * // Checking for several possible values
  15894. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15895. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15896. */
  15897. function matches(source) {
  15898. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15899. }
  15900. /**
  15901. * Creates a function that performs a partial deep comparison between the
  15902. * value at `path` of a given object to `srcValue`, returning `true` if the
  15903. * object value is equivalent, else `false`.
  15904. *
  15905. * **Note:** Partial comparisons will match empty array and empty object
  15906. * `srcValue` values against any array or object value, respectively. See
  15907. * `_.isEqual` for a list of supported value comparisons.
  15908. *
  15909. * **Note:** Multiple values can be checked by combining several matchers
  15910. * using `_.overSome`
  15911. *
  15912. * @static
  15913. * @memberOf _
  15914. * @since 3.2.0
  15915. * @category Util
  15916. * @param {Array|string} path The path of the property to get.
  15917. * @param {*} srcValue The value to match.
  15918. * @returns {Function} Returns the new spec function.
  15919. * @example
  15920. *
  15921. * var objects = [
  15922. * { 'a': 1, 'b': 2, 'c': 3 },
  15923. * { 'a': 4, 'b': 5, 'c': 6 }
  15924. * ];
  15925. *
  15926. * _.find(objects, _.matchesProperty('a', 4));
  15927. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15928. *
  15929. * // Checking for several possible values
  15930. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15931. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15932. */
  15933. function matchesProperty(path, srcValue) {
  15934. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15935. }
  15936. /**
  15937. * Creates a function that invokes the method at `path` of a given object.
  15938. * Any additional arguments are provided to the invoked method.
  15939. *
  15940. * @static
  15941. * @memberOf _
  15942. * @since 3.7.0
  15943. * @category Util
  15944. * @param {Array|string} path The path of the method to invoke.
  15945. * @param {...*} [args] The arguments to invoke the method with.
  15946. * @returns {Function} Returns the new invoker function.
  15947. * @example
  15948. *
  15949. * var objects = [
  15950. * { 'a': { 'b': _.constant(2) } },
  15951. * { 'a': { 'b': _.constant(1) } }
  15952. * ];
  15953. *
  15954. * _.map(objects, _.method('a.b'));
  15955. * // => [2, 1]
  15956. *
  15957. * _.map(objects, _.method(['a', 'b']));
  15958. * // => [2, 1]
  15959. */
  15960. var method = baseRest(function(path, args) {
  15961. return function(object) {
  15962. return baseInvoke(object, path, args);
  15963. };
  15964. });
  15965. /**
  15966. * The opposite of `_.method`; this method creates a function that invokes
  15967. * the method at a given path of `object`. Any additional arguments are
  15968. * provided to the invoked method.
  15969. *
  15970. * @static
  15971. * @memberOf _
  15972. * @since 3.7.0
  15973. * @category Util
  15974. * @param {Object} object The object to query.
  15975. * @param {...*} [args] The arguments to invoke the method with.
  15976. * @returns {Function} Returns the new invoker function.
  15977. * @example
  15978. *
  15979. * var array = _.times(3, _.constant),
  15980. * object = { 'a': array, 'b': array, 'c': array };
  15981. *
  15982. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15983. * // => [2, 0]
  15984. *
  15985. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15986. * // => [2, 0]
  15987. */
  15988. var methodOf = baseRest(function(object, args) {
  15989. return function(path) {
  15990. return baseInvoke(object, path, args);
  15991. };
  15992. });
  15993. /**
  15994. * Adds all own enumerable string keyed function properties of a source
  15995. * object to the destination object. If `object` is a function, then methods
  15996. * are added to its prototype as well.
  15997. *
  15998. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15999. * avoid conflicts caused by modifying the original.
  16000. *
  16001. * @static
  16002. * @since 0.1.0
  16003. * @memberOf _
  16004. * @category Util
  16005. * @param {Function|Object} [object=lodash] The destination object.
  16006. * @param {Object} source The object of functions to add.
  16007. * @param {Object} [options={}] The options object.
  16008. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16009. * @returns {Function|Object} Returns `object`.
  16010. * @example
  16011. *
  16012. * function vowels(string) {
  16013. * return _.filter(string, function(v) {
  16014. * return /[aeiou]/i.test(v);
  16015. * });
  16016. * }
  16017. *
  16018. * _.mixin({ 'vowels': vowels });
  16019. * _.vowels('fred');
  16020. * // => ['e']
  16021. *
  16022. * _('fred').vowels().value();
  16023. * // => ['e']
  16024. *
  16025. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16026. * _('fred').vowels();
  16027. * // => ['e']
  16028. */
  16029. function mixin(object, source, options) {
  16030. var props = keys(source),
  16031. methodNames = baseFunctions(source, props);
  16032. if (options == null &&
  16033. !(isObject(source) && (methodNames.length || !props.length))) {
  16034. options = source;
  16035. source = object;
  16036. object = this;
  16037. methodNames = baseFunctions(source, keys(source));
  16038. }
  16039. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16040. isFunc = isFunction(object);
  16041. arrayEach(methodNames, function(methodName) {
  16042. var func = source[methodName];
  16043. object[methodName] = func;
  16044. if (isFunc) {
  16045. object.prototype[methodName] = function() {
  16046. var chainAll = this.__chain__;
  16047. if (chain || chainAll) {
  16048. var result = object(this.__wrapped__),
  16049. actions = result.__actions__ = copyArray(this.__actions__);
  16050. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16051. result.__chain__ = chainAll;
  16052. return result;
  16053. }
  16054. return func.apply(object, arrayPush([this.value()], arguments));
  16055. };
  16056. }
  16057. });
  16058. return object;
  16059. }
  16060. /**
  16061. * Reverts the `_` variable to its previous value and returns a reference to
  16062. * the `lodash` function.
  16063. *
  16064. * @static
  16065. * @since 0.1.0
  16066. * @memberOf _
  16067. * @category Util
  16068. * @returns {Function} Returns the `lodash` function.
  16069. * @example
  16070. *
  16071. * var lodash = _.noConflict();
  16072. */
  16073. function noConflict() {
  16074. if (root._ === this) {
  16075. root._ = oldDash;
  16076. }
  16077. return this;
  16078. }
  16079. /**
  16080. * This method returns `undefined`.
  16081. *
  16082. * @static
  16083. * @memberOf _
  16084. * @since 2.3.0
  16085. * @category Util
  16086. * @example
  16087. *
  16088. * _.times(2, _.noop);
  16089. * // => [undefined, undefined]
  16090. */
  16091. function noop() {
  16092. // No operation performed.
  16093. }
  16094. /**
  16095. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16096. * the nth argument from the end is returned.
  16097. *
  16098. * @static
  16099. * @memberOf _
  16100. * @since 4.0.0
  16101. * @category Util
  16102. * @param {number} [n=0] The index of the argument to return.
  16103. * @returns {Function} Returns the new pass-thru function.
  16104. * @example
  16105. *
  16106. * var func = _.nthArg(1);
  16107. * func('a', 'b', 'c', 'd');
  16108. * // => 'b'
  16109. *
  16110. * var func = _.nthArg(-2);
  16111. * func('a', 'b', 'c', 'd');
  16112. * // => 'c'
  16113. */
  16114. function nthArg(n) {
  16115. n = toInteger(n);
  16116. return baseRest(function(args) {
  16117. return baseNth(args, n);
  16118. });
  16119. }
  16120. /**
  16121. * Creates a function that invokes `iteratees` with the arguments it receives
  16122. * and returns their results.
  16123. *
  16124. * @static
  16125. * @memberOf _
  16126. * @since 4.0.0
  16127. * @category Util
  16128. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16129. * The iteratees to invoke.
  16130. * @returns {Function} Returns the new function.
  16131. * @example
  16132. *
  16133. * var func = _.over([Math.max, Math.min]);
  16134. *
  16135. * func(1, 2, 3, 4);
  16136. * // => [4, 1]
  16137. */
  16138. var over = createOver(arrayMap);
  16139. /**
  16140. * Creates a function that checks if **all** of the `predicates` return
  16141. * truthy when invoked with the arguments it receives.
  16142. *
  16143. * Following shorthands are possible for providing predicates.
  16144. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16145. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16146. *
  16147. * @static
  16148. * @memberOf _
  16149. * @since 4.0.0
  16150. * @category Util
  16151. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16152. * The predicates to check.
  16153. * @returns {Function} Returns the new function.
  16154. * @example
  16155. *
  16156. * var func = _.overEvery([Boolean, isFinite]);
  16157. *
  16158. * func('1');
  16159. * // => true
  16160. *
  16161. * func(null);
  16162. * // => false
  16163. *
  16164. * func(NaN);
  16165. * // => false
  16166. */
  16167. var overEvery = createOver(arrayEvery);
  16168. /**
  16169. * Creates a function that checks if **any** of the `predicates` return
  16170. * truthy when invoked with the arguments it receives.
  16171. *
  16172. * Following shorthands are possible for providing predicates.
  16173. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16174. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16175. *
  16176. * @static
  16177. * @memberOf _
  16178. * @since 4.0.0
  16179. * @category Util
  16180. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16181. * The predicates to check.
  16182. * @returns {Function} Returns the new function.
  16183. * @example
  16184. *
  16185. * var func = _.overSome([Boolean, isFinite]);
  16186. *
  16187. * func('1');
  16188. * // => true
  16189. *
  16190. * func(null);
  16191. * // => true
  16192. *
  16193. * func(NaN);
  16194. * // => false
  16195. *
  16196. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16197. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16198. */
  16199. var overSome = createOver(arraySome);
  16200. /**
  16201. * Creates a function that returns the value at `path` of a given object.
  16202. *
  16203. * @static
  16204. * @memberOf _
  16205. * @since 2.4.0
  16206. * @category Util
  16207. * @param {Array|string} path The path of the property to get.
  16208. * @returns {Function} Returns the new accessor function.
  16209. * @example
  16210. *
  16211. * var objects = [
  16212. * { 'a': { 'b': 2 } },
  16213. * { 'a': { 'b': 1 } }
  16214. * ];
  16215. *
  16216. * _.map(objects, _.property('a.b'));
  16217. * // => [2, 1]
  16218. *
  16219. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16220. * // => [1, 2]
  16221. */
  16222. function property(path) {
  16223. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16224. }
  16225. /**
  16226. * The opposite of `_.property`; this method creates a function that returns
  16227. * the value at a given path of `object`.
  16228. *
  16229. * @static
  16230. * @memberOf _
  16231. * @since 3.0.0
  16232. * @category Util
  16233. * @param {Object} object The object to query.
  16234. * @returns {Function} Returns the new accessor function.
  16235. * @example
  16236. *
  16237. * var array = [0, 1, 2],
  16238. * object = { 'a': array, 'b': array, 'c': array };
  16239. *
  16240. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16241. * // => [2, 0]
  16242. *
  16243. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16244. * // => [2, 0]
  16245. */
  16246. function propertyOf(object) {
  16247. return function(path) {
  16248. return object == null ? undefined : baseGet(object, path);
  16249. };
  16250. }
  16251. /**
  16252. * Creates an array of numbers (positive and/or negative) progressing from
  16253. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16254. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16255. * it's set to `start` with `start` then set to `0`.
  16256. *
  16257. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16258. * floating-point values which can produce unexpected results.
  16259. *
  16260. * @static
  16261. * @since 0.1.0
  16262. * @memberOf _
  16263. * @category Util
  16264. * @param {number} [start=0] The start of the range.
  16265. * @param {number} end The end of the range.
  16266. * @param {number} [step=1] The value to increment or decrement by.
  16267. * @returns {Array} Returns the range of numbers.
  16268. * @see _.inRange, _.rangeRight
  16269. * @example
  16270. *
  16271. * _.range(4);
  16272. * // => [0, 1, 2, 3]
  16273. *
  16274. * _.range(-4);
  16275. * // => [0, -1, -2, -3]
  16276. *
  16277. * _.range(1, 5);
  16278. * // => [1, 2, 3, 4]
  16279. *
  16280. * _.range(0, 20, 5);
  16281. * // => [0, 5, 10, 15]
  16282. *
  16283. * _.range(0, -4, -1);
  16284. * // => [0, -1, -2, -3]
  16285. *
  16286. * _.range(1, 4, 0);
  16287. * // => [1, 1, 1]
  16288. *
  16289. * _.range(0);
  16290. * // => []
  16291. */
  16292. var range = createRange();
  16293. /**
  16294. * This method is like `_.range` except that it populates values in
  16295. * descending order.
  16296. *
  16297. * @static
  16298. * @memberOf _
  16299. * @since 4.0.0
  16300. * @category Util
  16301. * @param {number} [start=0] The start of the range.
  16302. * @param {number} end The end of the range.
  16303. * @param {number} [step=1] The value to increment or decrement by.
  16304. * @returns {Array} Returns the range of numbers.
  16305. * @see _.inRange, _.range
  16306. * @example
  16307. *
  16308. * _.rangeRight(4);
  16309. * // => [3, 2, 1, 0]
  16310. *
  16311. * _.rangeRight(-4);
  16312. * // => [-3, -2, -1, 0]
  16313. *
  16314. * _.rangeRight(1, 5);
  16315. * // => [4, 3, 2, 1]
  16316. *
  16317. * _.rangeRight(0, 20, 5);
  16318. * // => [15, 10, 5, 0]
  16319. *
  16320. * _.rangeRight(0, -4, -1);
  16321. * // => [-3, -2, -1, 0]
  16322. *
  16323. * _.rangeRight(1, 4, 0);
  16324. * // => [1, 1, 1]
  16325. *
  16326. * _.rangeRight(0);
  16327. * // => []
  16328. */
  16329. var rangeRight = createRange(true);
  16330. /**
  16331. * This method returns a new empty array.
  16332. *
  16333. * @static
  16334. * @memberOf _
  16335. * @since 4.13.0
  16336. * @category Util
  16337. * @returns {Array} Returns the new empty array.
  16338. * @example
  16339. *
  16340. * var arrays = _.times(2, _.stubArray);
  16341. *
  16342. * console.log(arrays);
  16343. * // => [[], []]
  16344. *
  16345. * console.log(arrays[0] === arrays[1]);
  16346. * // => false
  16347. */
  16348. function stubArray() {
  16349. return [];
  16350. }
  16351. /**
  16352. * This method returns `false`.
  16353. *
  16354. * @static
  16355. * @memberOf _
  16356. * @since 4.13.0
  16357. * @category Util
  16358. * @returns {boolean} Returns `false`.
  16359. * @example
  16360. *
  16361. * _.times(2, _.stubFalse);
  16362. * // => [false, false]
  16363. */
  16364. function stubFalse() {
  16365. return false;
  16366. }
  16367. /**
  16368. * This method returns a new empty object.
  16369. *
  16370. * @static
  16371. * @memberOf _
  16372. * @since 4.13.0
  16373. * @category Util
  16374. * @returns {Object} Returns the new empty object.
  16375. * @example
  16376. *
  16377. * var objects = _.times(2, _.stubObject);
  16378. *
  16379. * console.log(objects);
  16380. * // => [{}, {}]
  16381. *
  16382. * console.log(objects[0] === objects[1]);
  16383. * // => false
  16384. */
  16385. function stubObject() {
  16386. return {};
  16387. }
  16388. /**
  16389. * This method returns an empty string.
  16390. *
  16391. * @static
  16392. * @memberOf _
  16393. * @since 4.13.0
  16394. * @category Util
  16395. * @returns {string} Returns the empty string.
  16396. * @example
  16397. *
  16398. * _.times(2, _.stubString);
  16399. * // => ['', '']
  16400. */
  16401. function stubString() {
  16402. return '';
  16403. }
  16404. /**
  16405. * This method returns `true`.
  16406. *
  16407. * @static
  16408. * @memberOf _
  16409. * @since 4.13.0
  16410. * @category Util
  16411. * @returns {boolean} Returns `true`.
  16412. * @example
  16413. *
  16414. * _.times(2, _.stubTrue);
  16415. * // => [true, true]
  16416. */
  16417. function stubTrue() {
  16418. return true;
  16419. }
  16420. /**
  16421. * Invokes the iteratee `n` times, returning an array of the results of
  16422. * each invocation. The iteratee is invoked with one argument; (index).
  16423. *
  16424. * @static
  16425. * @since 0.1.0
  16426. * @memberOf _
  16427. * @category Util
  16428. * @param {number} n The number of times to invoke `iteratee`.
  16429. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16430. * @returns {Array} Returns the array of results.
  16431. * @example
  16432. *
  16433. * _.times(3, String);
  16434. * // => ['0', '1', '2']
  16435. *
  16436. * _.times(4, _.constant(0));
  16437. * // => [0, 0, 0, 0]
  16438. */
  16439. function times(n, iteratee) {
  16440. n = toInteger(n);
  16441. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16442. return [];
  16443. }
  16444. var index = MAX_ARRAY_LENGTH,
  16445. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16446. iteratee = getIteratee(iteratee);
  16447. n -= MAX_ARRAY_LENGTH;
  16448. var result = baseTimes(length, iteratee);
  16449. while (++index < n) {
  16450. iteratee(index);
  16451. }
  16452. return result;
  16453. }
  16454. /**
  16455. * Converts `value` to a property path array.
  16456. *
  16457. * @static
  16458. * @memberOf _
  16459. * @since 4.0.0
  16460. * @category Util
  16461. * @param {*} value The value to convert.
  16462. * @returns {Array} Returns the new property path array.
  16463. * @example
  16464. *
  16465. * _.toPath('a.b.c');
  16466. * // => ['a', 'b', 'c']
  16467. *
  16468. * _.toPath('a[0].b.c');
  16469. * // => ['a', '0', 'b', 'c']
  16470. */
  16471. function toPath(value) {
  16472. if (isArray(value)) {
  16473. return arrayMap(value, toKey);
  16474. }
  16475. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16476. }
  16477. /**
  16478. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16479. *
  16480. * @static
  16481. * @since 0.1.0
  16482. * @memberOf _
  16483. * @category Util
  16484. * @param {string} [prefix=''] The value to prefix the ID with.
  16485. * @returns {string} Returns the unique ID.
  16486. * @example
  16487. *
  16488. * _.uniqueId('contact_');
  16489. * // => 'contact_104'
  16490. *
  16491. * _.uniqueId();
  16492. * // => '105'
  16493. */
  16494. function uniqueId(prefix) {
  16495. var id = ++idCounter;
  16496. return toString(prefix) + id;
  16497. }
  16498. /*------------------------------------------------------------------------*/
  16499. /**
  16500. * Adds two numbers.
  16501. *
  16502. * @static
  16503. * @memberOf _
  16504. * @since 3.4.0
  16505. * @category Math
  16506. * @param {number} augend The first number in an addition.
  16507. * @param {number} addend The second number in an addition.
  16508. * @returns {number} Returns the total.
  16509. * @example
  16510. *
  16511. * _.add(6, 4);
  16512. * // => 10
  16513. */
  16514. var add = createMathOperation(function(augend, addend) {
  16515. return augend + addend;
  16516. }, 0);
  16517. /**
  16518. * Computes `number` rounded up to `precision`.
  16519. *
  16520. * @static
  16521. * @memberOf _
  16522. * @since 3.10.0
  16523. * @category Math
  16524. * @param {number} number The number to round up.
  16525. * @param {number} [precision=0] The precision to round up to.
  16526. * @returns {number} Returns the rounded up number.
  16527. * @example
  16528. *
  16529. * _.ceil(4.006);
  16530. * // => 5
  16531. *
  16532. * _.ceil(6.004, 2);
  16533. * // => 6.01
  16534. *
  16535. * _.ceil(6040, -2);
  16536. * // => 6100
  16537. */
  16538. var ceil = createRound('ceil');
  16539. /**
  16540. * Divide two numbers.
  16541. *
  16542. * @static
  16543. * @memberOf _
  16544. * @since 4.7.0
  16545. * @category Math
  16546. * @param {number} dividend The first number in a division.
  16547. * @param {number} divisor The second number in a division.
  16548. * @returns {number} Returns the quotient.
  16549. * @example
  16550. *
  16551. * _.divide(6, 4);
  16552. * // => 1.5
  16553. */
  16554. var divide = createMathOperation(function(dividend, divisor) {
  16555. return dividend / divisor;
  16556. }, 1);
  16557. /**
  16558. * Computes `number` rounded down to `precision`.
  16559. *
  16560. * @static
  16561. * @memberOf _
  16562. * @since 3.10.0
  16563. * @category Math
  16564. * @param {number} number The number to round down.
  16565. * @param {number} [precision=0] The precision to round down to.
  16566. * @returns {number} Returns the rounded down number.
  16567. * @example
  16568. *
  16569. * _.floor(4.006);
  16570. * // => 4
  16571. *
  16572. * _.floor(0.046, 2);
  16573. * // => 0.04
  16574. *
  16575. * _.floor(4060, -2);
  16576. * // => 4000
  16577. */
  16578. var floor = createRound('floor');
  16579. /**
  16580. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16581. * `undefined` is returned.
  16582. *
  16583. * @static
  16584. * @since 0.1.0
  16585. * @memberOf _
  16586. * @category Math
  16587. * @param {Array} array The array to iterate over.
  16588. * @returns {*} Returns the maximum value.
  16589. * @example
  16590. *
  16591. * _.max([4, 2, 8, 6]);
  16592. * // => 8
  16593. *
  16594. * _.max([]);
  16595. * // => undefined
  16596. */
  16597. function max(array) {
  16598. return (array && array.length)
  16599. ? baseExtremum(array, identity, baseGt)
  16600. : undefined;
  16601. }
  16602. /**
  16603. * This method is like `_.max` except that it accepts `iteratee` which is
  16604. * invoked for each element in `array` to generate the criterion by which
  16605. * the value is ranked. The iteratee is invoked with one argument: (value).
  16606. *
  16607. * @static
  16608. * @memberOf _
  16609. * @since 4.0.0
  16610. * @category Math
  16611. * @param {Array} array The array to iterate over.
  16612. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16613. * @returns {*} Returns the maximum value.
  16614. * @example
  16615. *
  16616. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16617. *
  16618. * _.maxBy(objects, function(o) { return o.n; });
  16619. * // => { 'n': 2 }
  16620. *
  16621. * // The `_.property` iteratee shorthand.
  16622. * _.maxBy(objects, 'n');
  16623. * // => { 'n': 2 }
  16624. */
  16625. function maxBy(array, iteratee) {
  16626. return (array && array.length)
  16627. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16628. : undefined;
  16629. }
  16630. /**
  16631. * Computes the mean of the values in `array`.
  16632. *
  16633. * @static
  16634. * @memberOf _
  16635. * @since 4.0.0
  16636. * @category Math
  16637. * @param {Array} array The array to iterate over.
  16638. * @returns {number} Returns the mean.
  16639. * @example
  16640. *
  16641. * _.mean([4, 2, 8, 6]);
  16642. * // => 5
  16643. */
  16644. function mean(array) {
  16645. return baseMean(array, identity);
  16646. }
  16647. /**
  16648. * This method is like `_.mean` except that it accepts `iteratee` which is
  16649. * invoked for each element in `array` to generate the value to be averaged.
  16650. * The iteratee is invoked with one argument: (value).
  16651. *
  16652. * @static
  16653. * @memberOf _
  16654. * @since 4.7.0
  16655. * @category Math
  16656. * @param {Array} array The array to iterate over.
  16657. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16658. * @returns {number} Returns the mean.
  16659. * @example
  16660. *
  16661. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16662. *
  16663. * _.meanBy(objects, function(o) { return o.n; });
  16664. * // => 5
  16665. *
  16666. * // The `_.property` iteratee shorthand.
  16667. * _.meanBy(objects, 'n');
  16668. * // => 5
  16669. */
  16670. function meanBy(array, iteratee) {
  16671. return baseMean(array, getIteratee(iteratee, 2));
  16672. }
  16673. /**
  16674. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16675. * `undefined` is returned.
  16676. *
  16677. * @static
  16678. * @since 0.1.0
  16679. * @memberOf _
  16680. * @category Math
  16681. * @param {Array} array The array to iterate over.
  16682. * @returns {*} Returns the minimum value.
  16683. * @example
  16684. *
  16685. * _.min([4, 2, 8, 6]);
  16686. * // => 2
  16687. *
  16688. * _.min([]);
  16689. * // => undefined
  16690. */
  16691. function min(array) {
  16692. return (array && array.length)
  16693. ? baseExtremum(array, identity, baseLt)
  16694. : undefined;
  16695. }
  16696. /**
  16697. * This method is like `_.min` except that it accepts `iteratee` which is
  16698. * invoked for each element in `array` to generate the criterion by which
  16699. * the value is ranked. The iteratee is invoked with one argument: (value).
  16700. *
  16701. * @static
  16702. * @memberOf _
  16703. * @since 4.0.0
  16704. * @category Math
  16705. * @param {Array} array The array to iterate over.
  16706. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16707. * @returns {*} Returns the minimum value.
  16708. * @example
  16709. *
  16710. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16711. *
  16712. * _.minBy(objects, function(o) { return o.n; });
  16713. * // => { 'n': 1 }
  16714. *
  16715. * // The `_.property` iteratee shorthand.
  16716. * _.minBy(objects, 'n');
  16717. * // => { 'n': 1 }
  16718. */
  16719. function minBy(array, iteratee) {
  16720. return (array && array.length)
  16721. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16722. : undefined;
  16723. }
  16724. /**
  16725. * Multiply two numbers.
  16726. *
  16727. * @static
  16728. * @memberOf _
  16729. * @since 4.7.0
  16730. * @category Math
  16731. * @param {number} multiplier The first number in a multiplication.
  16732. * @param {number} multiplicand The second number in a multiplication.
  16733. * @returns {number} Returns the product.
  16734. * @example
  16735. *
  16736. * _.multiply(6, 4);
  16737. * // => 24
  16738. */
  16739. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16740. return multiplier * multiplicand;
  16741. }, 1);
  16742. /**
  16743. * Computes `number` rounded to `precision`.
  16744. *
  16745. * @static
  16746. * @memberOf _
  16747. * @since 3.10.0
  16748. * @category Math
  16749. * @param {number} number The number to round.
  16750. * @param {number} [precision=0] The precision to round to.
  16751. * @returns {number} Returns the rounded number.
  16752. * @example
  16753. *
  16754. * _.round(4.006);
  16755. * // => 4
  16756. *
  16757. * _.round(4.006, 2);
  16758. * // => 4.01
  16759. *
  16760. * _.round(4060, -2);
  16761. * // => 4100
  16762. */
  16763. var round = createRound('round');
  16764. /**
  16765. * Subtract two numbers.
  16766. *
  16767. * @static
  16768. * @memberOf _
  16769. * @since 4.0.0
  16770. * @category Math
  16771. * @param {number} minuend The first number in a subtraction.
  16772. * @param {number} subtrahend The second number in a subtraction.
  16773. * @returns {number} Returns the difference.
  16774. * @example
  16775. *
  16776. * _.subtract(6, 4);
  16777. * // => 2
  16778. */
  16779. var subtract = createMathOperation(function(minuend, subtrahend) {
  16780. return minuend - subtrahend;
  16781. }, 0);
  16782. /**
  16783. * Computes the sum of the values in `array`.
  16784. *
  16785. * @static
  16786. * @memberOf _
  16787. * @since 3.4.0
  16788. * @category Math
  16789. * @param {Array} array The array to iterate over.
  16790. * @returns {number} Returns the sum.
  16791. * @example
  16792. *
  16793. * _.sum([4, 2, 8, 6]);
  16794. * // => 20
  16795. */
  16796. function sum(array) {
  16797. return (array && array.length)
  16798. ? baseSum(array, identity)
  16799. : 0;
  16800. }
  16801. /**
  16802. * This method is like `_.sum` except that it accepts `iteratee` which is
  16803. * invoked for each element in `array` to generate the value to be summed.
  16804. * The iteratee is invoked with one argument: (value).
  16805. *
  16806. * @static
  16807. * @memberOf _
  16808. * @since 4.0.0
  16809. * @category Math
  16810. * @param {Array} array The array to iterate over.
  16811. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16812. * @returns {number} Returns the sum.
  16813. * @example
  16814. *
  16815. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16816. *
  16817. * _.sumBy(objects, function(o) { return o.n; });
  16818. * // => 20
  16819. *
  16820. * // The `_.property` iteratee shorthand.
  16821. * _.sumBy(objects, 'n');
  16822. * // => 20
  16823. */
  16824. function sumBy(array, iteratee) {
  16825. return (array && array.length)
  16826. ? baseSum(array, getIteratee(iteratee, 2))
  16827. : 0;
  16828. }
  16829. /*------------------------------------------------------------------------*/
  16830. // Add methods that return wrapped values in chain sequences.
  16831. lodash.after = after;
  16832. lodash.ary = ary;
  16833. lodash.assign = assign;
  16834. lodash.assignIn = assignIn;
  16835. lodash.assignInWith = assignInWith;
  16836. lodash.assignWith = assignWith;
  16837. lodash.at = at;
  16838. lodash.before = before;
  16839. lodash.bind = bind;
  16840. lodash.bindAll = bindAll;
  16841. lodash.bindKey = bindKey;
  16842. lodash.castArray = castArray;
  16843. lodash.chain = chain;
  16844. lodash.chunk = chunk;
  16845. lodash.compact = compact;
  16846. lodash.concat = concat;
  16847. lodash.cond = cond;
  16848. lodash.conforms = conforms;
  16849. lodash.constant = constant;
  16850. lodash.countBy = countBy;
  16851. lodash.create = create;
  16852. lodash.curry = curry;
  16853. lodash.curryRight = curryRight;
  16854. lodash.debounce = debounce;
  16855. lodash.defaults = defaults;
  16856. lodash.defaultsDeep = defaultsDeep;
  16857. lodash.defer = defer;
  16858. lodash.delay = delay;
  16859. lodash.difference = difference;
  16860. lodash.differenceBy = differenceBy;
  16861. lodash.differenceWith = differenceWith;
  16862. lodash.drop = drop;
  16863. lodash.dropRight = dropRight;
  16864. lodash.dropRightWhile = dropRightWhile;
  16865. lodash.dropWhile = dropWhile;
  16866. lodash.fill = fill;
  16867. lodash.filter = filter;
  16868. lodash.flatMap = flatMap;
  16869. lodash.flatMapDeep = flatMapDeep;
  16870. lodash.flatMapDepth = flatMapDepth;
  16871. lodash.flatten = flatten;
  16872. lodash.flattenDeep = flattenDeep;
  16873. lodash.flattenDepth = flattenDepth;
  16874. lodash.flip = flip;
  16875. lodash.flow = flow;
  16876. lodash.flowRight = flowRight;
  16877. lodash.fromPairs = fromPairs;
  16878. lodash.functions = functions;
  16879. lodash.functionsIn = functionsIn;
  16880. lodash.groupBy = groupBy;
  16881. lodash.initial = initial;
  16882. lodash.intersection = intersection;
  16883. lodash.intersectionBy = intersectionBy;
  16884. lodash.intersectionWith = intersectionWith;
  16885. lodash.invert = invert;
  16886. lodash.invertBy = invertBy;
  16887. lodash.invokeMap = invokeMap;
  16888. lodash.iteratee = iteratee;
  16889. lodash.keyBy = keyBy;
  16890. lodash.keys = keys;
  16891. lodash.keysIn = keysIn;
  16892. lodash.map = map;
  16893. lodash.mapKeys = mapKeys;
  16894. lodash.mapValues = mapValues;
  16895. lodash.matches = matches;
  16896. lodash.matchesProperty = matchesProperty;
  16897. lodash.memoize = memoize;
  16898. lodash.merge = merge;
  16899. lodash.mergeWith = mergeWith;
  16900. lodash.method = method;
  16901. lodash.methodOf = methodOf;
  16902. lodash.mixin = mixin;
  16903. lodash.negate = negate;
  16904. lodash.nthArg = nthArg;
  16905. lodash.omit = omit;
  16906. lodash.omitBy = omitBy;
  16907. lodash.once = once;
  16908. lodash.orderBy = orderBy;
  16909. lodash.over = over;
  16910. lodash.overArgs = overArgs;
  16911. lodash.overEvery = overEvery;
  16912. lodash.overSome = overSome;
  16913. lodash.partial = partial;
  16914. lodash.partialRight = partialRight;
  16915. lodash.partition = partition;
  16916. lodash.pick = pick;
  16917. lodash.pickBy = pickBy;
  16918. lodash.property = property;
  16919. lodash.propertyOf = propertyOf;
  16920. lodash.pull = pull;
  16921. lodash.pullAll = pullAll;
  16922. lodash.pullAllBy = pullAllBy;
  16923. lodash.pullAllWith = pullAllWith;
  16924. lodash.pullAt = pullAt;
  16925. lodash.range = range;
  16926. lodash.rangeRight = rangeRight;
  16927. lodash.rearg = rearg;
  16928. lodash.reject = reject;
  16929. lodash.remove = remove;
  16930. lodash.rest = rest;
  16931. lodash.reverse = reverse;
  16932. lodash.sampleSize = sampleSize;
  16933. lodash.set = set;
  16934. lodash.setWith = setWith;
  16935. lodash.shuffle = shuffle;
  16936. lodash.slice = slice;
  16937. lodash.sortBy = sortBy;
  16938. lodash.sortedUniq = sortedUniq;
  16939. lodash.sortedUniqBy = sortedUniqBy;
  16940. lodash.split = split;
  16941. lodash.spread = spread;
  16942. lodash.tail = tail;
  16943. lodash.take = take;
  16944. lodash.takeRight = takeRight;
  16945. lodash.takeRightWhile = takeRightWhile;
  16946. lodash.takeWhile = takeWhile;
  16947. lodash.tap = tap;
  16948. lodash.throttle = throttle;
  16949. lodash.thru = thru;
  16950. lodash.toArray = toArray;
  16951. lodash.toPairs = toPairs;
  16952. lodash.toPairsIn = toPairsIn;
  16953. lodash.toPath = toPath;
  16954. lodash.toPlainObject = toPlainObject;
  16955. lodash.transform = transform;
  16956. lodash.unary = unary;
  16957. lodash.union = union;
  16958. lodash.unionBy = unionBy;
  16959. lodash.unionWith = unionWith;
  16960. lodash.uniq = uniq;
  16961. lodash.uniqBy = uniqBy;
  16962. lodash.uniqWith = uniqWith;
  16963. lodash.unset = unset;
  16964. lodash.unzip = unzip;
  16965. lodash.unzipWith = unzipWith;
  16966. lodash.update = update;
  16967. lodash.updateWith = updateWith;
  16968. lodash.values = values;
  16969. lodash.valuesIn = valuesIn;
  16970. lodash.without = without;
  16971. lodash.words = words;
  16972. lodash.wrap = wrap;
  16973. lodash.xor = xor;
  16974. lodash.xorBy = xorBy;
  16975. lodash.xorWith = xorWith;
  16976. lodash.zip = zip;
  16977. lodash.zipObject = zipObject;
  16978. lodash.zipObjectDeep = zipObjectDeep;
  16979. lodash.zipWith = zipWith;
  16980. // Add aliases.
  16981. lodash.entries = toPairs;
  16982. lodash.entriesIn = toPairsIn;
  16983. lodash.extend = assignIn;
  16984. lodash.extendWith = assignInWith;
  16985. // Add methods to `lodash.prototype`.
  16986. mixin(lodash, lodash);
  16987. /*------------------------------------------------------------------------*/
  16988. // Add methods that return unwrapped values in chain sequences.
  16989. lodash.add = add;
  16990. lodash.attempt = attempt;
  16991. lodash.camelCase = camelCase;
  16992. lodash.capitalize = capitalize;
  16993. lodash.ceil = ceil;
  16994. lodash.clamp = clamp;
  16995. lodash.clone = clone;
  16996. lodash.cloneDeep = cloneDeep;
  16997. lodash.cloneDeepWith = cloneDeepWith;
  16998. lodash.cloneWith = cloneWith;
  16999. lodash.conformsTo = conformsTo;
  17000. lodash.deburr = deburr;
  17001. lodash.defaultTo = defaultTo;
  17002. lodash.divide = divide;
  17003. lodash.endsWith = endsWith;
  17004. lodash.eq = eq;
  17005. lodash.escape = escape;
  17006. lodash.escapeRegExp = escapeRegExp;
  17007. lodash.every = every;
  17008. lodash.find = find;
  17009. lodash.findIndex = findIndex;
  17010. lodash.findKey = findKey;
  17011. lodash.findLast = findLast;
  17012. lodash.findLastIndex = findLastIndex;
  17013. lodash.findLastKey = findLastKey;
  17014. lodash.floor = floor;
  17015. lodash.forEach = forEach;
  17016. lodash.forEachRight = forEachRight;
  17017. lodash.forIn = forIn;
  17018. lodash.forInRight = forInRight;
  17019. lodash.forOwn = forOwn;
  17020. lodash.forOwnRight = forOwnRight;
  17021. lodash.get = get;
  17022. lodash.gt = gt;
  17023. lodash.gte = gte;
  17024. lodash.has = has;
  17025. lodash.hasIn = hasIn;
  17026. lodash.head = head;
  17027. lodash.identity = identity;
  17028. lodash.includes = includes;
  17029. lodash.indexOf = indexOf;
  17030. lodash.inRange = inRange;
  17031. lodash.invoke = invoke;
  17032. lodash.isArguments = isArguments;
  17033. lodash.isArray = isArray;
  17034. lodash.isArrayBuffer = isArrayBuffer;
  17035. lodash.isArrayLike = isArrayLike;
  17036. lodash.isArrayLikeObject = isArrayLikeObject;
  17037. lodash.isBoolean = isBoolean;
  17038. lodash.isBuffer = isBuffer;
  17039. lodash.isDate = isDate;
  17040. lodash.isElement = isElement;
  17041. lodash.isEmpty = isEmpty;
  17042. lodash.isEqual = isEqual;
  17043. lodash.isEqualWith = isEqualWith;
  17044. lodash.isError = isError;
  17045. lodash.isFinite = isFinite;
  17046. lodash.isFunction = isFunction;
  17047. lodash.isInteger = isInteger;
  17048. lodash.isLength = isLength;
  17049. lodash.isMap = isMap;
  17050. lodash.isMatch = isMatch;
  17051. lodash.isMatchWith = isMatchWith;
  17052. lodash.isNaN = isNaN;
  17053. lodash.isNative = isNative;
  17054. lodash.isNil = isNil;
  17055. lodash.isNull = isNull;
  17056. lodash.isNumber = isNumber;
  17057. lodash.isObject = isObject;
  17058. lodash.isObjectLike = isObjectLike;
  17059. lodash.isPlainObject = isPlainObject;
  17060. lodash.isRegExp = isRegExp;
  17061. lodash.isSafeInteger = isSafeInteger;
  17062. lodash.isSet = isSet;
  17063. lodash.isString = isString;
  17064. lodash.isSymbol = isSymbol;
  17065. lodash.isTypedArray = isTypedArray;
  17066. lodash.isUndefined = isUndefined;
  17067. lodash.isWeakMap = isWeakMap;
  17068. lodash.isWeakSet = isWeakSet;
  17069. lodash.join = join;
  17070. lodash.kebabCase = kebabCase;
  17071. lodash.last = last;
  17072. lodash.lastIndexOf = lastIndexOf;
  17073. lodash.lowerCase = lowerCase;
  17074. lodash.lowerFirst = lowerFirst;
  17075. lodash.lt = lt;
  17076. lodash.lte = lte;
  17077. lodash.max = max;
  17078. lodash.maxBy = maxBy;
  17079. lodash.mean = mean;
  17080. lodash.meanBy = meanBy;
  17081. lodash.min = min;
  17082. lodash.minBy = minBy;
  17083. lodash.stubArray = stubArray;
  17084. lodash.stubFalse = stubFalse;
  17085. lodash.stubObject = stubObject;
  17086. lodash.stubString = stubString;
  17087. lodash.stubTrue = stubTrue;
  17088. lodash.multiply = multiply;
  17089. lodash.nth = nth;
  17090. lodash.noConflict = noConflict;
  17091. lodash.noop = noop;
  17092. lodash.now = now;
  17093. lodash.pad = pad;
  17094. lodash.padEnd = padEnd;
  17095. lodash.padStart = padStart;
  17096. lodash.parseInt = parseInt;
  17097. lodash.random = random;
  17098. lodash.reduce = reduce;
  17099. lodash.reduceRight = reduceRight;
  17100. lodash.repeat = repeat;
  17101. lodash.replace = replace;
  17102. lodash.result = result;
  17103. lodash.round = round;
  17104. lodash.runInContext = runInContext;
  17105. lodash.sample = sample;
  17106. lodash.size = size;
  17107. lodash.snakeCase = snakeCase;
  17108. lodash.some = some;
  17109. lodash.sortedIndex = sortedIndex;
  17110. lodash.sortedIndexBy = sortedIndexBy;
  17111. lodash.sortedIndexOf = sortedIndexOf;
  17112. lodash.sortedLastIndex = sortedLastIndex;
  17113. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17114. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17115. lodash.startCase = startCase;
  17116. lodash.startsWith = startsWith;
  17117. lodash.subtract = subtract;
  17118. lodash.sum = sum;
  17119. lodash.sumBy = sumBy;
  17120. lodash.template = template;
  17121. lodash.times = times;
  17122. lodash.toFinite = toFinite;
  17123. lodash.toInteger = toInteger;
  17124. lodash.toLength = toLength;
  17125. lodash.toLower = toLower;
  17126. lodash.toNumber = toNumber;
  17127. lodash.toSafeInteger = toSafeInteger;
  17128. lodash.toString = toString;
  17129. lodash.toUpper = toUpper;
  17130. lodash.trim = trim;
  17131. lodash.trimEnd = trimEnd;
  17132. lodash.trimStart = trimStart;
  17133. lodash.truncate = truncate;
  17134. lodash.unescape = unescape;
  17135. lodash.uniqueId = uniqueId;
  17136. lodash.upperCase = upperCase;
  17137. lodash.upperFirst = upperFirst;
  17138. // Add aliases.
  17139. lodash.each = forEach;
  17140. lodash.eachRight = forEachRight;
  17141. lodash.first = head;
  17142. mixin(lodash, (function() {
  17143. var source = {};
  17144. baseForOwn(lodash, function(func, methodName) {
  17145. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17146. source[methodName] = func;
  17147. }
  17148. });
  17149. return source;
  17150. }()), { 'chain': false });
  17151. /*------------------------------------------------------------------------*/
  17152. /**
  17153. * The semantic version number.
  17154. *
  17155. * @static
  17156. * @memberOf _
  17157. * @type {string}
  17158. */
  17159. lodash.VERSION = VERSION;
  17160. // Assign default placeholders.
  17161. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17162. lodash[methodName].placeholder = lodash;
  17163. });
  17164. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17165. arrayEach(['drop', 'take'], function(methodName, index) {
  17166. LazyWrapper.prototype[methodName] = function(n) {
  17167. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17168. var result = (this.__filtered__ && !index)
  17169. ? new LazyWrapper(this)
  17170. : this.clone();
  17171. if (result.__filtered__) {
  17172. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17173. } else {
  17174. result.__views__.push({
  17175. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17176. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17177. });
  17178. }
  17179. return result;
  17180. };
  17181. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17182. return this.reverse()[methodName](n).reverse();
  17183. };
  17184. });
  17185. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17186. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17187. var type = index + 1,
  17188. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17189. LazyWrapper.prototype[methodName] = function(iteratee) {
  17190. var result = this.clone();
  17191. result.__iteratees__.push({
  17192. 'iteratee': getIteratee(iteratee, 3),
  17193. 'type': type
  17194. });
  17195. result.__filtered__ = result.__filtered__ || isFilter;
  17196. return result;
  17197. };
  17198. });
  17199. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17200. arrayEach(['head', 'last'], function(methodName, index) {
  17201. var takeName = 'take' + (index ? 'Right' : '');
  17202. LazyWrapper.prototype[methodName] = function() {
  17203. return this[takeName](1).value()[0];
  17204. };
  17205. });
  17206. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17207. arrayEach(['initial', 'tail'], function(methodName, index) {
  17208. var dropName = 'drop' + (index ? '' : 'Right');
  17209. LazyWrapper.prototype[methodName] = function() {
  17210. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17211. };
  17212. });
  17213. LazyWrapper.prototype.compact = function() {
  17214. return this.filter(identity);
  17215. };
  17216. LazyWrapper.prototype.find = function(predicate) {
  17217. return this.filter(predicate).head();
  17218. };
  17219. LazyWrapper.prototype.findLast = function(predicate) {
  17220. return this.reverse().find(predicate);
  17221. };
  17222. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17223. if (typeof path == 'function') {
  17224. return new LazyWrapper(this);
  17225. }
  17226. return this.map(function(value) {
  17227. return baseInvoke(value, path, args);
  17228. });
  17229. });
  17230. LazyWrapper.prototype.reject = function(predicate) {
  17231. return this.filter(negate(getIteratee(predicate)));
  17232. };
  17233. LazyWrapper.prototype.slice = function(start, end) {
  17234. start = toInteger(start);
  17235. var result = this;
  17236. if (result.__filtered__ && (start > 0 || end < 0)) {
  17237. return new LazyWrapper(result);
  17238. }
  17239. if (start < 0) {
  17240. result = result.takeRight(-start);
  17241. } else if (start) {
  17242. result = result.drop(start);
  17243. }
  17244. if (end !== undefined) {
  17245. end = toInteger(end);
  17246. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17247. }
  17248. return result;
  17249. };
  17250. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17251. return this.reverse().takeWhile(predicate).reverse();
  17252. };
  17253. LazyWrapper.prototype.toArray = function() {
  17254. return this.take(MAX_ARRAY_LENGTH);
  17255. };
  17256. // Add `LazyWrapper` methods to `lodash.prototype`.
  17257. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17258. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17259. isTaker = /^(?:head|last)$/.test(methodName),
  17260. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17261. retUnwrapped = isTaker || /^find/.test(methodName);
  17262. if (!lodashFunc) {
  17263. return;
  17264. }
  17265. lodash.prototype[methodName] = function() {
  17266. var value = this.__wrapped__,
  17267. args = isTaker ? [1] : arguments,
  17268. isLazy = value instanceof LazyWrapper,
  17269. iteratee = args[0],
  17270. useLazy = isLazy || isArray(value);
  17271. var interceptor = function(value) {
  17272. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17273. return (isTaker && chainAll) ? result[0] : result;
  17274. };
  17275. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17276. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17277. isLazy = useLazy = false;
  17278. }
  17279. var chainAll = this.__chain__,
  17280. isHybrid = !!this.__actions__.length,
  17281. isUnwrapped = retUnwrapped && !chainAll,
  17282. onlyLazy = isLazy && !isHybrid;
  17283. if (!retUnwrapped && useLazy) {
  17284. value = onlyLazy ? value : new LazyWrapper(this);
  17285. var result = func.apply(value, args);
  17286. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17287. return new LodashWrapper(result, chainAll);
  17288. }
  17289. if (isUnwrapped && onlyLazy) {
  17290. return func.apply(this, args);
  17291. }
  17292. result = this.thru(interceptor);
  17293. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17294. };
  17295. });
  17296. // Add `Array` methods to `lodash.prototype`.
  17297. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17298. var func = arrayProto[methodName],
  17299. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17300. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17301. lodash.prototype[methodName] = function() {
  17302. var args = arguments;
  17303. if (retUnwrapped && !this.__chain__) {
  17304. var value = this.value();
  17305. return func.apply(isArray(value) ? value : [], args);
  17306. }
  17307. return this[chainName](function(value) {
  17308. return func.apply(isArray(value) ? value : [], args);
  17309. });
  17310. };
  17311. });
  17312. // Map minified method names to their real names.
  17313. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17314. var lodashFunc = lodash[methodName];
  17315. if (lodashFunc) {
  17316. var key = lodashFunc.name + '';
  17317. if (!hasOwnProperty.call(realNames, key)) {
  17318. realNames[key] = [];
  17319. }
  17320. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17321. }
  17322. });
  17323. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17324. 'name': 'wrapper',
  17325. 'func': undefined
  17326. }];
  17327. // Add methods to `LazyWrapper`.
  17328. LazyWrapper.prototype.clone = lazyClone;
  17329. LazyWrapper.prototype.reverse = lazyReverse;
  17330. LazyWrapper.prototype.value = lazyValue;
  17331. // Add chain sequence methods to the `lodash` wrapper.
  17332. lodash.prototype.at = wrapperAt;
  17333. lodash.prototype.chain = wrapperChain;
  17334. lodash.prototype.commit = wrapperCommit;
  17335. lodash.prototype.next = wrapperNext;
  17336. lodash.prototype.plant = wrapperPlant;
  17337. lodash.prototype.reverse = wrapperReverse;
  17338. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17339. // Add lazy aliases.
  17340. lodash.prototype.first = lodash.prototype.head;
  17341. if (symIterator) {
  17342. lodash.prototype[symIterator] = wrapperToIterator;
  17343. }
  17344. return lodash;
  17345. });
  17346. /*--------------------------------------------------------------------------*/
  17347. // Export lodash.
  17348. var _ = runInContext();
  17349. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17350. if (true) {
  17351. // Expose Lodash on the global object to prevent errors when Lodash is
  17352. // loaded by a script tag in the presence of an AMD loader.
  17353. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17354. // Use `_.noConflict` to remove Lodash from the global object.
  17355. root._ = _;
  17356. // Define as an anonymous module so, through path mapping, it can be
  17357. // referenced as the "underscore" module.
  17358. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17359. return _;
  17360. }).call(exports, __webpack_require__, exports, module),
  17361. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17362. }
  17363. // Check for `exports` after `define` in case a build optimizer adds it.
  17364. else {}
  17365. }.call(this));
  17366. /***/ }),
  17367. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17368. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17369. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17370. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17371. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17372. "use strict";
  17373. __webpack_require__.r(__webpack_exports__);
  17374. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17375. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17376. /* harmony export */ });
  17377. /* 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");
  17378. /* 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__);
  17379. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17380. var options = {};
  17381. options.insert = "head";
  17382. options.singleton = false;
  17383. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17384. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17385. /***/ }),
  17386. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17387. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17388. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17389. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17390. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17391. "use strict";
  17392. __webpack_require__.r(__webpack_exports__);
  17393. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17394. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17395. /* harmony export */ });
  17396. /* 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");
  17397. /* 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__);
  17398. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17399. var options = {};
  17400. options.insert = "head";
  17401. options.singleton = false;
  17402. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17403. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17404. /***/ }),
  17405. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17406. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17407. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17408. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17409. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17410. "use strict";
  17411. __webpack_require__.r(__webpack_exports__);
  17412. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17413. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17414. /* harmony export */ });
  17415. /* 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");
  17416. /* 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__);
  17417. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17418. var options = {};
  17419. options.insert = "head";
  17420. options.singleton = false;
  17421. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17422. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17423. /***/ }),
  17424. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17425. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17426. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17427. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17428. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17429. "use strict";
  17430. __webpack_require__.r(__webpack_exports__);
  17431. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17432. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17433. /* harmony export */ });
  17434. /* 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");
  17435. /* 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__);
  17436. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17437. var options = {};
  17438. options.insert = "head";
  17439. options.singleton = false;
  17440. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17441. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17442. /***/ }),
  17443. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17444. /*!******************************************************!*\
  17445. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17446. \******************************************************/
  17447. /***/ ((__unused_webpack_module, exports) => {
  17448. "use strict";
  17449. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17450. // runtime helper for setting properties on components
  17451. // in a tree-shakable way
  17452. exports["default"] = (sfc, props) => {
  17453. const target = sfc.__vccOpts || sfc;
  17454. for (const [key, val] of props) {
  17455. target[key] = val;
  17456. }
  17457. return target;
  17458. };
  17459. /***/ }),
  17460. /***/ "./resources/js/components/AppButtonLink.vue":
  17461. /*!***************************************************!*\
  17462. !*** ./resources/js/components/AppButtonLink.vue ***!
  17463. \***************************************************/
  17464. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17465. "use strict";
  17466. __webpack_require__.r(__webpack_exports__);
  17467. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17468. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17469. /* harmony export */ });
  17470. /* 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");
  17471. /* 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");
  17472. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17473. ;
  17474. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17475. /* hot reload */
  17476. if (false) {}
  17477. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17478. /***/ }),
  17479. /***/ "./resources/js/components/AppMessage.vue":
  17480. /*!************************************************!*\
  17481. !*** ./resources/js/components/AppMessage.vue ***!
  17482. \************************************************/
  17483. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17484. "use strict";
  17485. __webpack_require__.r(__webpack_exports__);
  17486. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17487. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17488. /* harmony export */ });
  17489. /* 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");
  17490. /* 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");
  17491. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17492. ;
  17493. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17494. /* hot reload */
  17495. if (false) {}
  17496. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17497. /***/ }),
  17498. /***/ "./resources/js/components/AppPagination.vue":
  17499. /*!***************************************************!*\
  17500. !*** ./resources/js/components/AppPagination.vue ***!
  17501. \***************************************************/
  17502. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17503. "use strict";
  17504. __webpack_require__.r(__webpack_exports__);
  17505. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17506. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17507. /* harmony export */ });
  17508. /* 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");
  17509. /* 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");
  17510. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17511. ;
  17512. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17513. /* hot reload */
  17514. if (false) {}
  17515. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17516. /***/ }),
  17517. /***/ "./resources/js/components/AppSearch.vue":
  17518. /*!***********************************************!*\
  17519. !*** ./resources/js/components/AppSearch.vue ***!
  17520. \***********************************************/
  17521. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17522. "use strict";
  17523. __webpack_require__.r(__webpack_exports__);
  17524. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17525. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17526. /* harmony export */ });
  17527. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17528. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17529. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17530. ;
  17531. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17532. /* hot reload */
  17533. if (false) {}
  17534. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17535. /***/ }),
  17536. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17537. /*!**************************************************************!*\
  17538. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17539. \**************************************************************/
  17540. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17541. "use strict";
  17542. __webpack_require__.r(__webpack_exports__);
  17543. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17544. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17545. /* harmony export */ });
  17546. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17547. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17548. const script = {}
  17549. ;
  17550. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17551. /* hot reload */
  17552. if (false) {}
  17553. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17554. /***/ }),
  17555. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17556. /*!***************************************************************!*\
  17557. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17558. \***************************************************************/
  17559. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17560. "use strict";
  17561. __webpack_require__.r(__webpack_exports__);
  17562. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17563. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17564. /* harmony export */ });
  17565. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17566. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17567. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17568. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17569. ;
  17570. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17571. /* hot reload */
  17572. if (false) {}
  17573. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17574. /***/ }),
  17575. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17576. /*!******************************************************************!*\
  17577. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17578. \******************************************************************/
  17579. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17580. "use strict";
  17581. __webpack_require__.r(__webpack_exports__);
  17582. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17583. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17584. /* harmony export */ });
  17585. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17586. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17587. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17588. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17589. ;
  17590. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17591. /* hot reload */
  17592. if (false) {}
  17593. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17594. /***/ }),
  17595. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17596. /*!**************************************************************!*\
  17597. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17598. \**************************************************************/
  17599. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17600. "use strict";
  17601. __webpack_require__.r(__webpack_exports__);
  17602. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17603. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17604. /* harmony export */ });
  17605. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17606. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17607. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17608. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17609. ;
  17610. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17611. /* hot reload */
  17612. if (false) {}
  17613. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17614. /***/ }),
  17615. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17616. /*!************************************************************!*\
  17617. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17618. \************************************************************/
  17619. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17620. "use strict";
  17621. __webpack_require__.r(__webpack_exports__);
  17622. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17623. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17624. /* harmony export */ });
  17625. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17626. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17627. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17628. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17629. ;
  17630. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17631. /* hot reload */
  17632. if (false) {}
  17633. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17634. /***/ }),
  17635. /***/ "./resources/js/pages/Users/Index.vue":
  17636. /*!********************************************!*\
  17637. !*** ./resources/js/pages/Users/Index.vue ***!
  17638. \********************************************/
  17639. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17640. "use strict";
  17641. __webpack_require__.r(__webpack_exports__);
  17642. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17643. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17644. /* harmony export */ });
  17645. /* harmony import */ var _Index_vue_vue_type_template_id_203afd1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=203afd1c */ "./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c");
  17646. /* 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/Users/Index.vue?vue&type=script&setup=true&lang=js");
  17647. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17648. ;
  17649. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_203afd1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Users/Index.vue"]])
  17650. /* hot reload */
  17651. if (false) {}
  17652. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17653. /***/ }),
  17654. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17655. /*!**************************************************************************************!*\
  17656. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17657. \**************************************************************************************/
  17658. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17659. "use strict";
  17660. __webpack_require__.r(__webpack_exports__);
  17661. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17662. /* 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"])
  17663. /* harmony export */ });
  17664. /* 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");
  17665. /***/ }),
  17666. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17667. /*!***********************************************************************************!*\
  17668. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17669. \***********************************************************************************/
  17670. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17671. "use strict";
  17672. __webpack_require__.r(__webpack_exports__);
  17673. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17674. /* 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"])
  17675. /* harmony export */ });
  17676. /* 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");
  17677. /***/ }),
  17678. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17679. /*!**************************************************************************************!*\
  17680. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17681. \**************************************************************************************/
  17682. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17683. "use strict";
  17684. __webpack_require__.r(__webpack_exports__);
  17685. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17686. /* 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"])
  17687. /* harmony export */ });
  17688. /* 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");
  17689. /***/ }),
  17690. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17691. /*!**********************************************************************************!*\
  17692. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17693. \**********************************************************************************/
  17694. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17695. "use strict";
  17696. __webpack_require__.r(__webpack_exports__);
  17697. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17698. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17699. /* harmony export */ });
  17700. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17701. /***/ }),
  17702. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17703. /*!**************************************************************************************************!*\
  17704. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17705. \**************************************************************************************************/
  17706. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17707. "use strict";
  17708. __webpack_require__.r(__webpack_exports__);
  17709. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17710. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17711. /* harmony export */ });
  17712. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17713. /***/ }),
  17714. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17715. /*!*****************************************************************************************************!*\
  17716. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17717. \*****************************************************************************************************/
  17718. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17719. "use strict";
  17720. __webpack_require__.r(__webpack_exports__);
  17721. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17722. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17723. /* harmony export */ });
  17724. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17725. /***/ }),
  17726. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17727. /*!*************************************************************************************************!*\
  17728. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17729. \*************************************************************************************************/
  17730. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17731. "use strict";
  17732. __webpack_require__.r(__webpack_exports__);
  17733. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17734. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17735. /* harmony export */ });
  17736. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17737. /***/ }),
  17738. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17739. /*!***********************************************************************************************!*\
  17740. !*** ./resources/js/layouts/Dashboard/DashboardLayout.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_DashboardLayout_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_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17749. /***/ }),
  17750. /***/ "./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js":
  17751. /*!*******************************************************************************!*\
  17752. !*** ./resources/js/pages/Users/Index.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_Index_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_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/Users/Index.vue?vue&type=script&setup=true&lang=js");
  17761. /***/ }),
  17762. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17763. /*!*********************************************************************************!*\
  17764. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  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 */ "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)
  17771. /* harmony export */ });
  17772. /* 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");
  17773. /***/ }),
  17774. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17775. /*!******************************************************************************!*\
  17776. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  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 */ "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)
  17783. /* harmony export */ });
  17784. /* 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");
  17785. /***/ }),
  17786. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17787. /*!*********************************************************************************!*\
  17788. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  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 */ "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)
  17795. /* harmony export */ });
  17796. /* 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");
  17797. /***/ }),
  17798. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17799. /*!*****************************************************************************!*\
  17800. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  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 */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17807. /* harmony export */ });
  17808. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17809. /***/ }),
  17810. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17811. /*!********************************************************************************************!*\
  17812. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  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 */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17819. /* harmony export */ });
  17820. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17821. /***/ }),
  17822. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17823. /*!*********************************************************************************************************!*\
  17824. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  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 */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17831. /* harmony export */ });
  17832. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17833. /***/ }),
  17834. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17835. /*!************************************************************************************************************!*\
  17836. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  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_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__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_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17845. /***/ }),
  17846. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17847. /*!********************************************************************************************************!*\
  17848. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&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_TopBar_vue_vue_type_template_id_0b7edbb0_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_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17857. /***/ }),
  17858. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17859. /*!******************************************************************************************************!*\
  17860. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  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_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__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_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17869. /***/ }),
  17870. /***/ "./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c":
  17871. /*!**************************************************************************!*\
  17872. !*** ./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c ***!
  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_Index_vue_vue_type_template_id_203afd1c__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_Index_vue_vue_type_template_id_203afd1c__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=203afd1c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Users/Index.vue?vue&type=template&id=203afd1c");
  17881. /***/ }),
  17882. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17883. /*!************************************************************************************************************************!*\
  17884. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17885. \************************************************************************************************************************/
  17886. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17887. "use strict";
  17888. __webpack_require__.r(__webpack_exports__);
  17889. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17890. /***/ }),
  17891. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17892. /*!***************************************************************************************************************************!*\
  17893. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17894. \***************************************************************************************************************************/
  17895. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17896. "use strict";
  17897. __webpack_require__.r(__webpack_exports__);
  17898. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17899. /***/ }),
  17900. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17901. /*!***********************************************************************************************************************!*\
  17902. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17903. \***********************************************************************************************************************/
  17904. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17905. "use strict";
  17906. __webpack_require__.r(__webpack_exports__);
  17907. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17908. /***/ }),
  17909. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17910. /*!*********************************************************************************************************************!*\
  17911. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17912. \*********************************************************************************************************************/
  17913. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17914. "use strict";
  17915. __webpack_require__.r(__webpack_exports__);
  17916. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader/dist/cjs.js!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17917. /***/ })
  17918. }]);