resources_js_pages_member_Edit_vue.js 719KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_member_Edit_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  3. /*!****************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  5. \****************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. label: {
  16. type: String,
  17. required: true
  18. },
  19. disabled: {
  20. type: Boolean,
  21. "default": false
  22. },
  23. placeholder: {
  24. type: String,
  25. required: true
  26. },
  27. error: {
  28. type: String,
  29. "default": null
  30. },
  31. optionLabel: {
  32. type: String,
  33. "default": 'label'
  34. },
  35. optionValue: {
  36. type: String,
  37. "default": 'value'
  38. },
  39. optionDisabled: {
  40. type: String,
  41. "default": 'disabled'
  42. },
  43. optionGroupChildren: {
  44. type: String,
  45. "default": null
  46. },
  47. optionGroupLabel: {
  48. type: String,
  49. "default": null
  50. },
  51. options: {
  52. type: Array,
  53. required: true
  54. },
  55. modelValue: null
  56. },
  57. emits: ['update:modelValue'],
  58. setup: function setup(__props, _ref) {
  59. var expose = _ref.expose;
  60. expose();
  61. var props = __props;
  62. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  63. return props.error ? true : false;
  64. });
  65. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  66. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') : null;
  67. });
  68. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  69. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') + '-help' : null;
  70. });
  71. var selectedDropdownLabel = function selectedDropdownLabel(value) {
  72. var result = props.options.find(function (option) {
  73. return option[props.optionValue] == value;
  74. });
  75. if (result) {
  76. return result[props.optionLabel];
  77. }
  78. };
  79. var __returned__ = {
  80. props: props,
  81. isError: isError,
  82. forLabel: forLabel,
  83. ariaDescribedbyLabel: ariaDescribedbyLabel,
  84. selectedDropdownLabel: selectedDropdownLabel,
  85. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  86. };
  87. Object.defineProperty(__returned__, '__isScriptSetup', {
  88. enumerable: false,
  89. value: true
  90. });
  91. return __returned__;
  92. }
  93. });
  94. /***/ }),
  95. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  96. /*!*****************************************************************************************************************************************************************************************************************!*\
  97. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  98. \*****************************************************************************************************************************************************************************************************************/
  99. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  100. "use strict";
  101. __webpack_require__.r(__webpack_exports__);
  102. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  103. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  104. /* harmony export */ });
  105. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  107. props: {
  108. label: {
  109. type: String,
  110. required: true
  111. },
  112. disabled: {
  113. type: Boolean,
  114. "default": false
  115. },
  116. placeholder: {
  117. type: String,
  118. required: true
  119. },
  120. error: {
  121. type: String,
  122. "default": null
  123. },
  124. modelValue: null
  125. },
  126. emits: ['update:modelValue'],
  127. setup: function setup(__props, _ref) {
  128. var expose = _ref.expose;
  129. expose();
  130. var props = __props;
  131. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  132. return props.error ? true : false;
  133. });
  134. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  135. return props.label.toLowerCase().replace(/\s+/g, '-');
  136. });
  137. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  138. return props.label.toLowerCase().replace(/\s+/g, '-') + '-help';
  139. });
  140. var __returned__ = {
  141. props: props,
  142. isError: isError,
  143. forLabel: forLabel,
  144. ariaDescribedbyLabel: ariaDescribedbyLabel,
  145. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  146. };
  147. Object.defineProperty(__returned__, '__isScriptSetup', {
  148. enumerable: false,
  149. value: true
  150. });
  151. return __returned__;
  152. }
  153. });
  154. /***/ }),
  155. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  156. /*!***************************************************************************************************************************************************************************************************************!*\
  157. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  158. \***************************************************************************************************************************************************************************************************************/
  159. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  160. "use strict";
  161. __webpack_require__.r(__webpack_exports__);
  162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  163. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  164. /* harmony export */ });
  165. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  166. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  167. setup: function setup(__props, _ref) {
  168. var expose = _ref.expose;
  169. expose();
  170. var onClose = function onClose() {
  171. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  172. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  173. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  174. };
  175. var __returned__ = {
  176. onClose: onClose,
  177. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  188. /*!***************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  190. \***************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  198. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  199. props: {
  200. menu: Array
  201. },
  202. setup: function setup(__props, _ref) {
  203. var expose = _ref.expose;
  204. expose();
  205. var __returned__ = {
  206. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  207. };
  208. Object.defineProperty(__returned__, '__isScriptSetup', {
  209. enumerable: false,
  210. value: true
  211. });
  212. return __returned__;
  213. }
  214. });
  215. /***/ }),
  216. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  217. /*!******************************************************************************************************************************************************************************************************************!*\
  218. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  219. \******************************************************************************************************************************************************************************************************************/
  220. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  221. "use strict";
  222. __webpack_require__.r(__webpack_exports__);
  223. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  224. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  225. /* harmony export */ });
  226. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  227. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  228. props: {
  229. items: Array,
  230. root: {
  231. type: Boolean,
  232. "default": false
  233. }
  234. },
  235. setup: function setup(__props, _ref) {
  236. var expose = _ref.expose;
  237. expose();
  238. var __returned__ = {
  239. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  240. };
  241. Object.defineProperty(__returned__, '__isScriptSetup', {
  242. enumerable: false,
  243. value: true
  244. });
  245. return __returned__;
  246. }
  247. });
  248. /***/ }),
  249. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  250. /*!**************************************************************************************************************************************************************************************************************!*\
  251. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  252. \**************************************************************************************************************************************************************************************************************/
  253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  254. "use strict";
  255. __webpack_require__.r(__webpack_exports__);
  256. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  257. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  258. /* harmony export */ });
  259. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  260. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  261. emits: ['menu-toggle'],
  262. setup: function setup(__props, _ref) {
  263. var expose = _ref.expose;
  264. expose();
  265. var __returned__ = {
  266. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  267. };
  268. Object.defineProperty(__returned__, '__isScriptSetup', {
  269. enumerable: false,
  270. value: true
  271. });
  272. return __returned__;
  273. }
  274. });
  275. /***/ }),
  276. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  277. /*!*****************************************************************************************************************************************************************************************************************!*\
  278. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  279. \*****************************************************************************************************************************************************************************************************************/
  280. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  281. "use strict";
  282. __webpack_require__.r(__webpack_exports__);
  283. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  284. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  285. /* harmony export */ });
  286. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  287. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  288. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  289. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  290. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  291. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  292. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  293. setup: function setup(__props, _ref) {
  294. var expose = _ref.expose;
  295. expose();
  296. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  297. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  298. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  299. var isDesktop = function isDesktop() {
  300. return window.innerWidth >= 992;
  301. };
  302. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  303. return ['layout-wrapper', {
  304. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  305. 'layout-mobile-sidebar-active': mobileMenuActive.value
  306. }];
  307. });
  308. var onWrapperClick = function onWrapperClick() {
  309. if (!menuClick.value) {
  310. mobileMenuActive.value = false;
  311. }
  312. menuClick.value = false;
  313. };
  314. var onMenuToggle = function onMenuToggle(event) {
  315. menuClick.value = true;
  316. if (isDesktop()) {
  317. staticMenuInactive.value = !staticMenuInactive.value;
  318. } else {
  319. mobileMenuActive.value = !mobileMenuActive.value;
  320. }
  321. event.preventDefault();
  322. };
  323. var __returned__ = {
  324. mobileMenuActive: mobileMenuActive,
  325. staticMenuInactive: staticMenuInactive,
  326. menuClick: menuClick,
  327. isDesktop: isDesktop,
  328. containerClass: containerClass,
  329. onWrapperClick: onWrapperClick,
  330. onMenuToggle: onMenuToggle,
  331. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  332. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  333. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  334. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  335. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  336. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  337. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  338. };
  339. Object.defineProperty(__returned__, '__isScriptSetup', {
  340. enumerable: false,
  341. value: true
  342. });
  343. return __returned__;
  344. }
  345. });
  346. /***/ }),
  347. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js":
  348. /*!***********************************************************************************************************************************************************************************************************!*\
  349. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  350. \***********************************************************************************************************************************************************************************************************/
  351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  352. "use strict";
  353. __webpack_require__.r(__webpack_exports__);
  354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  355. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  356. /* harmony export */ });
  357. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  358. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  359. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  360. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  361. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  362. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/member/tableHeader.js");
  363. /* harmony import */ var _useVehicle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./useVehicle */ "./resources/js/pages/member/useVehicle.js");
  364. /* harmony import */ var _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useFormErrorReset */ "./resources/js/components/useFormErrorReset.js");
  365. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  366. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  367. /* harmony import */ var _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppDropdown.vue */ "./resources/js/components/AppDropdown.vue");
  368. /* harmony import */ var _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/components/AppInputText.vue */ "./resources/js/components/AppInputText.vue");
  369. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  370. props: {
  371. member: Object,
  372. typeMembers: Array,
  373. typeMember: Object,
  374. initialVehicles: Object
  375. },
  376. setup: function setup(__props, _ref) {
  377. var expose = _ref.expose;
  378. expose();
  379. var props = __props;
  380. var form = (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm)({
  381. name: props.member.name,
  382. phone: null,
  383. plat_number: null,
  384. max_vehicle_id: null,
  385. type_member_id: props.member.typeMemberId
  386. });
  387. (0,_components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset)(form);
  388. var _useVehicle = (0,_useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle)(props, form),
  389. listVehicle = _useVehicle.listVehicle,
  390. vehicleOnDelete = _useVehicle.vehicleOnDelete,
  391. vehicleOnAdd = _useVehicle.vehicleOnAdd;
  392. var confirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm)();
  393. var errorSubmitVisible = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  394. var errorSubmitText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)();
  395. var submitValidation = function submitValidation() {
  396. var listPlatNumberGroup = (0,lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy)(listVehicle, 'typeVehicleId');
  397. var listVehicles = [];
  398. for (var key in listPlatNumberGroup) {
  399. listVehicles.push({
  400. typeVehicleId: listPlatNumberGroup[key][0]['typeVehicleId'],
  401. maxVehicle: listPlatNumberGroup[key][0]['maxVehicle'],
  402. count: listPlatNumberGroup[key].length
  403. });
  404. }
  405. listVehicles.forEach(function (val) {
  406. if (val.count > val.maxVehicle) {
  407. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"]('Ada perubahan pada batas maksimal kendaraan');
  408. }
  409. });
  410. };
  411. var formSent = function formSent() {
  412. form.transform(function (data) {
  413. return {
  414. name: data.name,
  415. phone: data.phone,
  416. vehicles: listVehicle,
  417. type_member_id: data.type_member_id
  418. };
  419. }).put(route('members.update', props.member.id));
  420. };
  421. var onSubmit = function onSubmit() {
  422. try {
  423. submitValidation();
  424. if (props.member.typeMemberId != form.type_member_id) {
  425. confirm.require({
  426. message: "Dikenakan tagihan perubahan member sebesar ".concat(props.typeMember.price),
  427. header: 'Tagihan Perubahan Jenis Member',
  428. acceptLabel: 'Bayar dan simpan',
  429. rejectLabel: 'Batalkan',
  430. accept: function accept() {
  431. formSent();
  432. },
  433. reject: function reject() {
  434. confirm.close();
  435. }
  436. });
  437. } else {
  438. formSent();
  439. }
  440. } catch (err) {
  441. errorSubmitVisible.value = true;
  442. errorSubmitText.value = err.message;
  443. }
  444. };
  445. var __returned__ = {
  446. props: props,
  447. form: form,
  448. listVehicle: listVehicle,
  449. vehicleOnDelete: vehicleOnDelete,
  450. vehicleOnAdd: vehicleOnAdd,
  451. confirm: confirm,
  452. errorSubmitVisible: errorSubmitVisible,
  453. errorSubmitText: errorSubmitText,
  454. submitValidation: submitValidation,
  455. formSent: formSent,
  456. onSubmit: onSubmit,
  457. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  458. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  459. useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm,
  460. groupBy: lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy,
  461. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm,
  462. platNumberTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.platNumberTable,
  463. useVehicle: _useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle,
  464. useFormErrorReset: _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset,
  465. FormValidationError: _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"],
  466. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  467. AppDropdown: _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__["default"],
  468. AppInputText: _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__["default"]
  469. };
  470. Object.defineProperty(__returned__, '__isScriptSetup', {
  471. enumerable: false,
  472. value: true
  473. });
  474. return __returned__;
  475. }
  476. });
  477. /***/ }),
  478. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  479. /*!*********************************************************************************************************************************************************************************************************************************************************************************!*\
  480. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  481. \*********************************************************************************************************************************************************************************************************************************************************************************/
  482. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  483. "use strict";
  484. __webpack_require__.r(__webpack_exports__);
  485. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  486. /* harmony export */ "render": () => (/* binding */ render)
  487. /* harmony export */ });
  488. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  489. var _hoisted_1 = {
  490. "class": "field"
  491. };
  492. var _hoisted_2 = ["for"];
  493. var _hoisted_3 = {
  494. key: 0
  495. };
  496. var _hoisted_4 = {
  497. key: 1
  498. };
  499. var _hoisted_5 = ["id"];
  500. function render(_ctx, _cache, $props, $setup, $data, $options) {
  501. var _component_Dropdown = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dropdown");
  502. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [$props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("label", {
  503. key: 0,
  504. "for": $setup.forLabel
  505. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  506. /* TEXT, PROPS */
  507. , _hoisted_2)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dropdown, {
  508. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  509. 'p-invalid': $setup.isError
  510. }]),
  511. id: $setup.forLabel,
  512. "aria-describedby": $setup.ariaDescribedbyLabel,
  513. "option-disabled": $props.optionDisabled,
  514. "option-group-children": $props.optionGroupChildren,
  515. "option-group-label": $props.optionGroupLabel,
  516. "option-label": $props.optionLabel,
  517. "option-value": $props.optionValue,
  518. placeholder: $props.placeholder,
  519. options: $props.options,
  520. "model-value": $props.modelValue,
  521. disabled: $props.disabled,
  522. onChange: _cache[0] || (_cache[0] = function ($event) {
  523. return _ctx.$emit('update:modelValue', $event.value);
  524. })
  525. }, {
  526. value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (slotProps) {
  527. return [slotProps.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.selectedDropdownLabel(slotProps.value)), 1
  528. /* TEXT */
  529. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(slotProps.placeholder), 1
  530. /* TEXT */
  531. ))];
  532. }),
  533. option: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  534. var option = _ref.option,
  535. index = _ref.index;
  536. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "option", {
  537. option: option,
  538. index: index
  539. })];
  540. }),
  541. _: 3
  542. /* FORWARDED */
  543. }, 8
  544. /* PROPS */
  545. , ["class", "id", "aria-describedby", "option-disabled", "option-group-children", "option-group-label", "option-label", "option-value", "placeholder", "options", "model-value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  546. key: 1,
  547. id: $setup.ariaDescribedbyLabel,
  548. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  549. 'p-error': $setup.isError
  550. })
  551. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  552. /* TEXT, CLASS, PROPS */
  553. , _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  554. }
  555. /***/ }),
  556. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  557. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  558. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  559. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  560. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  561. "use strict";
  562. __webpack_require__.r(__webpack_exports__);
  563. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  564. /* harmony export */ "render": () => (/* binding */ render)
  565. /* harmony export */ });
  566. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  567. var _withScopeId = function _withScopeId(n) {
  568. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  569. };
  570. var _hoisted_1 = {
  571. "class": "layout-footer"
  572. };
  573. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  574. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  575. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  576. href: "https://dijitalcode.com",
  577. target: "_blank",
  578. "class": "font-medium ml-2"
  579. }, "DijitalCODE", -1
  580. /* HOISTED */
  581. );
  582. });
  583. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  584. function render(_ctx, _cache) {
  585. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  586. }
  587. /***/ }),
  588. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  589. /*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
  590. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  591. \**********************************************************************************************************************************************************************************************************************************************************************************/
  592. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  593. "use strict";
  594. __webpack_require__.r(__webpack_exports__);
  595. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  596. /* harmony export */ "render": () => (/* binding */ render)
  597. /* harmony export */ });
  598. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  599. var _hoisted_1 = {
  600. "class": "field"
  601. };
  602. var _hoisted_2 = ["for"];
  603. var _hoisted_3 = ["id"];
  604. function render(_ctx, _cache, $props, $setup, $data, $options) {
  605. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  606. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {
  607. "for": $setup.forLabel
  608. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  609. /* TEXT, PROPS */
  610. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  611. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  612. 'p-invalid': $setup.isError
  613. }]),
  614. type: "text",
  615. id: $setup.forLabel,
  616. "aria-describedby": $setup.ariaDescribedbyLabel,
  617. "model-value": $props.modelValue,
  618. placeholder: $props.placeholder,
  619. value: $props.modelValue,
  620. disabled: $props.disabled,
  621. onInput: _cache[0] || (_cache[0] = function ($event) {
  622. return _ctx.$emit('update:modelValue', $event.target.value);
  623. })
  624. }, null, 8
  625. /* PROPS */
  626. , ["class", "id", "aria-describedby", "model-value", "placeholder", "value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  627. key: 0,
  628. id: $setup.ariaDescribedbyLabel,
  629. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  630. 'p-error': $setup.isError
  631. })
  632. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  633. /* TEXT, CLASS, PROPS */
  634. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  635. }
  636. /***/ }),
  637. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  638. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  639. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  640. \********************************************************************************************************************************************************************************************************************************************************************************/
  641. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  642. "use strict";
  643. __webpack_require__.r(__webpack_exports__);
  644. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  645. /* harmony export */ "render": () => (/* binding */ render)
  646. /* harmony export */ });
  647. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  648. var _hoisted_1 = {
  649. key: 0
  650. };
  651. var _hoisted_2 = {
  652. key: 1
  653. };
  654. function render(_ctx, _cache, $props, $setup, $data, $options) {
  655. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  656. 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, {
  657. key: 0,
  658. severity: "success",
  659. onClose: $setup.onClose
  660. }, {
  661. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  662. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  663. /* TEXT */
  664. )];
  665. }),
  666. _: 1
  667. /* STABLE */
  668. })) : (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, {
  669. key: 1,
  670. severity: "error",
  671. onClose: $setup.onClose
  672. }, {
  673. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  674. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  675. /* TEXT */
  676. )];
  677. }),
  678. _: 1
  679. /* STABLE */
  680. })) : (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, {
  681. key: 2,
  682. severity: "error",
  683. onClose: $setup.onClose
  684. }, {
  685. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  686. 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
  687. /* TEXT */
  688. ))];
  689. }),
  690. _: 1
  691. /* STABLE */
  692. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  693. /* STABLE_FRAGMENT */
  694. );
  695. }
  696. /***/ }),
  697. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  698. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  699. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  700. \********************************************************************************************************************************************************************************************************************************************************************************************/
  701. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  702. "use strict";
  703. __webpack_require__.r(__webpack_exports__);
  704. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  705. /* harmony export */ "render": () => (/* binding */ render)
  706. /* harmony export */ });
  707. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  708. function render(_ctx, _cache, $props, $setup, $data, $options) {
  709. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  710. "class": "layout-menu",
  711. items: $props.menu,
  712. root: true
  713. }, null, 8
  714. /* PROPS */
  715. , ["items"])]);
  716. }
  717. /***/ }),
  718. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  719. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  720. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  721. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  722. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  723. "use strict";
  724. __webpack_require__.r(__webpack_exports__);
  725. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  726. /* harmony export */ "render": () => (/* binding */ render)
  727. /* harmony export */ });
  728. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  729. var _withScopeId = function _withScopeId(n) {
  730. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  731. };
  732. var _hoisted_1 = {
  733. key: 0
  734. };
  735. var _hoisted_2 = ["aria-label"];
  736. var _hoisted_3 = ["aria-label"];
  737. function render(_ctx, _cache, $props, $setup, $data, $options) {
  738. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  739. 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) {
  740. 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", {
  741. key: i,
  742. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  743. 'layout-menuitem-category': $props.root
  744. }]),
  745. role: "none"
  746. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  747. key: 0
  748. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  749. "class": "layout-menuitem-root-text",
  750. "aria-label": item.label
  751. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  752. /* TEXT, PROPS */
  753. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  754. items: item.items
  755. }, null, 8
  756. /* PROPS */
  757. , ["items"])], 64
  758. /* STABLE_FRAGMENT */
  759. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  760. key: 1
  761. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  762. key: 0,
  763. role: "menuitem",
  764. href: item.to,
  765. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  766. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  767. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  768. }]),
  769. "aria-label": item.label
  770. }, {
  771. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  772. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  773. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  774. }, null, 2
  775. /* CLASS */
  776. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  777. /* TEXT */
  778. )];
  779. }),
  780. _: 2
  781. /* DYNAMIC */
  782. }, 1032
  783. /* PROPS, DYNAMIC_SLOTS */
  784. , ["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", {
  785. key: 1,
  786. href: "#",
  787. role: "menuitem",
  788. "aria-label": item.label
  789. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  790. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  791. }, null, 2
  792. /* CLASS */
  793. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  794. /* TEXT */
  795. )], 8
  796. /* PROPS */
  797. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  798. items: item.items
  799. }, null, 8
  800. /* PROPS */
  801. , ["items"])], 64
  802. /* STABLE_FRAGMENT */
  803. ))], 2
  804. /* CLASS */
  805. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  806. /* STABLE_FRAGMENT */
  807. );
  808. }), 256
  809. /* UNKEYED_FRAGMENT */
  810. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  811. }
  812. /***/ }),
  813. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  814. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  815. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  816. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  817. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  818. "use strict";
  819. __webpack_require__.r(__webpack_exports__);
  820. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  821. /* harmony export */ "render": () => (/* binding */ render)
  822. /* harmony export */ });
  823. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  824. var _withScopeId = function _withScopeId(n) {
  825. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  826. };
  827. var _hoisted_1 = {
  828. "class": "layout-topbar"
  829. };
  830. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  831. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  832. alt: "Logo",
  833. src: "/images/logo.svg",
  834. "class": "md:mr-3"
  835. }, null, -1
  836. /* HOISTED */
  837. );
  838. });
  839. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  840. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  841. /* HOISTED */
  842. );
  843. });
  844. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  845. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  846. "class": "pi pi-bars"
  847. }, null, -1
  848. /* HOISTED */
  849. );
  850. });
  851. var _hoisted_5 = [_hoisted_4];
  852. var _hoisted_6 = {
  853. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  854. };
  855. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  856. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  857. "class": "pi pi-ellipsis-v"
  858. }, null, -1
  859. /* HOISTED */
  860. );
  861. });
  862. var _hoisted_8 = [_hoisted_7];
  863. var _hoisted_9 = {
  864. "class": "layout-topbar-menu hidden lg:flex origin-top"
  865. };
  866. var _hoisted_10 = {
  867. "class": "align-self-center"
  868. };
  869. var _hoisted_11 = {
  870. "class": "hidden lg:inline"
  871. };
  872. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  873. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  874. "class": "pi pi-user"
  875. }, null, -1
  876. /* HOISTED */
  877. );
  878. });
  879. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  880. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  881. /* HOISTED */
  882. );
  883. });
  884. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  885. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  886. "class": "pi pi-sign-out"
  887. }, null, -1
  888. /* HOISTED */
  889. );
  890. });
  891. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  892. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  893. /* HOISTED */
  894. );
  895. });
  896. function render(_ctx, _cache, $props, $setup, $data, $options) {
  897. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  898. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  899. 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"], {
  900. href: "/",
  901. "class": "layout-topbar-logo"
  902. }, {
  903. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  904. return [_hoisted_2, _hoisted_3];
  905. }),
  906. _: 1
  907. /* STABLE */
  908. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  909. "class": "p-link layout-menu-button layout-topbar-button",
  910. onClick: _cache[0] || (_cache[0] = function ($event) {
  911. return _ctx.$emit('menu-toggle', $event);
  912. })
  913. }, _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, {
  914. selector: '@next',
  915. enterClass: 'hidden',
  916. enterActiveClass: 'scalein',
  917. leaveToClass: 'hidden',
  918. leaveActiveClass: 'fadeout',
  919. hideOnOutsideClick: true
  920. }]]), (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
  921. /* TEXT */
  922. )]), (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"], {
  923. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  924. "class": "p-link layout-topbar-button"
  925. }, {
  926. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  927. return [_hoisted_12, _hoisted_13];
  928. }),
  929. _: 1
  930. /* STABLE */
  931. }, 8
  932. /* PROPS */
  933. , ["href"])), [[_directive_tooltip, {
  934. value: 'Ubah Profil',
  935. "class": 'layout-topbar-menu-tooltip'
  936. }, void 0, {
  937. bottom: true
  938. }]])]), (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"], {
  939. href: _ctx.route('logout'),
  940. as: "button",
  941. method: "post",
  942. "class": "p-link layout-topbar-button"
  943. }, {
  944. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  945. return [_hoisted_14, _hoisted_15];
  946. }),
  947. _: 1
  948. /* STABLE */
  949. }, 8
  950. /* PROPS */
  951. , ["href"])), [[_directive_tooltip, {
  952. value: 'Keluar',
  953. "class": 'layout-topbar-menu-tooltip'
  954. }, void 0, {
  955. bottom: true
  956. }]])])])]);
  957. }
  958. /***/ }),
  959. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  960. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  961. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  962. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  963. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  964. "use strict";
  965. __webpack_require__.r(__webpack_exports__);
  966. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  967. /* harmony export */ "render": () => (/* binding */ render)
  968. /* harmony export */ });
  969. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  970. var _withScopeId = function _withScopeId(n) {
  971. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  972. };
  973. var _hoisted_1 = {
  974. "class": "layout-sidebar"
  975. };
  976. var _hoisted_2 = {
  977. "class": "layout-main-container"
  978. };
  979. var _hoisted_3 = {
  980. "class": "layout-main"
  981. };
  982. var _hoisted_4 = {
  983. key: 0,
  984. "class": "layout-mask p-component-overlay"
  985. };
  986. function render(_ctx, _cache, $props, $setup, $data, $options) {
  987. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  988. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  989. onClick: $setup.onWrapperClick
  990. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  991. onMenuToggle: $setup.onMenuToggle
  992. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  993. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  994. }, null, 8
  995. /* PROPS */
  996. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  997. name: "layout-mask"
  998. }, {
  999. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1000. 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)];
  1001. }),
  1002. _: 1
  1003. /* STABLE */
  1004. })], 2
  1005. /* CLASS */
  1006. );
  1007. }
  1008. /***/ }),
  1009. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226":
  1010. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  1011. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  1012. \****************************************************************************************************************************************************************************************************************************************************************************/
  1013. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1014. "use strict";
  1015. __webpack_require__.r(__webpack_exports__);
  1016. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1017. /* harmony export */ "render": () => (/* binding */ render)
  1018. /* harmony export */ });
  1019. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1020. var _hoisted_1 = {
  1021. "class": "grid"
  1022. };
  1023. var _hoisted_2 = {
  1024. "class": "col-12 md:col-8"
  1025. };
  1026. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Ubah Member ");
  1027. var _hoisted_4 = {
  1028. "class": "grid"
  1029. };
  1030. var _hoisted_5 = {
  1031. "class": "col-12 md:col-6"
  1032. };
  1033. var _hoisted_6 = {
  1034. "class": "col-12 md:col-6"
  1035. };
  1036. var _hoisted_7 = {
  1037. "class": "col-12 md:col-6"
  1038. };
  1039. var _hoisted_8 = {
  1040. "class": "grid"
  1041. };
  1042. var _hoisted_9 = {
  1043. "class": "col-12 md:col-8"
  1044. };
  1045. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Detail Harga");
  1046. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1047. "class": "text-base font-bold mb-0"
  1048. }, "Jenis Member", -1
  1049. /* HOISTED */
  1050. );
  1051. var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1052. "class": "text-base font-bold mb-0"
  1053. }, "Batas Maksimal Kendaraan", -1
  1054. /* HOISTED */
  1055. );
  1056. var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1057. "class": "text-base font-bold mb-0"
  1058. }, "Keterangan", -1
  1059. /* HOISTED */
  1060. );
  1061. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1062. "class": "text-base font-bold mb-0"
  1063. }, "Tarif Member", -1
  1064. /* HOISTED */
  1065. );
  1066. var _hoisted_15 = {
  1067. key: 0,
  1068. "class": "grid"
  1069. };
  1070. var _hoisted_16 = {
  1071. "class": "col-12 md:col-8"
  1072. };
  1073. var _hoisted_17 = {
  1074. "class": "grid"
  1075. };
  1076. var _hoisted_18 = {
  1077. "class": "col-12 md:col-6"
  1078. };
  1079. var _hoisted_19 = {
  1080. "class": "col-12 md:col-6"
  1081. };
  1082. var _hoisted_20 = {
  1083. "class": "col-12 mb-3 md:mb-0"
  1084. };
  1085. var _hoisted_21 = {
  1086. "class": "flex flex-column md:flex-row md:align-items-center justify-content-end"
  1087. };
  1088. var _hoisted_22 = {
  1089. "class": "col-12"
  1090. };
  1091. var _hoisted_23 = {
  1092. style: {
  1093. "color": "#b71c1c"
  1094. }
  1095. };
  1096. var _hoisted_24 = {
  1097. "class": "flex justify-content-end"
  1098. };
  1099. var _hoisted_25 = {
  1100. "class": "grid"
  1101. };
  1102. var _hoisted_26 = {
  1103. "class": "col-12 flex flex-column md:flex-row justify-content-center md:justify-content-end"
  1104. };
  1105. function render(_ctx, _cache, $props, $setup, $data, $options) {
  1106. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  1107. var _component_Dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dialog");
  1108. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  1109. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  1110. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  1111. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  1112. 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"], {
  1113. title: "Ubah Member"
  1114. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  1115. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1116. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dialog, {
  1117. modal: "",
  1118. header: "Error",
  1119. visible: $setup.errorSubmitVisible,
  1120. "onUpdate:visible": _cache[0] || (_cache[0] = function ($event) {
  1121. return $setup.errorSubmitVisible = $event;
  1122. }),
  1123. contentStyle: "color: #b71c1c",
  1124. closable: false,
  1125. style: {
  1126. width: '40vw'
  1127. }
  1128. }, {
  1129. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1130. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.errorSubmitText), 1
  1131. /* TEXT */
  1132. )];
  1133. }),
  1134. _: 1
  1135. /* STABLE */
  1136. }, 8
  1137. /* PROPS */
  1138. , ["visible"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1139. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1140. return [_hoisted_3];
  1141. }),
  1142. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1143. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1144. modelValue: $setup.form.name,
  1145. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  1146. return $setup.form.name = $event;
  1147. }),
  1148. label: "Nama",
  1149. placeholder: "nama",
  1150. error: $setup.form.errors.name
  1151. }, null, 8
  1152. /* PROPS */
  1153. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1154. modelValue: $setup.form.phone,
  1155. "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
  1156. return $setup.form.phone = $event;
  1157. }),
  1158. label: "Nomor HP",
  1159. placeholder: "nomor hp",
  1160. error: $setup.form.errors.phone
  1161. }, null, 8
  1162. /* PROPS */
  1163. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1164. label: "Jenis member",
  1165. placeholder: "pilih satu",
  1166. modelValue: $setup.form.type_member_id,
  1167. "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
  1168. return $setup.form.type_member_id = $event;
  1169. }),
  1170. options: $props.typeMembers,
  1171. error: $setup.form.errors.type_member_id
  1172. }, null, 8
  1173. /* PROPS */
  1174. , ["modelValue", "options", "error"])])])];
  1175. }),
  1176. _: 1
  1177. /* STABLE */
  1178. })])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, {
  1179. "class": "bg-primary"
  1180. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  1181. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1182. return [_hoisted_10];
  1183. }),
  1184. _: 2
  1185. /* DYNAMIC */
  1186. }, [$props.typeMember ? {
  1187. name: "content",
  1188. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1189. return [_hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.type), 1
  1190. /* TEXT */
  1191. ), _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.max), 1
  1192. /* TEXT */
  1193. ), _hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.description), 1
  1194. /* TEXT */
  1195. ), _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.price), 1
  1196. /* TEXT */
  1197. )];
  1198. })
  1199. } : undefined]), 1024
  1200. /* DYNAMIC_SLOTS */
  1201. )])]), $props.typeMember ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_15, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_16, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1202. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1203. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1204. modelValue: $setup.form.plat_number,
  1205. "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
  1206. return $setup.form.plat_number = $event;
  1207. }),
  1208. label: "Plat Kendaraan",
  1209. placeholder: "plat kendaraan",
  1210. disabled: !$setup.form.type_member_id,
  1211. error: $setup.form.errors.plat_number
  1212. }, null, 8
  1213. /* PROPS */
  1214. , ["modelValue", "disabled", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_19, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1215. modelValue: $setup.form.max_vehicle_id,
  1216. "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
  1217. return $setup.form.max_vehicle_id = $event;
  1218. }),
  1219. label: "Jenis Kendaraan",
  1220. placeholder: "jenis kendaraan",
  1221. disabled: !$setup.form.type_member_id,
  1222. options: $props.typeMember.maxVehicles,
  1223. error: $setup.form.errors.max_vehicle_id
  1224. }, null, 8
  1225. /* PROPS */
  1226. , ["modelValue", "disabled", "options", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_20, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_21, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1227. label: "Tambah",
  1228. "class": "p-button-outlined",
  1229. icon: "pi pi-car",
  1230. disabled: !$setup.form.type_member_id,
  1231. onClick: $setup.vehicleOnAdd
  1232. }, null, 8
  1233. /* PROPS */
  1234. , ["disabled", "onClick"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_22, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  1235. "striped-rows": "",
  1236. "row-hover": "",
  1237. "responsive-layout": "scroll",
  1238. "column-resize-mode": "expand",
  1239. "edit-mode": "cell",
  1240. value: $setup.listVehicle
  1241. }, {
  1242. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1243. 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.platNumberTable, function (value) {
  1244. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  1245. field: value.field,
  1246. header: value.header,
  1247. key: value.field
  1248. }, null, 8
  1249. /* PROPS */
  1250. , ["field", "header"]);
  1251. }), 128
  1252. /* KEYED_FRAGMENT */
  1253. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1254. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1255. var index = _ref.index;
  1256. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_23, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]), 1
  1257. /* TEXT */
  1258. )];
  1259. }),
  1260. _: 1
  1261. /* STABLE */
  1262. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1263. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  1264. var index = _ref2.index;
  1265. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_24, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1266. icon: "pi pi-trash",
  1267. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-rounded p-button-text", {
  1268. 'p-button-danger': _ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]
  1269. }]),
  1270. onClick: function onClick($event) {
  1271. return $setup.vehicleOnDelete(index);
  1272. }
  1273. }, null, 8
  1274. /* PROPS */
  1275. , ["class", "onClick"])])];
  1276. }),
  1277. _: 1
  1278. /* STABLE */
  1279. })];
  1280. }),
  1281. _: 1
  1282. /* STABLE */
  1283. }, 8
  1284. /* PROPS */
  1285. , ["value"])])])];
  1286. }),
  1287. footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1288. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_25, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_26, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1289. label: "Simpan",
  1290. icon: "pi pi-check",
  1291. "class": "p-button-outlined",
  1292. disabled: $setup.form.processing || $setup.listVehicle.length === 0,
  1293. onClick: $setup.onSubmit
  1294. }, null, 8
  1295. /* PROPS */
  1296. , ["disabled"])])])];
  1297. }),
  1298. _: 1
  1299. /* STABLE */
  1300. })])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1301. }),
  1302. _: 1
  1303. /* STABLE */
  1304. })], 64
  1305. /* STABLE_FRAGMENT */
  1306. );
  1307. }
  1308. /***/ }),
  1309. /***/ "./resources/js/components/useFormErrorReset.js":
  1310. /*!******************************************************!*\
  1311. !*** ./resources/js/components/useFormErrorReset.js ***!
  1312. \******************************************************/
  1313. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1314. "use strict";
  1315. __webpack_require__.r(__webpack_exports__);
  1316. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1317. /* harmony export */ "useFormErrorReset": () => (/* binding */ useFormErrorReset)
  1318. /* harmony export */ });
  1319. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1320. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1321. function useFormErrorReset(form) {
  1322. var errors = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  1323. return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.errors;
  1324. });
  1325. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(errors, function () {
  1326. form.clearErrors();
  1327. });
  1328. }
  1329. /***/ }),
  1330. /***/ "./resources/js/pages/member/tableHeader.js":
  1331. /*!**************************************************!*\
  1332. !*** ./resources/js/pages/member/tableHeader.js ***!
  1333. \**************************************************/
  1334. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1335. "use strict";
  1336. __webpack_require__.r(__webpack_exports__);
  1337. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1338. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1339. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  1340. /* harmony export */ });
  1341. var indexTable = [{
  1342. field: 'updatedAt',
  1343. header: 'Diperbaharui'
  1344. }, {
  1345. field: 'name',
  1346. header: 'Nama'
  1347. }, {
  1348. field: 'platNumber',
  1349. header: 'Plat Kendaraan'
  1350. }, {
  1351. field: 'type',
  1352. header: 'Jenis Member'
  1353. }, {
  1354. field: 'price',
  1355. header: 'Tarif Member'
  1356. }, {
  1357. field: 'expDate',
  1358. header: 'Berakhir'
  1359. }];
  1360. var platNumberTable = [{
  1361. field: 'platNumber',
  1362. header: 'Plat Kendaraan'
  1363. }, {
  1364. field: 'typeVehicle',
  1365. header: 'Jenis Kendaraan'
  1366. }];
  1367. /***/ }),
  1368. /***/ "./resources/js/pages/member/useVehicle.js":
  1369. /*!*************************************************!*\
  1370. !*** ./resources/js/pages/member/useVehicle.js ***!
  1371. \*************************************************/
  1372. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1373. "use strict";
  1374. __webpack_require__.r(__webpack_exports__);
  1375. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1376. /* harmony export */ "useVehicle": () => (/* binding */ useVehicle)
  1377. /* harmony export */ });
  1378. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1379. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  1380. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1381. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  1382. function useVehicle(props, form) {
  1383. var listVehicle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)([]);
  1384. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1385. if (props.initialVehicles) {
  1386. props.initialVehicles.forEach(function (val) {
  1387. return listVehicle.push(val);
  1388. });
  1389. }
  1390. });
  1391. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
  1392. return form.type_member_id;
  1393. }, function () {
  1394. vehicleClear();
  1395. form.reset('plat_number', 'max_vehicle_id');
  1396. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  1397. only: ['typeMember'],
  1398. data: {
  1399. id: form.type_member_id
  1400. }
  1401. });
  1402. });
  1403. var vehicleClear = function vehicleClear() {
  1404. listVehicle.splice(0);
  1405. };
  1406. var vehicleOnDelete = function vehicleOnDelete(index) {
  1407. listVehicle.splice(index, 1);
  1408. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage)().props.value.errors = {};
  1409. };
  1410. var vehicleAddValidation = function vehicleAddValidation() {
  1411. if (!form.plat_number) {
  1412. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Plat kendaraan tidak boleh kosong', 'plat_number');
  1413. }
  1414. if (!form.max_vehicle_id) {
  1415. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Tidak boleh kosong', 'max_vehicle_id');
  1416. }
  1417. var platNumberExist = listVehicle.filter(function (vehicle) {
  1418. return vehicle.platNumber === form.plat_number.toUpperCase();
  1419. });
  1420. if (platNumberExist.length) {
  1421. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Nomor plat kendaraan tidak boleh sama', 'plat_number');
  1422. }
  1423. var maxVehicles = listVehicle.filter(function (vehicle) {
  1424. return vehicle.maxVehicleId === form.max_vehicle_id;
  1425. });
  1426. if (maxVehicles.length) {
  1427. if (maxVehicles.length + 1 > maxVehicles[0].maxVehicle) {
  1428. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Melibihi batas maksimal kendaraan', 'plat_number');
  1429. }
  1430. }
  1431. };
  1432. var vehicleOnAdd = function vehicleOnAdd() {
  1433. try {
  1434. form.clearErrors('plat_number', 'max_vehicle_id');
  1435. vehicleAddValidation();
  1436. var typeVehicle = props.typeMember.maxVehicles.filter(function (maxVehicle) {
  1437. return maxVehicle.value === form.max_vehicle_id;
  1438. })[0];
  1439. listVehicle.push({
  1440. platNumber: form.plat_number.toUpperCase(),
  1441. typeVehicle: typeVehicle.label,
  1442. typeVehicleId: typeVehicle.typeVehicleId,
  1443. maxVehicleId: typeVehicle.value,
  1444. maxVehicle: typeVehicle.maxVehicle
  1445. });
  1446. form.reset('plat_number', 'max_vehicle_id');
  1447. } catch (err) {
  1448. form.setError(err.field, err.message);
  1449. }
  1450. };
  1451. return {
  1452. listVehicle: listVehicle,
  1453. vehicleClear: vehicleClear,
  1454. vehicleOnDelete: vehicleOnDelete,
  1455. vehicleOnAdd: vehicleOnAdd
  1456. };
  1457. }
  1458. /***/ }),
  1459. /***/ "./resources/js/utils/formValidationError.js":
  1460. /*!***************************************************!*\
  1461. !*** ./resources/js/utils/formValidationError.js ***!
  1462. \***************************************************/
  1463. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1464. "use strict";
  1465. __webpack_require__.r(__webpack_exports__);
  1466. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1467. /* harmony export */ "default": () => (/* binding */ FormValidationError)
  1468. /* harmony export */ });
  1469. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  1470. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1471. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  1472. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1473. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1474. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1475. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
  1476. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1477. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  1478. function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  1479. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1480. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  1481. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1482. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1483. var FormValidationError = /*#__PURE__*/function (_Error) {
  1484. _inherits(FormValidationError, _Error);
  1485. var _super = _createSuper(FormValidationError);
  1486. function FormValidationError(message, field) {
  1487. var _this;
  1488. _classCallCheck(this, FormValidationError);
  1489. _this = _super.call(this, message);
  1490. _this.field = field;
  1491. return _this;
  1492. }
  1493. return _createClass(FormValidationError);
  1494. }( /*#__PURE__*/_wrapNativeSuper(Error));
  1495. /***/ }),
  1496. /***/ "./resources/js/utils/menu.js":
  1497. /*!************************************!*\
  1498. !*** ./resources/js/utils/menu.js ***!
  1499. \************************************/
  1500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1501. "use strict";
  1502. __webpack_require__.r(__webpack_exports__);
  1503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1504. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1505. /* harmony export */ });
  1506. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1507. // Admin
  1508. 1: [{
  1509. label: 'Home',
  1510. items: [{
  1511. label: 'Dashboard',
  1512. icon: 'pi pi-home',
  1513. to: '/dashboards',
  1514. component: 'home/Index'
  1515. }]
  1516. }, {
  1517. label: 'Master',
  1518. items: [{
  1519. label: 'User',
  1520. icon: 'pi pi-user',
  1521. to: '/users',
  1522. component: 'user/Index'
  1523. }]
  1524. }],
  1525. // Supervisor
  1526. 2: [{
  1527. label: 'Home',
  1528. items: [{
  1529. label: 'Dashboard',
  1530. icon: 'pi pi-home',
  1531. to: '/dashboards',
  1532. component: 'home/Index'
  1533. }]
  1534. }, {
  1535. label: 'Menu',
  1536. items: [{
  1537. label: 'Pengeluaran',
  1538. icon: 'pi pi-wallet',
  1539. to: '/expenses',
  1540. component: 'expense/Index'
  1541. }, {
  1542. label: 'Laporan',
  1543. icon: 'pi pi-book',
  1544. items: [{
  1545. label: 'Mutasi',
  1546. icon: 'pi pi-circle',
  1547. to: '/reports/mutations',
  1548. component: 'mutation/Report'
  1549. }]
  1550. }]
  1551. }, {
  1552. label: 'Master',
  1553. items: [{
  1554. label: 'Jenis Kendaraan',
  1555. icon: 'pi pi-car',
  1556. to: '/type-vehicles',
  1557. component: 'typevehicle/Index'
  1558. }, {
  1559. label: 'Jenis Member',
  1560. icon: 'pi pi-id-card',
  1561. to: '/type-members',
  1562. component: 'typemember/Index'
  1563. }]
  1564. }, {
  1565. label: 'Pengaturan',
  1566. items: [{
  1567. label: 'Tarif Parkir',
  1568. icon: 'pi pi-car',
  1569. to: '/parking-fees/create',
  1570. component: 'parkingfee/Create'
  1571. }]
  1572. }],
  1573. // Operator
  1574. 3: [{
  1575. label: 'Home',
  1576. items: [{
  1577. label: 'Dashboard',
  1578. icon: 'pi pi-home',
  1579. to: '/dashboards',
  1580. component: 'home/Index'
  1581. }]
  1582. }, {
  1583. label: 'Transaksi',
  1584. items: [{
  1585. label: 'Transaksi masuk dan keluar',
  1586. icon: 'pi pi-car',
  1587. to: '/transactions/create',
  1588. component: 'transaction/Create'
  1589. }]
  1590. }, {
  1591. label: 'Menu',
  1592. items: [{
  1593. label: 'Pengeluaran',
  1594. icon: 'pi pi-wallet',
  1595. to: '/expenses',
  1596. component: 'expense/Index'
  1597. }, {
  1598. label: 'Member',
  1599. icon: 'pi pi-id-card',
  1600. to: '/members',
  1601. component: 'member/Index'
  1602. }, {
  1603. label: 'Top Up',
  1604. icon: 'pi pi-car',
  1605. to: '/top-ups',
  1606. component: 'topup/Index'
  1607. }]
  1608. }]
  1609. });
  1610. /***/ }),
  1611. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1612. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1613. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1614. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1615. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1616. "use strict";
  1617. __webpack_require__.r(__webpack_exports__);
  1618. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1619. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1620. /* harmony export */ });
  1621. /* 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");
  1622. /* 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__);
  1623. // Imports
  1624. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1625. // Module
  1626. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1627. // Exports
  1628. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1629. /***/ }),
  1630. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1631. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1632. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1633. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1634. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1635. "use strict";
  1636. __webpack_require__.r(__webpack_exports__);
  1637. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1638. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1639. /* harmony export */ });
  1640. /* 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");
  1641. /* 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__);
  1642. // Imports
  1643. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1644. // Module
  1645. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1646. // Exports
  1647. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1648. /***/ }),
  1649. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1650. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1651. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1652. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1653. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1654. "use strict";
  1655. __webpack_require__.r(__webpack_exports__);
  1656. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1657. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1658. /* harmony export */ });
  1659. /* 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");
  1660. /* 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__);
  1661. // Imports
  1662. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1663. // Module
  1664. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1665. // Exports
  1666. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1667. /***/ }),
  1668. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1669. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1670. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1671. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1672. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1673. "use strict";
  1674. __webpack_require__.r(__webpack_exports__);
  1675. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1676. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1677. /* harmony export */ });
  1678. /* 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");
  1679. /* 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__);
  1680. // Imports
  1681. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1682. // Module
  1683. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1684. // Exports
  1685. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1686. /***/ }),
  1687. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1688. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1689. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1690. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1691. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1692. "use strict";
  1693. __webpack_require__.r(__webpack_exports__);
  1694. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1695. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1696. /* harmony export */ });
  1697. /* 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");
  1698. /* 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__);
  1699. // Imports
  1700. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1701. // Module
  1702. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1703. // Exports
  1704. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1705. /***/ }),
  1706. /***/ "./node_modules/lodash/lodash.js":
  1707. /*!***************************************!*\
  1708. !*** ./node_modules/lodash/lodash.js ***!
  1709. \***************************************/
  1710. /***/ (function(module, exports, __webpack_require__) {
  1711. /* module decorator */ module = __webpack_require__.nmd(module);
  1712. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1713. * @license
  1714. * Lodash <https://lodash.com/>
  1715. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1716. * Released under MIT license <https://lodash.com/license>
  1717. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1718. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1719. */
  1720. ;(function() {
  1721. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1722. var undefined;
  1723. /** Used as the semantic version number. */
  1724. var VERSION = '4.17.21';
  1725. /** Used as the size to enable large array optimizations. */
  1726. var LARGE_ARRAY_SIZE = 200;
  1727. /** Error message constants. */
  1728. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1729. FUNC_ERROR_TEXT = 'Expected a function',
  1730. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1731. /** Used to stand-in for `undefined` hash values. */
  1732. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1733. /** Used as the maximum memoize cache size. */
  1734. var MAX_MEMOIZE_SIZE = 500;
  1735. /** Used as the internal argument placeholder. */
  1736. var PLACEHOLDER = '__lodash_placeholder__';
  1737. /** Used to compose bitmasks for cloning. */
  1738. var CLONE_DEEP_FLAG = 1,
  1739. CLONE_FLAT_FLAG = 2,
  1740. CLONE_SYMBOLS_FLAG = 4;
  1741. /** Used to compose bitmasks for value comparisons. */
  1742. var COMPARE_PARTIAL_FLAG = 1,
  1743. COMPARE_UNORDERED_FLAG = 2;
  1744. /** Used to compose bitmasks for function metadata. */
  1745. var WRAP_BIND_FLAG = 1,
  1746. WRAP_BIND_KEY_FLAG = 2,
  1747. WRAP_CURRY_BOUND_FLAG = 4,
  1748. WRAP_CURRY_FLAG = 8,
  1749. WRAP_CURRY_RIGHT_FLAG = 16,
  1750. WRAP_PARTIAL_FLAG = 32,
  1751. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1752. WRAP_ARY_FLAG = 128,
  1753. WRAP_REARG_FLAG = 256,
  1754. WRAP_FLIP_FLAG = 512;
  1755. /** Used as default options for `_.truncate`. */
  1756. var DEFAULT_TRUNC_LENGTH = 30,
  1757. DEFAULT_TRUNC_OMISSION = '...';
  1758. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1759. var HOT_COUNT = 800,
  1760. HOT_SPAN = 16;
  1761. /** Used to indicate the type of lazy iteratees. */
  1762. var LAZY_FILTER_FLAG = 1,
  1763. LAZY_MAP_FLAG = 2,
  1764. LAZY_WHILE_FLAG = 3;
  1765. /** Used as references for various `Number` constants. */
  1766. var INFINITY = 1 / 0,
  1767. MAX_SAFE_INTEGER = 9007199254740991,
  1768. MAX_INTEGER = 1.7976931348623157e+308,
  1769. NAN = 0 / 0;
  1770. /** Used as references for the maximum length and index of an array. */
  1771. var MAX_ARRAY_LENGTH = 4294967295,
  1772. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1773. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1774. /** Used to associate wrap methods with their bit flags. */
  1775. var wrapFlags = [
  1776. ['ary', WRAP_ARY_FLAG],
  1777. ['bind', WRAP_BIND_FLAG],
  1778. ['bindKey', WRAP_BIND_KEY_FLAG],
  1779. ['curry', WRAP_CURRY_FLAG],
  1780. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1781. ['flip', WRAP_FLIP_FLAG],
  1782. ['partial', WRAP_PARTIAL_FLAG],
  1783. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1784. ['rearg', WRAP_REARG_FLAG]
  1785. ];
  1786. /** `Object#toString` result references. */
  1787. var argsTag = '[object Arguments]',
  1788. arrayTag = '[object Array]',
  1789. asyncTag = '[object AsyncFunction]',
  1790. boolTag = '[object Boolean]',
  1791. dateTag = '[object Date]',
  1792. domExcTag = '[object DOMException]',
  1793. errorTag = '[object Error]',
  1794. funcTag = '[object Function]',
  1795. genTag = '[object GeneratorFunction]',
  1796. mapTag = '[object Map]',
  1797. numberTag = '[object Number]',
  1798. nullTag = '[object Null]',
  1799. objectTag = '[object Object]',
  1800. promiseTag = '[object Promise]',
  1801. proxyTag = '[object Proxy]',
  1802. regexpTag = '[object RegExp]',
  1803. setTag = '[object Set]',
  1804. stringTag = '[object String]',
  1805. symbolTag = '[object Symbol]',
  1806. undefinedTag = '[object Undefined]',
  1807. weakMapTag = '[object WeakMap]',
  1808. weakSetTag = '[object WeakSet]';
  1809. var arrayBufferTag = '[object ArrayBuffer]',
  1810. dataViewTag = '[object DataView]',
  1811. float32Tag = '[object Float32Array]',
  1812. float64Tag = '[object Float64Array]',
  1813. int8Tag = '[object Int8Array]',
  1814. int16Tag = '[object Int16Array]',
  1815. int32Tag = '[object Int32Array]',
  1816. uint8Tag = '[object Uint8Array]',
  1817. uint8ClampedTag = '[object Uint8ClampedArray]',
  1818. uint16Tag = '[object Uint16Array]',
  1819. uint32Tag = '[object Uint32Array]';
  1820. /** Used to match empty string literals in compiled template source. */
  1821. var reEmptyStringLeading = /\b__p \+= '';/g,
  1822. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1823. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1824. /** Used to match HTML entities and HTML characters. */
  1825. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1826. reUnescapedHtml = /[&<>"']/g,
  1827. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1828. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1829. /** Used to match template delimiters. */
  1830. var reEscape = /<%-([\s\S]+?)%>/g,
  1831. reEvaluate = /<%([\s\S]+?)%>/g,
  1832. reInterpolate = /<%=([\s\S]+?)%>/g;
  1833. /** Used to match property names within property paths. */
  1834. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1835. reIsPlainProp = /^\w*$/,
  1836. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1837. /**
  1838. * Used to match `RegExp`
  1839. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1840. */
  1841. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1842. reHasRegExpChar = RegExp(reRegExpChar.source);
  1843. /** Used to match leading whitespace. */
  1844. var reTrimStart = /^\s+/;
  1845. /** Used to match a single whitespace character. */
  1846. var reWhitespace = /\s/;
  1847. /** Used to match wrap detail comments. */
  1848. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1849. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1850. reSplitDetails = /,? & /;
  1851. /** Used to match words composed of alphanumeric characters. */
  1852. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1853. /**
  1854. * Used to validate the `validate` option in `_.template` variable.
  1855. *
  1856. * Forbids characters which could potentially change the meaning of the function argument definition:
  1857. * - "()," (modification of function parameters)
  1858. * - "=" (default value)
  1859. * - "[]{}" (destructuring of function parameters)
  1860. * - "/" (beginning of a comment)
  1861. * - whitespace
  1862. */
  1863. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1864. /** Used to match backslashes in property paths. */
  1865. var reEscapeChar = /\\(\\)?/g;
  1866. /**
  1867. * Used to match
  1868. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1869. */
  1870. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1871. /** Used to match `RegExp` flags from their coerced string values. */
  1872. var reFlags = /\w*$/;
  1873. /** Used to detect bad signed hexadecimal string values. */
  1874. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1875. /** Used to detect binary string values. */
  1876. var reIsBinary = /^0b[01]+$/i;
  1877. /** Used to detect host constructors (Safari). */
  1878. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1879. /** Used to detect octal string values. */
  1880. var reIsOctal = /^0o[0-7]+$/i;
  1881. /** Used to detect unsigned integer values. */
  1882. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1883. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1884. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1885. /** Used to ensure capturing order of template delimiters. */
  1886. var reNoMatch = /($^)/;
  1887. /** Used to match unescaped characters in compiled string literals. */
  1888. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1889. /** Used to compose unicode character classes. */
  1890. var rsAstralRange = '\\ud800-\\udfff',
  1891. rsComboMarksRange = '\\u0300-\\u036f',
  1892. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1893. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1894. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1895. rsDingbatRange = '\\u2700-\\u27bf',
  1896. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1897. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1898. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1899. rsPunctuationRange = '\\u2000-\\u206f',
  1900. 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',
  1901. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1902. rsVarRange = '\\ufe0e\\ufe0f',
  1903. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1904. /** Used to compose unicode capture groups. */
  1905. var rsApos = "['\u2019]",
  1906. rsAstral = '[' + rsAstralRange + ']',
  1907. rsBreak = '[' + rsBreakRange + ']',
  1908. rsCombo = '[' + rsComboRange + ']',
  1909. rsDigits = '\\d+',
  1910. rsDingbat = '[' + rsDingbatRange + ']',
  1911. rsLower = '[' + rsLowerRange + ']',
  1912. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1913. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1914. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1915. rsNonAstral = '[^' + rsAstralRange + ']',
  1916. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1917. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1918. rsUpper = '[' + rsUpperRange + ']',
  1919. rsZWJ = '\\u200d';
  1920. /** Used to compose unicode regexes. */
  1921. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1922. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1923. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1924. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1925. reOptMod = rsModifier + '?',
  1926. rsOptVar = '[' + rsVarRange + ']?',
  1927. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1928. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1929. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1930. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1931. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1932. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1933. /** Used to match apostrophes. */
  1934. var reApos = RegExp(rsApos, 'g');
  1935. /**
  1936. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1937. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1938. */
  1939. var reComboMark = RegExp(rsCombo, 'g');
  1940. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1941. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1942. /** Used to match complex or compound words. */
  1943. var reUnicodeWord = RegExp([
  1944. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1945. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1946. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1947. rsUpper + '+' + rsOptContrUpper,
  1948. rsOrdUpper,
  1949. rsOrdLower,
  1950. rsDigits,
  1951. rsEmoji
  1952. ].join('|'), 'g');
  1953. /** 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/). */
  1954. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1955. /** Used to detect strings that need a more robust regexp to match words. */
  1956. 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 ]/;
  1957. /** Used to assign default `context` object properties. */
  1958. var contextProps = [
  1959. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1960. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1961. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1962. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1963. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1964. ];
  1965. /** Used to make template sourceURLs easier to identify. */
  1966. var templateCounter = -1;
  1967. /** Used to identify `toStringTag` values of typed arrays. */
  1968. var typedArrayTags = {};
  1969. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1970. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1971. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1972. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1973. typedArrayTags[uint32Tag] = true;
  1974. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1975. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1976. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1977. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1978. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1979. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1980. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1981. typedArrayTags[weakMapTag] = false;
  1982. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1983. var cloneableTags = {};
  1984. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1985. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1986. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1987. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1988. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1989. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1990. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1991. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1992. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1993. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1994. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1995. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1996. cloneableTags[weakMapTag] = false;
  1997. /** Used to map Latin Unicode letters to basic Latin letters. */
  1998. var deburredLetters = {
  1999. // Latin-1 Supplement block.
  2000. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  2001. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  2002. '\xc7': 'C', '\xe7': 'c',
  2003. '\xd0': 'D', '\xf0': 'd',
  2004. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  2005. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  2006. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  2007. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  2008. '\xd1': 'N', '\xf1': 'n',
  2009. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  2010. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  2011. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  2012. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  2013. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  2014. '\xc6': 'Ae', '\xe6': 'ae',
  2015. '\xde': 'Th', '\xfe': 'th',
  2016. '\xdf': 'ss',
  2017. // Latin Extended-A block.
  2018. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  2019. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  2020. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  2021. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  2022. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  2023. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  2024. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  2025. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  2026. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  2027. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  2028. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  2029. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  2030. '\u0134': 'J', '\u0135': 'j',
  2031. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  2032. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  2033. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  2034. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  2035. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  2036. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  2037. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  2038. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  2039. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  2040. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  2041. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  2042. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  2043. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  2044. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  2045. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  2046. '\u0174': 'W', '\u0175': 'w',
  2047. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  2048. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  2049. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  2050. '\u0132': 'IJ', '\u0133': 'ij',
  2051. '\u0152': 'Oe', '\u0153': 'oe',
  2052. '\u0149': "'n", '\u017f': 's'
  2053. };
  2054. /** Used to map characters to HTML entities. */
  2055. var htmlEscapes = {
  2056. '&': '&amp;',
  2057. '<': '&lt;',
  2058. '>': '&gt;',
  2059. '"': '&quot;',
  2060. "'": '&#39;'
  2061. };
  2062. /** Used to map HTML entities to characters. */
  2063. var htmlUnescapes = {
  2064. '&amp;': '&',
  2065. '&lt;': '<',
  2066. '&gt;': '>',
  2067. '&quot;': '"',
  2068. '&#39;': "'"
  2069. };
  2070. /** Used to escape characters for inclusion in compiled string literals. */
  2071. var stringEscapes = {
  2072. '\\': '\\',
  2073. "'": "'",
  2074. '\n': 'n',
  2075. '\r': 'r',
  2076. '\u2028': 'u2028',
  2077. '\u2029': 'u2029'
  2078. };
  2079. /** Built-in method references without a dependency on `root`. */
  2080. var freeParseFloat = parseFloat,
  2081. freeParseInt = parseInt;
  2082. /** Detect free variable `global` from Node.js. */
  2083. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2084. /** Detect free variable `self`. */
  2085. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  2086. /** Used as a reference to the global object. */
  2087. var root = freeGlobal || freeSelf || Function('return this')();
  2088. /** Detect free variable `exports`. */
  2089. var freeExports = true && exports && !exports.nodeType && exports;
  2090. /** Detect free variable `module`. */
  2091. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  2092. /** Detect the popular CommonJS extension `module.exports`. */
  2093. var moduleExports = freeModule && freeModule.exports === freeExports;
  2094. /** Detect free variable `process` from Node.js. */
  2095. var freeProcess = moduleExports && freeGlobal.process;
  2096. /** Used to access faster Node.js helpers. */
  2097. var nodeUtil = (function() {
  2098. try {
  2099. // Use `util.types` for Node.js 10+.
  2100. var types = freeModule && freeModule.require && freeModule.require('util').types;
  2101. if (types) {
  2102. return types;
  2103. }
  2104. // Legacy `process.binding('util')` for Node.js < 10.
  2105. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  2106. } catch (e) {}
  2107. }());
  2108. /* Node.js helper references. */
  2109. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  2110. nodeIsDate = nodeUtil && nodeUtil.isDate,
  2111. nodeIsMap = nodeUtil && nodeUtil.isMap,
  2112. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  2113. nodeIsSet = nodeUtil && nodeUtil.isSet,
  2114. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2115. /*--------------------------------------------------------------------------*/
  2116. /**
  2117. * A faster alternative to `Function#apply`, this function invokes `func`
  2118. * with the `this` binding of `thisArg` and the arguments of `args`.
  2119. *
  2120. * @private
  2121. * @param {Function} func The function to invoke.
  2122. * @param {*} thisArg The `this` binding of `func`.
  2123. * @param {Array} args The arguments to invoke `func` with.
  2124. * @returns {*} Returns the result of `func`.
  2125. */
  2126. function apply(func, thisArg, args) {
  2127. switch (args.length) {
  2128. case 0: return func.call(thisArg);
  2129. case 1: return func.call(thisArg, args[0]);
  2130. case 2: return func.call(thisArg, args[0], args[1]);
  2131. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  2132. }
  2133. return func.apply(thisArg, args);
  2134. }
  2135. /**
  2136. * A specialized version of `baseAggregator` for arrays.
  2137. *
  2138. * @private
  2139. * @param {Array} [array] The array to iterate over.
  2140. * @param {Function} setter The function to set `accumulator` values.
  2141. * @param {Function} iteratee The iteratee to transform keys.
  2142. * @param {Object} accumulator The initial aggregated object.
  2143. * @returns {Function} Returns `accumulator`.
  2144. */
  2145. function arrayAggregator(array, setter, iteratee, accumulator) {
  2146. var index = -1,
  2147. length = array == null ? 0 : array.length;
  2148. while (++index < length) {
  2149. var value = array[index];
  2150. setter(accumulator, value, iteratee(value), array);
  2151. }
  2152. return accumulator;
  2153. }
  2154. /**
  2155. * A specialized version of `_.forEach` for arrays without support for
  2156. * iteratee shorthands.
  2157. *
  2158. * @private
  2159. * @param {Array} [array] The array to iterate over.
  2160. * @param {Function} iteratee The function invoked per iteration.
  2161. * @returns {Array} Returns `array`.
  2162. */
  2163. function arrayEach(array, iteratee) {
  2164. var index = -1,
  2165. length = array == null ? 0 : array.length;
  2166. while (++index < length) {
  2167. if (iteratee(array[index], index, array) === false) {
  2168. break;
  2169. }
  2170. }
  2171. return array;
  2172. }
  2173. /**
  2174. * A specialized version of `_.forEachRight` for arrays without support for
  2175. * iteratee shorthands.
  2176. *
  2177. * @private
  2178. * @param {Array} [array] The array to iterate over.
  2179. * @param {Function} iteratee The function invoked per iteration.
  2180. * @returns {Array} Returns `array`.
  2181. */
  2182. function arrayEachRight(array, iteratee) {
  2183. var length = array == null ? 0 : array.length;
  2184. while (length--) {
  2185. if (iteratee(array[length], length, array) === false) {
  2186. break;
  2187. }
  2188. }
  2189. return array;
  2190. }
  2191. /**
  2192. * A specialized version of `_.every` for arrays without support for
  2193. * iteratee shorthands.
  2194. *
  2195. * @private
  2196. * @param {Array} [array] The array to iterate over.
  2197. * @param {Function} predicate The function invoked per iteration.
  2198. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  2199. * else `false`.
  2200. */
  2201. function arrayEvery(array, predicate) {
  2202. var index = -1,
  2203. length = array == null ? 0 : array.length;
  2204. while (++index < length) {
  2205. if (!predicate(array[index], index, array)) {
  2206. return false;
  2207. }
  2208. }
  2209. return true;
  2210. }
  2211. /**
  2212. * A specialized version of `_.filter` for arrays without support for
  2213. * iteratee shorthands.
  2214. *
  2215. * @private
  2216. * @param {Array} [array] The array to iterate over.
  2217. * @param {Function} predicate The function invoked per iteration.
  2218. * @returns {Array} Returns the new filtered array.
  2219. */
  2220. function arrayFilter(array, predicate) {
  2221. var index = -1,
  2222. length = array == null ? 0 : array.length,
  2223. resIndex = 0,
  2224. result = [];
  2225. while (++index < length) {
  2226. var value = array[index];
  2227. if (predicate(value, index, array)) {
  2228. result[resIndex++] = value;
  2229. }
  2230. }
  2231. return result;
  2232. }
  2233. /**
  2234. * A specialized version of `_.includes` for arrays without support for
  2235. * specifying an index to search from.
  2236. *
  2237. * @private
  2238. * @param {Array} [array] The array to inspect.
  2239. * @param {*} target The value to search for.
  2240. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2241. */
  2242. function arrayIncludes(array, value) {
  2243. var length = array == null ? 0 : array.length;
  2244. return !!length && baseIndexOf(array, value, 0) > -1;
  2245. }
  2246. /**
  2247. * This function is like `arrayIncludes` except that it accepts a comparator.
  2248. *
  2249. * @private
  2250. * @param {Array} [array] The array to inspect.
  2251. * @param {*} target The value to search for.
  2252. * @param {Function} comparator The comparator invoked per element.
  2253. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2254. */
  2255. function arrayIncludesWith(array, value, comparator) {
  2256. var index = -1,
  2257. length = array == null ? 0 : array.length;
  2258. while (++index < length) {
  2259. if (comparator(value, array[index])) {
  2260. return true;
  2261. }
  2262. }
  2263. return false;
  2264. }
  2265. /**
  2266. * A specialized version of `_.map` for arrays without support for iteratee
  2267. * shorthands.
  2268. *
  2269. * @private
  2270. * @param {Array} [array] The array to iterate over.
  2271. * @param {Function} iteratee The function invoked per iteration.
  2272. * @returns {Array} Returns the new mapped array.
  2273. */
  2274. function arrayMap(array, iteratee) {
  2275. var index = -1,
  2276. length = array == null ? 0 : array.length,
  2277. result = Array(length);
  2278. while (++index < length) {
  2279. result[index] = iteratee(array[index], index, array);
  2280. }
  2281. return result;
  2282. }
  2283. /**
  2284. * Appends the elements of `values` to `array`.
  2285. *
  2286. * @private
  2287. * @param {Array} array The array to modify.
  2288. * @param {Array} values The values to append.
  2289. * @returns {Array} Returns `array`.
  2290. */
  2291. function arrayPush(array, values) {
  2292. var index = -1,
  2293. length = values.length,
  2294. offset = array.length;
  2295. while (++index < length) {
  2296. array[offset + index] = values[index];
  2297. }
  2298. return array;
  2299. }
  2300. /**
  2301. * A specialized version of `_.reduce` for arrays without support for
  2302. * iteratee shorthands.
  2303. *
  2304. * @private
  2305. * @param {Array} [array] The array to iterate over.
  2306. * @param {Function} iteratee The function invoked per iteration.
  2307. * @param {*} [accumulator] The initial value.
  2308. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2309. * the initial value.
  2310. * @returns {*} Returns the accumulated value.
  2311. */
  2312. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2313. var index = -1,
  2314. length = array == null ? 0 : array.length;
  2315. if (initAccum && length) {
  2316. accumulator = array[++index];
  2317. }
  2318. while (++index < length) {
  2319. accumulator = iteratee(accumulator, array[index], index, array);
  2320. }
  2321. return accumulator;
  2322. }
  2323. /**
  2324. * A specialized version of `_.reduceRight` for arrays without support for
  2325. * iteratee shorthands.
  2326. *
  2327. * @private
  2328. * @param {Array} [array] The array to iterate over.
  2329. * @param {Function} iteratee The function invoked per iteration.
  2330. * @param {*} [accumulator] The initial value.
  2331. * @param {boolean} [initAccum] Specify using the last element of `array` as
  2332. * the initial value.
  2333. * @returns {*} Returns the accumulated value.
  2334. */
  2335. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  2336. var length = array == null ? 0 : array.length;
  2337. if (initAccum && length) {
  2338. accumulator = array[--length];
  2339. }
  2340. while (length--) {
  2341. accumulator = iteratee(accumulator, array[length], length, array);
  2342. }
  2343. return accumulator;
  2344. }
  2345. /**
  2346. * A specialized version of `_.some` for arrays without support for iteratee
  2347. * shorthands.
  2348. *
  2349. * @private
  2350. * @param {Array} [array] The array to iterate over.
  2351. * @param {Function} predicate The function invoked per iteration.
  2352. * @returns {boolean} Returns `true` if any element passes the predicate check,
  2353. * else `false`.
  2354. */
  2355. function arraySome(array, predicate) {
  2356. var index = -1,
  2357. length = array == null ? 0 : array.length;
  2358. while (++index < length) {
  2359. if (predicate(array[index], index, array)) {
  2360. return true;
  2361. }
  2362. }
  2363. return false;
  2364. }
  2365. /**
  2366. * Gets the size of an ASCII `string`.
  2367. *
  2368. * @private
  2369. * @param {string} string The string inspect.
  2370. * @returns {number} Returns the string size.
  2371. */
  2372. var asciiSize = baseProperty('length');
  2373. /**
  2374. * Converts an ASCII `string` to an array.
  2375. *
  2376. * @private
  2377. * @param {string} string The string to convert.
  2378. * @returns {Array} Returns the converted array.
  2379. */
  2380. function asciiToArray(string) {
  2381. return string.split('');
  2382. }
  2383. /**
  2384. * Splits an ASCII `string` into an array of its words.
  2385. *
  2386. * @private
  2387. * @param {string} The string to inspect.
  2388. * @returns {Array} Returns the words of `string`.
  2389. */
  2390. function asciiWords(string) {
  2391. return string.match(reAsciiWord) || [];
  2392. }
  2393. /**
  2394. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2395. * without support for iteratee shorthands, which iterates over `collection`
  2396. * using `eachFunc`.
  2397. *
  2398. * @private
  2399. * @param {Array|Object} collection The collection to inspect.
  2400. * @param {Function} predicate The function invoked per iteration.
  2401. * @param {Function} eachFunc The function to iterate over `collection`.
  2402. * @returns {*} Returns the found element or its key, else `undefined`.
  2403. */
  2404. function baseFindKey(collection, predicate, eachFunc) {
  2405. var result;
  2406. eachFunc(collection, function(value, key, collection) {
  2407. if (predicate(value, key, collection)) {
  2408. result = key;
  2409. return false;
  2410. }
  2411. });
  2412. return result;
  2413. }
  2414. /**
  2415. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2416. * support for iteratee shorthands.
  2417. *
  2418. * @private
  2419. * @param {Array} array The array to inspect.
  2420. * @param {Function} predicate The function invoked per iteration.
  2421. * @param {number} fromIndex The index to search from.
  2422. * @param {boolean} [fromRight] Specify iterating from right to left.
  2423. * @returns {number} Returns the index of the matched value, else `-1`.
  2424. */
  2425. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2426. var length = array.length,
  2427. index = fromIndex + (fromRight ? 1 : -1);
  2428. while ((fromRight ? index-- : ++index < length)) {
  2429. if (predicate(array[index], index, array)) {
  2430. return index;
  2431. }
  2432. }
  2433. return -1;
  2434. }
  2435. /**
  2436. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2437. *
  2438. * @private
  2439. * @param {Array} array The array to inspect.
  2440. * @param {*} value The value to search for.
  2441. * @param {number} fromIndex The index to search from.
  2442. * @returns {number} Returns the index of the matched value, else `-1`.
  2443. */
  2444. function baseIndexOf(array, value, fromIndex) {
  2445. return value === value
  2446. ? strictIndexOf(array, value, fromIndex)
  2447. : baseFindIndex(array, baseIsNaN, fromIndex);
  2448. }
  2449. /**
  2450. * This function is like `baseIndexOf` except that it accepts a comparator.
  2451. *
  2452. * @private
  2453. * @param {Array} array The array to inspect.
  2454. * @param {*} value The value to search for.
  2455. * @param {number} fromIndex The index to search from.
  2456. * @param {Function} comparator The comparator invoked per element.
  2457. * @returns {number} Returns the index of the matched value, else `-1`.
  2458. */
  2459. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2460. var index = fromIndex - 1,
  2461. length = array.length;
  2462. while (++index < length) {
  2463. if (comparator(array[index], value)) {
  2464. return index;
  2465. }
  2466. }
  2467. return -1;
  2468. }
  2469. /**
  2470. * The base implementation of `_.isNaN` without support for number objects.
  2471. *
  2472. * @private
  2473. * @param {*} value The value to check.
  2474. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2475. */
  2476. function baseIsNaN(value) {
  2477. return value !== value;
  2478. }
  2479. /**
  2480. * The base implementation of `_.mean` and `_.meanBy` without support for
  2481. * iteratee shorthands.
  2482. *
  2483. * @private
  2484. * @param {Array} array The array to iterate over.
  2485. * @param {Function} iteratee The function invoked per iteration.
  2486. * @returns {number} Returns the mean.
  2487. */
  2488. function baseMean(array, iteratee) {
  2489. var length = array == null ? 0 : array.length;
  2490. return length ? (baseSum(array, iteratee) / length) : NAN;
  2491. }
  2492. /**
  2493. * The base implementation of `_.property` without support for deep paths.
  2494. *
  2495. * @private
  2496. * @param {string} key The key of the property to get.
  2497. * @returns {Function} Returns the new accessor function.
  2498. */
  2499. function baseProperty(key) {
  2500. return function(object) {
  2501. return object == null ? undefined : object[key];
  2502. };
  2503. }
  2504. /**
  2505. * The base implementation of `_.propertyOf` without support for deep paths.
  2506. *
  2507. * @private
  2508. * @param {Object} object The object to query.
  2509. * @returns {Function} Returns the new accessor function.
  2510. */
  2511. function basePropertyOf(object) {
  2512. return function(key) {
  2513. return object == null ? undefined : object[key];
  2514. };
  2515. }
  2516. /**
  2517. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2518. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2519. *
  2520. * @private
  2521. * @param {Array|Object} collection The collection to iterate over.
  2522. * @param {Function} iteratee The function invoked per iteration.
  2523. * @param {*} accumulator The initial value.
  2524. * @param {boolean} initAccum Specify using the first or last element of
  2525. * `collection` as the initial value.
  2526. * @param {Function} eachFunc The function to iterate over `collection`.
  2527. * @returns {*} Returns the accumulated value.
  2528. */
  2529. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2530. eachFunc(collection, function(value, index, collection) {
  2531. accumulator = initAccum
  2532. ? (initAccum = false, value)
  2533. : iteratee(accumulator, value, index, collection);
  2534. });
  2535. return accumulator;
  2536. }
  2537. /**
  2538. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2539. * sort order of `array` and replaces criteria objects with their corresponding
  2540. * values.
  2541. *
  2542. * @private
  2543. * @param {Array} array The array to sort.
  2544. * @param {Function} comparer The function to define sort order.
  2545. * @returns {Array} Returns `array`.
  2546. */
  2547. function baseSortBy(array, comparer) {
  2548. var length = array.length;
  2549. array.sort(comparer);
  2550. while (length--) {
  2551. array[length] = array[length].value;
  2552. }
  2553. return array;
  2554. }
  2555. /**
  2556. * The base implementation of `_.sum` and `_.sumBy` without support for
  2557. * iteratee shorthands.
  2558. *
  2559. * @private
  2560. * @param {Array} array The array to iterate over.
  2561. * @param {Function} iteratee The function invoked per iteration.
  2562. * @returns {number} Returns the sum.
  2563. */
  2564. function baseSum(array, iteratee) {
  2565. var result,
  2566. index = -1,
  2567. length = array.length;
  2568. while (++index < length) {
  2569. var current = iteratee(array[index]);
  2570. if (current !== undefined) {
  2571. result = result === undefined ? current : (result + current);
  2572. }
  2573. }
  2574. return result;
  2575. }
  2576. /**
  2577. * The base implementation of `_.times` without support for iteratee shorthands
  2578. * or max array length checks.
  2579. *
  2580. * @private
  2581. * @param {number} n The number of times to invoke `iteratee`.
  2582. * @param {Function} iteratee The function invoked per iteration.
  2583. * @returns {Array} Returns the array of results.
  2584. */
  2585. function baseTimes(n, iteratee) {
  2586. var index = -1,
  2587. result = Array(n);
  2588. while (++index < n) {
  2589. result[index] = iteratee(index);
  2590. }
  2591. return result;
  2592. }
  2593. /**
  2594. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2595. * of key-value pairs for `object` corresponding to the property names of `props`.
  2596. *
  2597. * @private
  2598. * @param {Object} object The object to query.
  2599. * @param {Array} props The property names to get values for.
  2600. * @returns {Object} Returns the key-value pairs.
  2601. */
  2602. function baseToPairs(object, props) {
  2603. return arrayMap(props, function(key) {
  2604. return [key, object[key]];
  2605. });
  2606. }
  2607. /**
  2608. * The base implementation of `_.trim`.
  2609. *
  2610. * @private
  2611. * @param {string} string The string to trim.
  2612. * @returns {string} Returns the trimmed string.
  2613. */
  2614. function baseTrim(string) {
  2615. return string
  2616. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2617. : string;
  2618. }
  2619. /**
  2620. * The base implementation of `_.unary` without support for storing metadata.
  2621. *
  2622. * @private
  2623. * @param {Function} func The function to cap arguments for.
  2624. * @returns {Function} Returns the new capped function.
  2625. */
  2626. function baseUnary(func) {
  2627. return function(value) {
  2628. return func(value);
  2629. };
  2630. }
  2631. /**
  2632. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2633. * array of `object` property values corresponding to the property names
  2634. * of `props`.
  2635. *
  2636. * @private
  2637. * @param {Object} object The object to query.
  2638. * @param {Array} props The property names to get values for.
  2639. * @returns {Object} Returns the array of property values.
  2640. */
  2641. function baseValues(object, props) {
  2642. return arrayMap(props, function(key) {
  2643. return object[key];
  2644. });
  2645. }
  2646. /**
  2647. * Checks if a `cache` value for `key` exists.
  2648. *
  2649. * @private
  2650. * @param {Object} cache The cache to query.
  2651. * @param {string} key The key of the entry to check.
  2652. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2653. */
  2654. function cacheHas(cache, key) {
  2655. return cache.has(key);
  2656. }
  2657. /**
  2658. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2659. * that is not found in the character symbols.
  2660. *
  2661. * @private
  2662. * @param {Array} strSymbols The string symbols to inspect.
  2663. * @param {Array} chrSymbols The character symbols to find.
  2664. * @returns {number} Returns the index of the first unmatched string symbol.
  2665. */
  2666. function charsStartIndex(strSymbols, chrSymbols) {
  2667. var index = -1,
  2668. length = strSymbols.length;
  2669. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2670. return index;
  2671. }
  2672. /**
  2673. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2674. * that is not found in the character symbols.
  2675. *
  2676. * @private
  2677. * @param {Array} strSymbols The string symbols to inspect.
  2678. * @param {Array} chrSymbols The character symbols to find.
  2679. * @returns {number} Returns the index of the last unmatched string symbol.
  2680. */
  2681. function charsEndIndex(strSymbols, chrSymbols) {
  2682. var index = strSymbols.length;
  2683. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2684. return index;
  2685. }
  2686. /**
  2687. * Gets the number of `placeholder` occurrences in `array`.
  2688. *
  2689. * @private
  2690. * @param {Array} array The array to inspect.
  2691. * @param {*} placeholder The placeholder to search for.
  2692. * @returns {number} Returns the placeholder count.
  2693. */
  2694. function countHolders(array, placeholder) {
  2695. var length = array.length,
  2696. result = 0;
  2697. while (length--) {
  2698. if (array[length] === placeholder) {
  2699. ++result;
  2700. }
  2701. }
  2702. return result;
  2703. }
  2704. /**
  2705. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2706. * letters to basic Latin letters.
  2707. *
  2708. * @private
  2709. * @param {string} letter The matched letter to deburr.
  2710. * @returns {string} Returns the deburred letter.
  2711. */
  2712. var deburrLetter = basePropertyOf(deburredLetters);
  2713. /**
  2714. * Used by `_.escape` to convert characters to HTML entities.
  2715. *
  2716. * @private
  2717. * @param {string} chr The matched character to escape.
  2718. * @returns {string} Returns the escaped character.
  2719. */
  2720. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2721. /**
  2722. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2723. *
  2724. * @private
  2725. * @param {string} chr The matched character to escape.
  2726. * @returns {string} Returns the escaped character.
  2727. */
  2728. function escapeStringChar(chr) {
  2729. return '\\' + stringEscapes[chr];
  2730. }
  2731. /**
  2732. * Gets the value at `key` of `object`.
  2733. *
  2734. * @private
  2735. * @param {Object} [object] The object to query.
  2736. * @param {string} key The key of the property to get.
  2737. * @returns {*} Returns the property value.
  2738. */
  2739. function getValue(object, key) {
  2740. return object == null ? undefined : object[key];
  2741. }
  2742. /**
  2743. * Checks if `string` contains Unicode symbols.
  2744. *
  2745. * @private
  2746. * @param {string} string The string to inspect.
  2747. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2748. */
  2749. function hasUnicode(string) {
  2750. return reHasUnicode.test(string);
  2751. }
  2752. /**
  2753. * Checks if `string` contains a word composed of Unicode symbols.
  2754. *
  2755. * @private
  2756. * @param {string} string The string to inspect.
  2757. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2758. */
  2759. function hasUnicodeWord(string) {
  2760. return reHasUnicodeWord.test(string);
  2761. }
  2762. /**
  2763. * Converts `iterator` to an array.
  2764. *
  2765. * @private
  2766. * @param {Object} iterator The iterator to convert.
  2767. * @returns {Array} Returns the converted array.
  2768. */
  2769. function iteratorToArray(iterator) {
  2770. var data,
  2771. result = [];
  2772. while (!(data = iterator.next()).done) {
  2773. result.push(data.value);
  2774. }
  2775. return result;
  2776. }
  2777. /**
  2778. * Converts `map` to its key-value pairs.
  2779. *
  2780. * @private
  2781. * @param {Object} map The map to convert.
  2782. * @returns {Array} Returns the key-value pairs.
  2783. */
  2784. function mapToArray(map) {
  2785. var index = -1,
  2786. result = Array(map.size);
  2787. map.forEach(function(value, key) {
  2788. result[++index] = [key, value];
  2789. });
  2790. return result;
  2791. }
  2792. /**
  2793. * Creates a unary function that invokes `func` with its argument transformed.
  2794. *
  2795. * @private
  2796. * @param {Function} func The function to wrap.
  2797. * @param {Function} transform The argument transform.
  2798. * @returns {Function} Returns the new function.
  2799. */
  2800. function overArg(func, transform) {
  2801. return function(arg) {
  2802. return func(transform(arg));
  2803. };
  2804. }
  2805. /**
  2806. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2807. * and returns an array of their indexes.
  2808. *
  2809. * @private
  2810. * @param {Array} array The array to modify.
  2811. * @param {*} placeholder The placeholder to replace.
  2812. * @returns {Array} Returns the new array of placeholder indexes.
  2813. */
  2814. function replaceHolders(array, placeholder) {
  2815. var index = -1,
  2816. length = array.length,
  2817. resIndex = 0,
  2818. result = [];
  2819. while (++index < length) {
  2820. var value = array[index];
  2821. if (value === placeholder || value === PLACEHOLDER) {
  2822. array[index] = PLACEHOLDER;
  2823. result[resIndex++] = index;
  2824. }
  2825. }
  2826. return result;
  2827. }
  2828. /**
  2829. * Converts `set` to an array of its values.
  2830. *
  2831. * @private
  2832. * @param {Object} set The set to convert.
  2833. * @returns {Array} Returns the values.
  2834. */
  2835. function setToArray(set) {
  2836. var index = -1,
  2837. result = Array(set.size);
  2838. set.forEach(function(value) {
  2839. result[++index] = value;
  2840. });
  2841. return result;
  2842. }
  2843. /**
  2844. * Converts `set` to its value-value pairs.
  2845. *
  2846. * @private
  2847. * @param {Object} set The set to convert.
  2848. * @returns {Array} Returns the value-value pairs.
  2849. */
  2850. function setToPairs(set) {
  2851. var index = -1,
  2852. result = Array(set.size);
  2853. set.forEach(function(value) {
  2854. result[++index] = [value, value];
  2855. });
  2856. return result;
  2857. }
  2858. /**
  2859. * A specialized version of `_.indexOf` which performs strict equality
  2860. * comparisons of values, i.e. `===`.
  2861. *
  2862. * @private
  2863. * @param {Array} array The array to inspect.
  2864. * @param {*} value The value to search for.
  2865. * @param {number} fromIndex The index to search from.
  2866. * @returns {number} Returns the index of the matched value, else `-1`.
  2867. */
  2868. function strictIndexOf(array, value, fromIndex) {
  2869. var index = fromIndex - 1,
  2870. length = array.length;
  2871. while (++index < length) {
  2872. if (array[index] === value) {
  2873. return index;
  2874. }
  2875. }
  2876. return -1;
  2877. }
  2878. /**
  2879. * A specialized version of `_.lastIndexOf` which performs strict equality
  2880. * comparisons of values, i.e. `===`.
  2881. *
  2882. * @private
  2883. * @param {Array} array The array to inspect.
  2884. * @param {*} value The value to search for.
  2885. * @param {number} fromIndex The index to search from.
  2886. * @returns {number} Returns the index of the matched value, else `-1`.
  2887. */
  2888. function strictLastIndexOf(array, value, fromIndex) {
  2889. var index = fromIndex + 1;
  2890. while (index--) {
  2891. if (array[index] === value) {
  2892. return index;
  2893. }
  2894. }
  2895. return index;
  2896. }
  2897. /**
  2898. * Gets the number of symbols in `string`.
  2899. *
  2900. * @private
  2901. * @param {string} string The string to inspect.
  2902. * @returns {number} Returns the string size.
  2903. */
  2904. function stringSize(string) {
  2905. return hasUnicode(string)
  2906. ? unicodeSize(string)
  2907. : asciiSize(string);
  2908. }
  2909. /**
  2910. * Converts `string` to an array.
  2911. *
  2912. * @private
  2913. * @param {string} string The string to convert.
  2914. * @returns {Array} Returns the converted array.
  2915. */
  2916. function stringToArray(string) {
  2917. return hasUnicode(string)
  2918. ? unicodeToArray(string)
  2919. : asciiToArray(string);
  2920. }
  2921. /**
  2922. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2923. * character of `string`.
  2924. *
  2925. * @private
  2926. * @param {string} string The string to inspect.
  2927. * @returns {number} Returns the index of the last non-whitespace character.
  2928. */
  2929. function trimmedEndIndex(string) {
  2930. var index = string.length;
  2931. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2932. return index;
  2933. }
  2934. /**
  2935. * Used by `_.unescape` to convert HTML entities to characters.
  2936. *
  2937. * @private
  2938. * @param {string} chr The matched character to unescape.
  2939. * @returns {string} Returns the unescaped character.
  2940. */
  2941. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2942. /**
  2943. * Gets the size of a Unicode `string`.
  2944. *
  2945. * @private
  2946. * @param {string} string The string inspect.
  2947. * @returns {number} Returns the string size.
  2948. */
  2949. function unicodeSize(string) {
  2950. var result = reUnicode.lastIndex = 0;
  2951. while (reUnicode.test(string)) {
  2952. ++result;
  2953. }
  2954. return result;
  2955. }
  2956. /**
  2957. * Converts a Unicode `string` to an array.
  2958. *
  2959. * @private
  2960. * @param {string} string The string to convert.
  2961. * @returns {Array} Returns the converted array.
  2962. */
  2963. function unicodeToArray(string) {
  2964. return string.match(reUnicode) || [];
  2965. }
  2966. /**
  2967. * Splits a Unicode `string` into an array of its words.
  2968. *
  2969. * @private
  2970. * @param {string} The string to inspect.
  2971. * @returns {Array} Returns the words of `string`.
  2972. */
  2973. function unicodeWords(string) {
  2974. return string.match(reUnicodeWord) || [];
  2975. }
  2976. /*--------------------------------------------------------------------------*/
  2977. /**
  2978. * Create a new pristine `lodash` function using the `context` object.
  2979. *
  2980. * @static
  2981. * @memberOf _
  2982. * @since 1.1.0
  2983. * @category Util
  2984. * @param {Object} [context=root] The context object.
  2985. * @returns {Function} Returns a new `lodash` function.
  2986. * @example
  2987. *
  2988. * _.mixin({ 'foo': _.constant('foo') });
  2989. *
  2990. * var lodash = _.runInContext();
  2991. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2992. *
  2993. * _.isFunction(_.foo);
  2994. * // => true
  2995. * _.isFunction(_.bar);
  2996. * // => false
  2997. *
  2998. * lodash.isFunction(lodash.foo);
  2999. * // => false
  3000. * lodash.isFunction(lodash.bar);
  3001. * // => true
  3002. *
  3003. * // Create a suped-up `defer` in Node.js.
  3004. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  3005. */
  3006. var runInContext = (function runInContext(context) {
  3007. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  3008. /** Built-in constructor references. */
  3009. var Array = context.Array,
  3010. Date = context.Date,
  3011. Error = context.Error,
  3012. Function = context.Function,
  3013. Math = context.Math,
  3014. Object = context.Object,
  3015. RegExp = context.RegExp,
  3016. String = context.String,
  3017. TypeError = context.TypeError;
  3018. /** Used for built-in method references. */
  3019. var arrayProto = Array.prototype,
  3020. funcProto = Function.prototype,
  3021. objectProto = Object.prototype;
  3022. /** Used to detect overreaching core-js shims. */
  3023. var coreJsData = context['__core-js_shared__'];
  3024. /** Used to resolve the decompiled source of functions. */
  3025. var funcToString = funcProto.toString;
  3026. /** Used to check objects for own properties. */
  3027. var hasOwnProperty = objectProto.hasOwnProperty;
  3028. /** Used to generate unique IDs. */
  3029. var idCounter = 0;
  3030. /** Used to detect methods masquerading as native. */
  3031. var maskSrcKey = (function() {
  3032. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3033. return uid ? ('Symbol(src)_1.' + uid) : '';
  3034. }());
  3035. /**
  3036. * Used to resolve the
  3037. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3038. * of values.
  3039. */
  3040. var nativeObjectToString = objectProto.toString;
  3041. /** Used to infer the `Object` constructor. */
  3042. var objectCtorString = funcToString.call(Object);
  3043. /** Used to restore the original `_` reference in `_.noConflict`. */
  3044. var oldDash = root._;
  3045. /** Used to detect if a method is native. */
  3046. var reIsNative = RegExp('^' +
  3047. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  3048. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  3049. );
  3050. /** Built-in value references. */
  3051. var Buffer = moduleExports ? context.Buffer : undefined,
  3052. Symbol = context.Symbol,
  3053. Uint8Array = context.Uint8Array,
  3054. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  3055. getPrototype = overArg(Object.getPrototypeOf, Object),
  3056. objectCreate = Object.create,
  3057. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3058. splice = arrayProto.splice,
  3059. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  3060. symIterator = Symbol ? Symbol.iterator : undefined,
  3061. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3062. var defineProperty = (function() {
  3063. try {
  3064. var func = getNative(Object, 'defineProperty');
  3065. func({}, '', {});
  3066. return func;
  3067. } catch (e) {}
  3068. }());
  3069. /** Mocked built-ins. */
  3070. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  3071. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  3072. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  3073. /* Built-in method references for those with the same name as other `lodash` methods. */
  3074. var nativeCeil = Math.ceil,
  3075. nativeFloor = Math.floor,
  3076. nativeGetSymbols = Object.getOwnPropertySymbols,
  3077. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3078. nativeIsFinite = context.isFinite,
  3079. nativeJoin = arrayProto.join,
  3080. nativeKeys = overArg(Object.keys, Object),
  3081. nativeMax = Math.max,
  3082. nativeMin = Math.min,
  3083. nativeNow = Date.now,
  3084. nativeParseInt = context.parseInt,
  3085. nativeRandom = Math.random,
  3086. nativeReverse = arrayProto.reverse;
  3087. /* Built-in method references that are verified to be native. */
  3088. var DataView = getNative(context, 'DataView'),
  3089. Map = getNative(context, 'Map'),
  3090. Promise = getNative(context, 'Promise'),
  3091. Set = getNative(context, 'Set'),
  3092. WeakMap = getNative(context, 'WeakMap'),
  3093. nativeCreate = getNative(Object, 'create');
  3094. /** Used to store function metadata. */
  3095. var metaMap = WeakMap && new WeakMap;
  3096. /** Used to lookup unminified function names. */
  3097. var realNames = {};
  3098. /** Used to detect maps, sets, and weakmaps. */
  3099. var dataViewCtorString = toSource(DataView),
  3100. mapCtorString = toSource(Map),
  3101. promiseCtorString = toSource(Promise),
  3102. setCtorString = toSource(Set),
  3103. weakMapCtorString = toSource(WeakMap);
  3104. /** Used to convert symbols to primitives and strings. */
  3105. var symbolProto = Symbol ? Symbol.prototype : undefined,
  3106. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  3107. symbolToString = symbolProto ? symbolProto.toString : undefined;
  3108. /*------------------------------------------------------------------------*/
  3109. /**
  3110. * Creates a `lodash` object which wraps `value` to enable implicit method
  3111. * chain sequences. Methods that operate on and return arrays, collections,
  3112. * and functions can be chained together. Methods that retrieve a single value
  3113. * or may return a primitive value will automatically end the chain sequence
  3114. * and return the unwrapped value. Otherwise, the value must be unwrapped
  3115. * with `_#value`.
  3116. *
  3117. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  3118. * enabled using `_.chain`.
  3119. *
  3120. * The execution of chained methods is lazy, that is, it's deferred until
  3121. * `_#value` is implicitly or explicitly called.
  3122. *
  3123. * Lazy evaluation allows several methods to support shortcut fusion.
  3124. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  3125. * the creation of intermediate arrays and can greatly reduce the number of
  3126. * iteratee executions. Sections of a chain sequence qualify for shortcut
  3127. * fusion if the section is applied to an array and iteratees accept only
  3128. * one argument. The heuristic for whether a section qualifies for shortcut
  3129. * fusion is subject to change.
  3130. *
  3131. * Chaining is supported in custom builds as long as the `_#value` method is
  3132. * directly or indirectly included in the build.
  3133. *
  3134. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  3135. *
  3136. * The wrapper `Array` methods are:
  3137. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  3138. *
  3139. * The wrapper `String` methods are:
  3140. * `replace` and `split`
  3141. *
  3142. * The wrapper methods that support shortcut fusion are:
  3143. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  3144. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  3145. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  3146. *
  3147. * The chainable wrapper methods are:
  3148. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  3149. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  3150. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  3151. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  3152. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  3153. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  3154. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  3155. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  3156. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  3157. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  3158. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  3159. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  3160. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  3161. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  3162. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  3163. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  3164. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  3165. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  3166. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  3167. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  3168. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  3169. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  3170. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  3171. * `zipObject`, `zipObjectDeep`, and `zipWith`
  3172. *
  3173. * The wrapper methods that are **not** chainable by default are:
  3174. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  3175. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  3176. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  3177. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  3178. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  3179. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  3180. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  3181. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  3182. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  3183. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  3184. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  3185. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  3186. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  3187. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  3188. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  3189. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  3190. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  3191. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  3192. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  3193. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  3194. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  3195. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  3196. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  3197. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  3198. * `upperFirst`, `value`, and `words`
  3199. *
  3200. * @name _
  3201. * @constructor
  3202. * @category Seq
  3203. * @param {*} value The value to wrap in a `lodash` instance.
  3204. * @returns {Object} Returns the new `lodash` wrapper instance.
  3205. * @example
  3206. *
  3207. * function square(n) {
  3208. * return n * n;
  3209. * }
  3210. *
  3211. * var wrapped = _([1, 2, 3]);
  3212. *
  3213. * // Returns an unwrapped value.
  3214. * wrapped.reduce(_.add);
  3215. * // => 6
  3216. *
  3217. * // Returns a wrapped value.
  3218. * var squares = wrapped.map(square);
  3219. *
  3220. * _.isArray(squares);
  3221. * // => false
  3222. *
  3223. * _.isArray(squares.value());
  3224. * // => true
  3225. */
  3226. function lodash(value) {
  3227. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  3228. if (value instanceof LodashWrapper) {
  3229. return value;
  3230. }
  3231. if (hasOwnProperty.call(value, '__wrapped__')) {
  3232. return wrapperClone(value);
  3233. }
  3234. }
  3235. return new LodashWrapper(value);
  3236. }
  3237. /**
  3238. * The base implementation of `_.create` without support for assigning
  3239. * properties to the created object.
  3240. *
  3241. * @private
  3242. * @param {Object} proto The object to inherit from.
  3243. * @returns {Object} Returns the new object.
  3244. */
  3245. var baseCreate = (function() {
  3246. function object() {}
  3247. return function(proto) {
  3248. if (!isObject(proto)) {
  3249. return {};
  3250. }
  3251. if (objectCreate) {
  3252. return objectCreate(proto);
  3253. }
  3254. object.prototype = proto;
  3255. var result = new object;
  3256. object.prototype = undefined;
  3257. return result;
  3258. };
  3259. }());
  3260. /**
  3261. * The function whose prototype chain sequence wrappers inherit from.
  3262. *
  3263. * @private
  3264. */
  3265. function baseLodash() {
  3266. // No operation performed.
  3267. }
  3268. /**
  3269. * The base constructor for creating `lodash` wrapper objects.
  3270. *
  3271. * @private
  3272. * @param {*} value The value to wrap.
  3273. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  3274. */
  3275. function LodashWrapper(value, chainAll) {
  3276. this.__wrapped__ = value;
  3277. this.__actions__ = [];
  3278. this.__chain__ = !!chainAll;
  3279. this.__index__ = 0;
  3280. this.__values__ = undefined;
  3281. }
  3282. /**
  3283. * By default, the template delimiters used by lodash are like those in
  3284. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  3285. * following template settings to use alternative delimiters.
  3286. *
  3287. * @static
  3288. * @memberOf _
  3289. * @type {Object}
  3290. */
  3291. lodash.templateSettings = {
  3292. /**
  3293. * Used to detect `data` property values to be HTML-escaped.
  3294. *
  3295. * @memberOf _.templateSettings
  3296. * @type {RegExp}
  3297. */
  3298. 'escape': reEscape,
  3299. /**
  3300. * Used to detect code to be evaluated.
  3301. *
  3302. * @memberOf _.templateSettings
  3303. * @type {RegExp}
  3304. */
  3305. 'evaluate': reEvaluate,
  3306. /**
  3307. * Used to detect `data` property values to inject.
  3308. *
  3309. * @memberOf _.templateSettings
  3310. * @type {RegExp}
  3311. */
  3312. 'interpolate': reInterpolate,
  3313. /**
  3314. * Used to reference the data object in the template text.
  3315. *
  3316. * @memberOf _.templateSettings
  3317. * @type {string}
  3318. */
  3319. 'variable': '',
  3320. /**
  3321. * Used to import variables into the compiled template.
  3322. *
  3323. * @memberOf _.templateSettings
  3324. * @type {Object}
  3325. */
  3326. 'imports': {
  3327. /**
  3328. * A reference to the `lodash` function.
  3329. *
  3330. * @memberOf _.templateSettings.imports
  3331. * @type {Function}
  3332. */
  3333. '_': lodash
  3334. }
  3335. };
  3336. // Ensure wrappers are instances of `baseLodash`.
  3337. lodash.prototype = baseLodash.prototype;
  3338. lodash.prototype.constructor = lodash;
  3339. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  3340. LodashWrapper.prototype.constructor = LodashWrapper;
  3341. /*------------------------------------------------------------------------*/
  3342. /**
  3343. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  3344. *
  3345. * @private
  3346. * @constructor
  3347. * @param {*} value The value to wrap.
  3348. */
  3349. function LazyWrapper(value) {
  3350. this.__wrapped__ = value;
  3351. this.__actions__ = [];
  3352. this.__dir__ = 1;
  3353. this.__filtered__ = false;
  3354. this.__iteratees__ = [];
  3355. this.__takeCount__ = MAX_ARRAY_LENGTH;
  3356. this.__views__ = [];
  3357. }
  3358. /**
  3359. * Creates a clone of the lazy wrapper object.
  3360. *
  3361. * @private
  3362. * @name clone
  3363. * @memberOf LazyWrapper
  3364. * @returns {Object} Returns the cloned `LazyWrapper` object.
  3365. */
  3366. function lazyClone() {
  3367. var result = new LazyWrapper(this.__wrapped__);
  3368. result.__actions__ = copyArray(this.__actions__);
  3369. result.__dir__ = this.__dir__;
  3370. result.__filtered__ = this.__filtered__;
  3371. result.__iteratees__ = copyArray(this.__iteratees__);
  3372. result.__takeCount__ = this.__takeCount__;
  3373. result.__views__ = copyArray(this.__views__);
  3374. return result;
  3375. }
  3376. /**
  3377. * Reverses the direction of lazy iteration.
  3378. *
  3379. * @private
  3380. * @name reverse
  3381. * @memberOf LazyWrapper
  3382. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  3383. */
  3384. function lazyReverse() {
  3385. if (this.__filtered__) {
  3386. var result = new LazyWrapper(this);
  3387. result.__dir__ = -1;
  3388. result.__filtered__ = true;
  3389. } else {
  3390. result = this.clone();
  3391. result.__dir__ *= -1;
  3392. }
  3393. return result;
  3394. }
  3395. /**
  3396. * Extracts the unwrapped value from its lazy wrapper.
  3397. *
  3398. * @private
  3399. * @name value
  3400. * @memberOf LazyWrapper
  3401. * @returns {*} Returns the unwrapped value.
  3402. */
  3403. function lazyValue() {
  3404. var array = this.__wrapped__.value(),
  3405. dir = this.__dir__,
  3406. isArr = isArray(array),
  3407. isRight = dir < 0,
  3408. arrLength = isArr ? array.length : 0,
  3409. view = getView(0, arrLength, this.__views__),
  3410. start = view.start,
  3411. end = view.end,
  3412. length = end - start,
  3413. index = isRight ? end : (start - 1),
  3414. iteratees = this.__iteratees__,
  3415. iterLength = iteratees.length,
  3416. resIndex = 0,
  3417. takeCount = nativeMin(length, this.__takeCount__);
  3418. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3419. return baseWrapperValue(array, this.__actions__);
  3420. }
  3421. var result = [];
  3422. outer:
  3423. while (length-- && resIndex < takeCount) {
  3424. index += dir;
  3425. var iterIndex = -1,
  3426. value = array[index];
  3427. while (++iterIndex < iterLength) {
  3428. var data = iteratees[iterIndex],
  3429. iteratee = data.iteratee,
  3430. type = data.type,
  3431. computed = iteratee(value);
  3432. if (type == LAZY_MAP_FLAG) {
  3433. value = computed;
  3434. } else if (!computed) {
  3435. if (type == LAZY_FILTER_FLAG) {
  3436. continue outer;
  3437. } else {
  3438. break outer;
  3439. }
  3440. }
  3441. }
  3442. result[resIndex++] = value;
  3443. }
  3444. return result;
  3445. }
  3446. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3447. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3448. LazyWrapper.prototype.constructor = LazyWrapper;
  3449. /*------------------------------------------------------------------------*/
  3450. /**
  3451. * Creates a hash object.
  3452. *
  3453. * @private
  3454. * @constructor
  3455. * @param {Array} [entries] The key-value pairs to cache.
  3456. */
  3457. function Hash(entries) {
  3458. var index = -1,
  3459. length = entries == null ? 0 : entries.length;
  3460. this.clear();
  3461. while (++index < length) {
  3462. var entry = entries[index];
  3463. this.set(entry[0], entry[1]);
  3464. }
  3465. }
  3466. /**
  3467. * Removes all key-value entries from the hash.
  3468. *
  3469. * @private
  3470. * @name clear
  3471. * @memberOf Hash
  3472. */
  3473. function hashClear() {
  3474. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3475. this.size = 0;
  3476. }
  3477. /**
  3478. * Removes `key` and its value from the hash.
  3479. *
  3480. * @private
  3481. * @name delete
  3482. * @memberOf Hash
  3483. * @param {Object} hash The hash to modify.
  3484. * @param {string} key The key of the value to remove.
  3485. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3486. */
  3487. function hashDelete(key) {
  3488. var result = this.has(key) && delete this.__data__[key];
  3489. this.size -= result ? 1 : 0;
  3490. return result;
  3491. }
  3492. /**
  3493. * Gets the hash value for `key`.
  3494. *
  3495. * @private
  3496. * @name get
  3497. * @memberOf Hash
  3498. * @param {string} key The key of the value to get.
  3499. * @returns {*} Returns the entry value.
  3500. */
  3501. function hashGet(key) {
  3502. var data = this.__data__;
  3503. if (nativeCreate) {
  3504. var result = data[key];
  3505. return result === HASH_UNDEFINED ? undefined : result;
  3506. }
  3507. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3508. }
  3509. /**
  3510. * Checks if a hash value for `key` exists.
  3511. *
  3512. * @private
  3513. * @name has
  3514. * @memberOf Hash
  3515. * @param {string} key The key of the entry to check.
  3516. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3517. */
  3518. function hashHas(key) {
  3519. var data = this.__data__;
  3520. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3521. }
  3522. /**
  3523. * Sets the hash `key` to `value`.
  3524. *
  3525. * @private
  3526. * @name set
  3527. * @memberOf Hash
  3528. * @param {string} key The key of the value to set.
  3529. * @param {*} value The value to set.
  3530. * @returns {Object} Returns the hash instance.
  3531. */
  3532. function hashSet(key, value) {
  3533. var data = this.__data__;
  3534. this.size += this.has(key) ? 0 : 1;
  3535. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3536. return this;
  3537. }
  3538. // Add methods to `Hash`.
  3539. Hash.prototype.clear = hashClear;
  3540. Hash.prototype['delete'] = hashDelete;
  3541. Hash.prototype.get = hashGet;
  3542. Hash.prototype.has = hashHas;
  3543. Hash.prototype.set = hashSet;
  3544. /*------------------------------------------------------------------------*/
  3545. /**
  3546. * Creates an list cache object.
  3547. *
  3548. * @private
  3549. * @constructor
  3550. * @param {Array} [entries] The key-value pairs to cache.
  3551. */
  3552. function ListCache(entries) {
  3553. var index = -1,
  3554. length = entries == null ? 0 : entries.length;
  3555. this.clear();
  3556. while (++index < length) {
  3557. var entry = entries[index];
  3558. this.set(entry[0], entry[1]);
  3559. }
  3560. }
  3561. /**
  3562. * Removes all key-value entries from the list cache.
  3563. *
  3564. * @private
  3565. * @name clear
  3566. * @memberOf ListCache
  3567. */
  3568. function listCacheClear() {
  3569. this.__data__ = [];
  3570. this.size = 0;
  3571. }
  3572. /**
  3573. * Removes `key` and its value from the list cache.
  3574. *
  3575. * @private
  3576. * @name delete
  3577. * @memberOf ListCache
  3578. * @param {string} key The key of the value to remove.
  3579. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3580. */
  3581. function listCacheDelete(key) {
  3582. var data = this.__data__,
  3583. index = assocIndexOf(data, key);
  3584. if (index < 0) {
  3585. return false;
  3586. }
  3587. var lastIndex = data.length - 1;
  3588. if (index == lastIndex) {
  3589. data.pop();
  3590. } else {
  3591. splice.call(data, index, 1);
  3592. }
  3593. --this.size;
  3594. return true;
  3595. }
  3596. /**
  3597. * Gets the list cache value for `key`.
  3598. *
  3599. * @private
  3600. * @name get
  3601. * @memberOf ListCache
  3602. * @param {string} key The key of the value to get.
  3603. * @returns {*} Returns the entry value.
  3604. */
  3605. function listCacheGet(key) {
  3606. var data = this.__data__,
  3607. index = assocIndexOf(data, key);
  3608. return index < 0 ? undefined : data[index][1];
  3609. }
  3610. /**
  3611. * Checks if a list cache value for `key` exists.
  3612. *
  3613. * @private
  3614. * @name has
  3615. * @memberOf ListCache
  3616. * @param {string} key The key of the entry to check.
  3617. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3618. */
  3619. function listCacheHas(key) {
  3620. return assocIndexOf(this.__data__, key) > -1;
  3621. }
  3622. /**
  3623. * Sets the list cache `key` to `value`.
  3624. *
  3625. * @private
  3626. * @name set
  3627. * @memberOf ListCache
  3628. * @param {string} key The key of the value to set.
  3629. * @param {*} value The value to set.
  3630. * @returns {Object} Returns the list cache instance.
  3631. */
  3632. function listCacheSet(key, value) {
  3633. var data = this.__data__,
  3634. index = assocIndexOf(data, key);
  3635. if (index < 0) {
  3636. ++this.size;
  3637. data.push([key, value]);
  3638. } else {
  3639. data[index][1] = value;
  3640. }
  3641. return this;
  3642. }
  3643. // Add methods to `ListCache`.
  3644. ListCache.prototype.clear = listCacheClear;
  3645. ListCache.prototype['delete'] = listCacheDelete;
  3646. ListCache.prototype.get = listCacheGet;
  3647. ListCache.prototype.has = listCacheHas;
  3648. ListCache.prototype.set = listCacheSet;
  3649. /*------------------------------------------------------------------------*/
  3650. /**
  3651. * Creates a map cache object to store key-value pairs.
  3652. *
  3653. * @private
  3654. * @constructor
  3655. * @param {Array} [entries] The key-value pairs to cache.
  3656. */
  3657. function MapCache(entries) {
  3658. var index = -1,
  3659. length = entries == null ? 0 : entries.length;
  3660. this.clear();
  3661. while (++index < length) {
  3662. var entry = entries[index];
  3663. this.set(entry[0], entry[1]);
  3664. }
  3665. }
  3666. /**
  3667. * Removes all key-value entries from the map.
  3668. *
  3669. * @private
  3670. * @name clear
  3671. * @memberOf MapCache
  3672. */
  3673. function mapCacheClear() {
  3674. this.size = 0;
  3675. this.__data__ = {
  3676. 'hash': new Hash,
  3677. 'map': new (Map || ListCache),
  3678. 'string': new Hash
  3679. };
  3680. }
  3681. /**
  3682. * Removes `key` and its value from the map.
  3683. *
  3684. * @private
  3685. * @name delete
  3686. * @memberOf MapCache
  3687. * @param {string} key The key of the value to remove.
  3688. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3689. */
  3690. function mapCacheDelete(key) {
  3691. var result = getMapData(this, key)['delete'](key);
  3692. this.size -= result ? 1 : 0;
  3693. return result;
  3694. }
  3695. /**
  3696. * Gets the map value for `key`.
  3697. *
  3698. * @private
  3699. * @name get
  3700. * @memberOf MapCache
  3701. * @param {string} key The key of the value to get.
  3702. * @returns {*} Returns the entry value.
  3703. */
  3704. function mapCacheGet(key) {
  3705. return getMapData(this, key).get(key);
  3706. }
  3707. /**
  3708. * Checks if a map value for `key` exists.
  3709. *
  3710. * @private
  3711. * @name has
  3712. * @memberOf MapCache
  3713. * @param {string} key The key of the entry to check.
  3714. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3715. */
  3716. function mapCacheHas(key) {
  3717. return getMapData(this, key).has(key);
  3718. }
  3719. /**
  3720. * Sets the map `key` to `value`.
  3721. *
  3722. * @private
  3723. * @name set
  3724. * @memberOf MapCache
  3725. * @param {string} key The key of the value to set.
  3726. * @param {*} value The value to set.
  3727. * @returns {Object} Returns the map cache instance.
  3728. */
  3729. function mapCacheSet(key, value) {
  3730. var data = getMapData(this, key),
  3731. size = data.size;
  3732. data.set(key, value);
  3733. this.size += data.size == size ? 0 : 1;
  3734. return this;
  3735. }
  3736. // Add methods to `MapCache`.
  3737. MapCache.prototype.clear = mapCacheClear;
  3738. MapCache.prototype['delete'] = mapCacheDelete;
  3739. MapCache.prototype.get = mapCacheGet;
  3740. MapCache.prototype.has = mapCacheHas;
  3741. MapCache.prototype.set = mapCacheSet;
  3742. /*------------------------------------------------------------------------*/
  3743. /**
  3744. *
  3745. * Creates an array cache object to store unique values.
  3746. *
  3747. * @private
  3748. * @constructor
  3749. * @param {Array} [values] The values to cache.
  3750. */
  3751. function SetCache(values) {
  3752. var index = -1,
  3753. length = values == null ? 0 : values.length;
  3754. this.__data__ = new MapCache;
  3755. while (++index < length) {
  3756. this.add(values[index]);
  3757. }
  3758. }
  3759. /**
  3760. * Adds `value` to the array cache.
  3761. *
  3762. * @private
  3763. * @name add
  3764. * @memberOf SetCache
  3765. * @alias push
  3766. * @param {*} value The value to cache.
  3767. * @returns {Object} Returns the cache instance.
  3768. */
  3769. function setCacheAdd(value) {
  3770. this.__data__.set(value, HASH_UNDEFINED);
  3771. return this;
  3772. }
  3773. /**
  3774. * Checks if `value` is in the array cache.
  3775. *
  3776. * @private
  3777. * @name has
  3778. * @memberOf SetCache
  3779. * @param {*} value The value to search for.
  3780. * @returns {number} Returns `true` if `value` is found, else `false`.
  3781. */
  3782. function setCacheHas(value) {
  3783. return this.__data__.has(value);
  3784. }
  3785. // Add methods to `SetCache`.
  3786. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3787. SetCache.prototype.has = setCacheHas;
  3788. /*------------------------------------------------------------------------*/
  3789. /**
  3790. * Creates a stack cache object to store key-value pairs.
  3791. *
  3792. * @private
  3793. * @constructor
  3794. * @param {Array} [entries] The key-value pairs to cache.
  3795. */
  3796. function Stack(entries) {
  3797. var data = this.__data__ = new ListCache(entries);
  3798. this.size = data.size;
  3799. }
  3800. /**
  3801. * Removes all key-value entries from the stack.
  3802. *
  3803. * @private
  3804. * @name clear
  3805. * @memberOf Stack
  3806. */
  3807. function stackClear() {
  3808. this.__data__ = new ListCache;
  3809. this.size = 0;
  3810. }
  3811. /**
  3812. * Removes `key` and its value from the stack.
  3813. *
  3814. * @private
  3815. * @name delete
  3816. * @memberOf Stack
  3817. * @param {string} key The key of the value to remove.
  3818. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3819. */
  3820. function stackDelete(key) {
  3821. var data = this.__data__,
  3822. result = data['delete'](key);
  3823. this.size = data.size;
  3824. return result;
  3825. }
  3826. /**
  3827. * Gets the stack value for `key`.
  3828. *
  3829. * @private
  3830. * @name get
  3831. * @memberOf Stack
  3832. * @param {string} key The key of the value to get.
  3833. * @returns {*} Returns the entry value.
  3834. */
  3835. function stackGet(key) {
  3836. return this.__data__.get(key);
  3837. }
  3838. /**
  3839. * Checks if a stack value for `key` exists.
  3840. *
  3841. * @private
  3842. * @name has
  3843. * @memberOf Stack
  3844. * @param {string} key The key of the entry to check.
  3845. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3846. */
  3847. function stackHas(key) {
  3848. return this.__data__.has(key);
  3849. }
  3850. /**
  3851. * Sets the stack `key` to `value`.
  3852. *
  3853. * @private
  3854. * @name set
  3855. * @memberOf Stack
  3856. * @param {string} key The key of the value to set.
  3857. * @param {*} value The value to set.
  3858. * @returns {Object} Returns the stack cache instance.
  3859. */
  3860. function stackSet(key, value) {
  3861. var data = this.__data__;
  3862. if (data instanceof ListCache) {
  3863. var pairs = data.__data__;
  3864. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3865. pairs.push([key, value]);
  3866. this.size = ++data.size;
  3867. return this;
  3868. }
  3869. data = this.__data__ = new MapCache(pairs);
  3870. }
  3871. data.set(key, value);
  3872. this.size = data.size;
  3873. return this;
  3874. }
  3875. // Add methods to `Stack`.
  3876. Stack.prototype.clear = stackClear;
  3877. Stack.prototype['delete'] = stackDelete;
  3878. Stack.prototype.get = stackGet;
  3879. Stack.prototype.has = stackHas;
  3880. Stack.prototype.set = stackSet;
  3881. /*------------------------------------------------------------------------*/
  3882. /**
  3883. * Creates an array of the enumerable property names of the array-like `value`.
  3884. *
  3885. * @private
  3886. * @param {*} value The value to query.
  3887. * @param {boolean} inherited Specify returning inherited property names.
  3888. * @returns {Array} Returns the array of property names.
  3889. */
  3890. function arrayLikeKeys(value, inherited) {
  3891. var isArr = isArray(value),
  3892. isArg = !isArr && isArguments(value),
  3893. isBuff = !isArr && !isArg && isBuffer(value),
  3894. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3895. skipIndexes = isArr || isArg || isBuff || isType,
  3896. result = skipIndexes ? baseTimes(value.length, String) : [],
  3897. length = result.length;
  3898. for (var key in value) {
  3899. if ((inherited || hasOwnProperty.call(value, key)) &&
  3900. !(skipIndexes && (
  3901. // Safari 9 has enumerable `arguments.length` in strict mode.
  3902. key == 'length' ||
  3903. // Node.js 0.10 has enumerable non-index properties on buffers.
  3904. (isBuff && (key == 'offset' || key == 'parent')) ||
  3905. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3906. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3907. // Skip index properties.
  3908. isIndex(key, length)
  3909. ))) {
  3910. result.push(key);
  3911. }
  3912. }
  3913. return result;
  3914. }
  3915. /**
  3916. * A specialized version of `_.sample` for arrays.
  3917. *
  3918. * @private
  3919. * @param {Array} array The array to sample.
  3920. * @returns {*} Returns the random element.
  3921. */
  3922. function arraySample(array) {
  3923. var length = array.length;
  3924. return length ? array[baseRandom(0, length - 1)] : undefined;
  3925. }
  3926. /**
  3927. * A specialized version of `_.sampleSize` for arrays.
  3928. *
  3929. * @private
  3930. * @param {Array} array The array to sample.
  3931. * @param {number} n The number of elements to sample.
  3932. * @returns {Array} Returns the random elements.
  3933. */
  3934. function arraySampleSize(array, n) {
  3935. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3936. }
  3937. /**
  3938. * A specialized version of `_.shuffle` for arrays.
  3939. *
  3940. * @private
  3941. * @param {Array} array The array to shuffle.
  3942. * @returns {Array} Returns the new shuffled array.
  3943. */
  3944. function arrayShuffle(array) {
  3945. return shuffleSelf(copyArray(array));
  3946. }
  3947. /**
  3948. * This function is like `assignValue` except that it doesn't assign
  3949. * `undefined` values.
  3950. *
  3951. * @private
  3952. * @param {Object} object The object to modify.
  3953. * @param {string} key The key of the property to assign.
  3954. * @param {*} value The value to assign.
  3955. */
  3956. function assignMergeValue(object, key, value) {
  3957. if ((value !== undefined && !eq(object[key], value)) ||
  3958. (value === undefined && !(key in object))) {
  3959. baseAssignValue(object, key, value);
  3960. }
  3961. }
  3962. /**
  3963. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3964. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3965. * for equality comparisons.
  3966. *
  3967. * @private
  3968. * @param {Object} object The object to modify.
  3969. * @param {string} key The key of the property to assign.
  3970. * @param {*} value The value to assign.
  3971. */
  3972. function assignValue(object, key, value) {
  3973. var objValue = object[key];
  3974. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3975. (value === undefined && !(key in object))) {
  3976. baseAssignValue(object, key, value);
  3977. }
  3978. }
  3979. /**
  3980. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3981. *
  3982. * @private
  3983. * @param {Array} array The array to inspect.
  3984. * @param {*} key The key to search for.
  3985. * @returns {number} Returns the index of the matched value, else `-1`.
  3986. */
  3987. function assocIndexOf(array, key) {
  3988. var length = array.length;
  3989. while (length--) {
  3990. if (eq(array[length][0], key)) {
  3991. return length;
  3992. }
  3993. }
  3994. return -1;
  3995. }
  3996. /**
  3997. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3998. * by `iteratee` and values set by `setter`.
  3999. *
  4000. * @private
  4001. * @param {Array|Object} collection The collection to iterate over.
  4002. * @param {Function} setter The function to set `accumulator` values.
  4003. * @param {Function} iteratee The iteratee to transform keys.
  4004. * @param {Object} accumulator The initial aggregated object.
  4005. * @returns {Function} Returns `accumulator`.
  4006. */
  4007. function baseAggregator(collection, setter, iteratee, accumulator) {
  4008. baseEach(collection, function(value, key, collection) {
  4009. setter(accumulator, value, iteratee(value), collection);
  4010. });
  4011. return accumulator;
  4012. }
  4013. /**
  4014. * The base implementation of `_.assign` without support for multiple sources
  4015. * or `customizer` functions.
  4016. *
  4017. * @private
  4018. * @param {Object} object The destination object.
  4019. * @param {Object} source The source object.
  4020. * @returns {Object} Returns `object`.
  4021. */
  4022. function baseAssign(object, source) {
  4023. return object && copyObject(source, keys(source), object);
  4024. }
  4025. /**
  4026. * The base implementation of `_.assignIn` without support for multiple sources
  4027. * or `customizer` functions.
  4028. *
  4029. * @private
  4030. * @param {Object} object The destination object.
  4031. * @param {Object} source The source object.
  4032. * @returns {Object} Returns `object`.
  4033. */
  4034. function baseAssignIn(object, source) {
  4035. return object && copyObject(source, keysIn(source), object);
  4036. }
  4037. /**
  4038. * The base implementation of `assignValue` and `assignMergeValue` without
  4039. * value checks.
  4040. *
  4041. * @private
  4042. * @param {Object} object The object to modify.
  4043. * @param {string} key The key of the property to assign.
  4044. * @param {*} value The value to assign.
  4045. */
  4046. function baseAssignValue(object, key, value) {
  4047. if (key == '__proto__' && defineProperty) {
  4048. defineProperty(object, key, {
  4049. 'configurable': true,
  4050. 'enumerable': true,
  4051. 'value': value,
  4052. 'writable': true
  4053. });
  4054. } else {
  4055. object[key] = value;
  4056. }
  4057. }
  4058. /**
  4059. * The base implementation of `_.at` without support for individual paths.
  4060. *
  4061. * @private
  4062. * @param {Object} object The object to iterate over.
  4063. * @param {string[]} paths The property paths to pick.
  4064. * @returns {Array} Returns the picked elements.
  4065. */
  4066. function baseAt(object, paths) {
  4067. var index = -1,
  4068. length = paths.length,
  4069. result = Array(length),
  4070. skip = object == null;
  4071. while (++index < length) {
  4072. result[index] = skip ? undefined : get(object, paths[index]);
  4073. }
  4074. return result;
  4075. }
  4076. /**
  4077. * The base implementation of `_.clamp` which doesn't coerce arguments.
  4078. *
  4079. * @private
  4080. * @param {number} number The number to clamp.
  4081. * @param {number} [lower] The lower bound.
  4082. * @param {number} upper The upper bound.
  4083. * @returns {number} Returns the clamped number.
  4084. */
  4085. function baseClamp(number, lower, upper) {
  4086. if (number === number) {
  4087. if (upper !== undefined) {
  4088. number = number <= upper ? number : upper;
  4089. }
  4090. if (lower !== undefined) {
  4091. number = number >= lower ? number : lower;
  4092. }
  4093. }
  4094. return number;
  4095. }
  4096. /**
  4097. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4098. * traversed objects.
  4099. *
  4100. * @private
  4101. * @param {*} value The value to clone.
  4102. * @param {boolean} bitmask The bitmask flags.
  4103. * 1 - Deep clone
  4104. * 2 - Flatten inherited properties
  4105. * 4 - Clone symbols
  4106. * @param {Function} [customizer] The function to customize cloning.
  4107. * @param {string} [key] The key of `value`.
  4108. * @param {Object} [object] The parent object of `value`.
  4109. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4110. * @returns {*} Returns the cloned value.
  4111. */
  4112. function baseClone(value, bitmask, customizer, key, object, stack) {
  4113. var result,
  4114. isDeep = bitmask & CLONE_DEEP_FLAG,
  4115. isFlat = bitmask & CLONE_FLAT_FLAG,
  4116. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  4117. if (customizer) {
  4118. result = object ? customizer(value, key, object, stack) : customizer(value);
  4119. }
  4120. if (result !== undefined) {
  4121. return result;
  4122. }
  4123. if (!isObject(value)) {
  4124. return value;
  4125. }
  4126. var isArr = isArray(value);
  4127. if (isArr) {
  4128. result = initCloneArray(value);
  4129. if (!isDeep) {
  4130. return copyArray(value, result);
  4131. }
  4132. } else {
  4133. var tag = getTag(value),
  4134. isFunc = tag == funcTag || tag == genTag;
  4135. if (isBuffer(value)) {
  4136. return cloneBuffer(value, isDeep);
  4137. }
  4138. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  4139. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  4140. if (!isDeep) {
  4141. return isFlat
  4142. ? copySymbolsIn(value, baseAssignIn(result, value))
  4143. : copySymbols(value, baseAssign(result, value));
  4144. }
  4145. } else {
  4146. if (!cloneableTags[tag]) {
  4147. return object ? value : {};
  4148. }
  4149. result = initCloneByTag(value, tag, isDeep);
  4150. }
  4151. }
  4152. // Check for circular references and return its corresponding clone.
  4153. stack || (stack = new Stack);
  4154. var stacked = stack.get(value);
  4155. if (stacked) {
  4156. return stacked;
  4157. }
  4158. stack.set(value, result);
  4159. if (isSet(value)) {
  4160. value.forEach(function(subValue) {
  4161. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  4162. });
  4163. } else if (isMap(value)) {
  4164. value.forEach(function(subValue, key) {
  4165. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4166. });
  4167. }
  4168. var keysFunc = isFull
  4169. ? (isFlat ? getAllKeysIn : getAllKeys)
  4170. : (isFlat ? keysIn : keys);
  4171. var props = isArr ? undefined : keysFunc(value);
  4172. arrayEach(props || value, function(subValue, key) {
  4173. if (props) {
  4174. key = subValue;
  4175. subValue = value[key];
  4176. }
  4177. // Recursively populate clone (susceptible to call stack limits).
  4178. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4179. });
  4180. return result;
  4181. }
  4182. /**
  4183. * The base implementation of `_.conforms` which doesn't clone `source`.
  4184. *
  4185. * @private
  4186. * @param {Object} source The object of property predicates to conform to.
  4187. * @returns {Function} Returns the new spec function.
  4188. */
  4189. function baseConforms(source) {
  4190. var props = keys(source);
  4191. return function(object) {
  4192. return baseConformsTo(object, source, props);
  4193. };
  4194. }
  4195. /**
  4196. * The base implementation of `_.conformsTo` which accepts `props` to check.
  4197. *
  4198. * @private
  4199. * @param {Object} object The object to inspect.
  4200. * @param {Object} source The object of property predicates to conform to.
  4201. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  4202. */
  4203. function baseConformsTo(object, source, props) {
  4204. var length = props.length;
  4205. if (object == null) {
  4206. return !length;
  4207. }
  4208. object = Object(object);
  4209. while (length--) {
  4210. var key = props[length],
  4211. predicate = source[key],
  4212. value = object[key];
  4213. if ((value === undefined && !(key in object)) || !predicate(value)) {
  4214. return false;
  4215. }
  4216. }
  4217. return true;
  4218. }
  4219. /**
  4220. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  4221. * to provide to `func`.
  4222. *
  4223. * @private
  4224. * @param {Function} func The function to delay.
  4225. * @param {number} wait The number of milliseconds to delay invocation.
  4226. * @param {Array} args The arguments to provide to `func`.
  4227. * @returns {number|Object} Returns the timer id or timeout object.
  4228. */
  4229. function baseDelay(func, wait, args) {
  4230. if (typeof func != 'function') {
  4231. throw new TypeError(FUNC_ERROR_TEXT);
  4232. }
  4233. return setTimeout(function() { func.apply(undefined, args); }, wait);
  4234. }
  4235. /**
  4236. * The base implementation of methods like `_.difference` without support
  4237. * for excluding multiple arrays or iteratee shorthands.
  4238. *
  4239. * @private
  4240. * @param {Array} array The array to inspect.
  4241. * @param {Array} values The values to exclude.
  4242. * @param {Function} [iteratee] The iteratee invoked per element.
  4243. * @param {Function} [comparator] The comparator invoked per element.
  4244. * @returns {Array} Returns the new array of filtered values.
  4245. */
  4246. function baseDifference(array, values, iteratee, comparator) {
  4247. var index = -1,
  4248. includes = arrayIncludes,
  4249. isCommon = true,
  4250. length = array.length,
  4251. result = [],
  4252. valuesLength = values.length;
  4253. if (!length) {
  4254. return result;
  4255. }
  4256. if (iteratee) {
  4257. values = arrayMap(values, baseUnary(iteratee));
  4258. }
  4259. if (comparator) {
  4260. includes = arrayIncludesWith;
  4261. isCommon = false;
  4262. }
  4263. else if (values.length >= LARGE_ARRAY_SIZE) {
  4264. includes = cacheHas;
  4265. isCommon = false;
  4266. values = new SetCache(values);
  4267. }
  4268. outer:
  4269. while (++index < length) {
  4270. var value = array[index],
  4271. computed = iteratee == null ? value : iteratee(value);
  4272. value = (comparator || value !== 0) ? value : 0;
  4273. if (isCommon && computed === computed) {
  4274. var valuesIndex = valuesLength;
  4275. while (valuesIndex--) {
  4276. if (values[valuesIndex] === computed) {
  4277. continue outer;
  4278. }
  4279. }
  4280. result.push(value);
  4281. }
  4282. else if (!includes(values, computed, comparator)) {
  4283. result.push(value);
  4284. }
  4285. }
  4286. return result;
  4287. }
  4288. /**
  4289. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4290. *
  4291. * @private
  4292. * @param {Array|Object} collection The collection to iterate over.
  4293. * @param {Function} iteratee The function invoked per iteration.
  4294. * @returns {Array|Object} Returns `collection`.
  4295. */
  4296. var baseEach = createBaseEach(baseForOwn);
  4297. /**
  4298. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  4299. *
  4300. * @private
  4301. * @param {Array|Object} collection The collection to iterate over.
  4302. * @param {Function} iteratee The function invoked per iteration.
  4303. * @returns {Array|Object} Returns `collection`.
  4304. */
  4305. var baseEachRight = createBaseEach(baseForOwnRight, true);
  4306. /**
  4307. * The base implementation of `_.every` without support for iteratee shorthands.
  4308. *
  4309. * @private
  4310. * @param {Array|Object} collection The collection to iterate over.
  4311. * @param {Function} predicate The function invoked per iteration.
  4312. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  4313. * else `false`
  4314. */
  4315. function baseEvery(collection, predicate) {
  4316. var result = true;
  4317. baseEach(collection, function(value, index, collection) {
  4318. result = !!predicate(value, index, collection);
  4319. return result;
  4320. });
  4321. return result;
  4322. }
  4323. /**
  4324. * The base implementation of methods like `_.max` and `_.min` which accepts a
  4325. * `comparator` to determine the extremum value.
  4326. *
  4327. * @private
  4328. * @param {Array} array The array to iterate over.
  4329. * @param {Function} iteratee The iteratee invoked per iteration.
  4330. * @param {Function} comparator The comparator used to compare values.
  4331. * @returns {*} Returns the extremum value.
  4332. */
  4333. function baseExtremum(array, iteratee, comparator) {
  4334. var index = -1,
  4335. length = array.length;
  4336. while (++index < length) {
  4337. var value = array[index],
  4338. current = iteratee(value);
  4339. if (current != null && (computed === undefined
  4340. ? (current === current && !isSymbol(current))
  4341. : comparator(current, computed)
  4342. )) {
  4343. var computed = current,
  4344. result = value;
  4345. }
  4346. }
  4347. return result;
  4348. }
  4349. /**
  4350. * The base implementation of `_.fill` without an iteratee call guard.
  4351. *
  4352. * @private
  4353. * @param {Array} array The array to fill.
  4354. * @param {*} value The value to fill `array` with.
  4355. * @param {number} [start=0] The start position.
  4356. * @param {number} [end=array.length] The end position.
  4357. * @returns {Array} Returns `array`.
  4358. */
  4359. function baseFill(array, value, start, end) {
  4360. var length = array.length;
  4361. start = toInteger(start);
  4362. if (start < 0) {
  4363. start = -start > length ? 0 : (length + start);
  4364. }
  4365. end = (end === undefined || end > length) ? length : toInteger(end);
  4366. if (end < 0) {
  4367. end += length;
  4368. }
  4369. end = start > end ? 0 : toLength(end);
  4370. while (start < end) {
  4371. array[start++] = value;
  4372. }
  4373. return array;
  4374. }
  4375. /**
  4376. * The base implementation of `_.filter` without support for iteratee shorthands.
  4377. *
  4378. * @private
  4379. * @param {Array|Object} collection The collection to iterate over.
  4380. * @param {Function} predicate The function invoked per iteration.
  4381. * @returns {Array} Returns the new filtered array.
  4382. */
  4383. function baseFilter(collection, predicate) {
  4384. var result = [];
  4385. baseEach(collection, function(value, index, collection) {
  4386. if (predicate(value, index, collection)) {
  4387. result.push(value);
  4388. }
  4389. });
  4390. return result;
  4391. }
  4392. /**
  4393. * The base implementation of `_.flatten` with support for restricting flattening.
  4394. *
  4395. * @private
  4396. * @param {Array} array The array to flatten.
  4397. * @param {number} depth The maximum recursion depth.
  4398. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4399. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4400. * @param {Array} [result=[]] The initial result value.
  4401. * @returns {Array} Returns the new flattened array.
  4402. */
  4403. function baseFlatten(array, depth, predicate, isStrict, result) {
  4404. var index = -1,
  4405. length = array.length;
  4406. predicate || (predicate = isFlattenable);
  4407. result || (result = []);
  4408. while (++index < length) {
  4409. var value = array[index];
  4410. if (depth > 0 && predicate(value)) {
  4411. if (depth > 1) {
  4412. // Recursively flatten arrays (susceptible to call stack limits).
  4413. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4414. } else {
  4415. arrayPush(result, value);
  4416. }
  4417. } else if (!isStrict) {
  4418. result[result.length] = value;
  4419. }
  4420. }
  4421. return result;
  4422. }
  4423. /**
  4424. * The base implementation of `baseForOwn` which iterates over `object`
  4425. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4426. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4427. *
  4428. * @private
  4429. * @param {Object} object The object to iterate over.
  4430. * @param {Function} iteratee The function invoked per iteration.
  4431. * @param {Function} keysFunc The function to get the keys of `object`.
  4432. * @returns {Object} Returns `object`.
  4433. */
  4434. var baseFor = createBaseFor();
  4435. /**
  4436. * This function is like `baseFor` except that it iterates over properties
  4437. * in the opposite order.
  4438. *
  4439. * @private
  4440. * @param {Object} object The object to iterate over.
  4441. * @param {Function} iteratee The function invoked per iteration.
  4442. * @param {Function} keysFunc The function to get the keys of `object`.
  4443. * @returns {Object} Returns `object`.
  4444. */
  4445. var baseForRight = createBaseFor(true);
  4446. /**
  4447. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4448. *
  4449. * @private
  4450. * @param {Object} object The object to iterate over.
  4451. * @param {Function} iteratee The function invoked per iteration.
  4452. * @returns {Object} Returns `object`.
  4453. */
  4454. function baseForOwn(object, iteratee) {
  4455. return object && baseFor(object, iteratee, keys);
  4456. }
  4457. /**
  4458. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4459. *
  4460. * @private
  4461. * @param {Object} object The object to iterate over.
  4462. * @param {Function} iteratee The function invoked per iteration.
  4463. * @returns {Object} Returns `object`.
  4464. */
  4465. function baseForOwnRight(object, iteratee) {
  4466. return object && baseForRight(object, iteratee, keys);
  4467. }
  4468. /**
  4469. * The base implementation of `_.functions` which creates an array of
  4470. * `object` function property names filtered from `props`.
  4471. *
  4472. * @private
  4473. * @param {Object} object The object to inspect.
  4474. * @param {Array} props The property names to filter.
  4475. * @returns {Array} Returns the function names.
  4476. */
  4477. function baseFunctions(object, props) {
  4478. return arrayFilter(props, function(key) {
  4479. return isFunction(object[key]);
  4480. });
  4481. }
  4482. /**
  4483. * The base implementation of `_.get` without support for default values.
  4484. *
  4485. * @private
  4486. * @param {Object} object The object to query.
  4487. * @param {Array|string} path The path of the property to get.
  4488. * @returns {*} Returns the resolved value.
  4489. */
  4490. function baseGet(object, path) {
  4491. path = castPath(path, object);
  4492. var index = 0,
  4493. length = path.length;
  4494. while (object != null && index < length) {
  4495. object = object[toKey(path[index++])];
  4496. }
  4497. return (index && index == length) ? object : undefined;
  4498. }
  4499. /**
  4500. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4501. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4502. * symbols of `object`.
  4503. *
  4504. * @private
  4505. * @param {Object} object The object to query.
  4506. * @param {Function} keysFunc The function to get the keys of `object`.
  4507. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4508. * @returns {Array} Returns the array of property names and symbols.
  4509. */
  4510. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4511. var result = keysFunc(object);
  4512. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4513. }
  4514. /**
  4515. * The base implementation of `getTag` without fallbacks for buggy environments.
  4516. *
  4517. * @private
  4518. * @param {*} value The value to query.
  4519. * @returns {string} Returns the `toStringTag`.
  4520. */
  4521. function baseGetTag(value) {
  4522. if (value == null) {
  4523. return value === undefined ? undefinedTag : nullTag;
  4524. }
  4525. return (symToStringTag && symToStringTag in Object(value))
  4526. ? getRawTag(value)
  4527. : objectToString(value);
  4528. }
  4529. /**
  4530. * The base implementation of `_.gt` which doesn't coerce arguments.
  4531. *
  4532. * @private
  4533. * @param {*} value The value to compare.
  4534. * @param {*} other The other value to compare.
  4535. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4536. * else `false`.
  4537. */
  4538. function baseGt(value, other) {
  4539. return value > other;
  4540. }
  4541. /**
  4542. * The base implementation of `_.has` without support for deep paths.
  4543. *
  4544. * @private
  4545. * @param {Object} [object] The object to query.
  4546. * @param {Array|string} key The key to check.
  4547. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4548. */
  4549. function baseHas(object, key) {
  4550. return object != null && hasOwnProperty.call(object, key);
  4551. }
  4552. /**
  4553. * The base implementation of `_.hasIn` without support for deep paths.
  4554. *
  4555. * @private
  4556. * @param {Object} [object] The object to query.
  4557. * @param {Array|string} key The key to check.
  4558. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4559. */
  4560. function baseHasIn(object, key) {
  4561. return object != null && key in Object(object);
  4562. }
  4563. /**
  4564. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4565. *
  4566. * @private
  4567. * @param {number} number The number to check.
  4568. * @param {number} start The start of the range.
  4569. * @param {number} end The end of the range.
  4570. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4571. */
  4572. function baseInRange(number, start, end) {
  4573. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4574. }
  4575. /**
  4576. * The base implementation of methods like `_.intersection`, without support
  4577. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4578. *
  4579. * @private
  4580. * @param {Array} arrays The arrays to inspect.
  4581. * @param {Function} [iteratee] The iteratee invoked per element.
  4582. * @param {Function} [comparator] The comparator invoked per element.
  4583. * @returns {Array} Returns the new array of shared values.
  4584. */
  4585. function baseIntersection(arrays, iteratee, comparator) {
  4586. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4587. length = arrays[0].length,
  4588. othLength = arrays.length,
  4589. othIndex = othLength,
  4590. caches = Array(othLength),
  4591. maxLength = Infinity,
  4592. result = [];
  4593. while (othIndex--) {
  4594. var array = arrays[othIndex];
  4595. if (othIndex && iteratee) {
  4596. array = arrayMap(array, baseUnary(iteratee));
  4597. }
  4598. maxLength = nativeMin(array.length, maxLength);
  4599. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4600. ? new SetCache(othIndex && array)
  4601. : undefined;
  4602. }
  4603. array = arrays[0];
  4604. var index = -1,
  4605. seen = caches[0];
  4606. outer:
  4607. while (++index < length && result.length < maxLength) {
  4608. var value = array[index],
  4609. computed = iteratee ? iteratee(value) : value;
  4610. value = (comparator || value !== 0) ? value : 0;
  4611. if (!(seen
  4612. ? cacheHas(seen, computed)
  4613. : includes(result, computed, comparator)
  4614. )) {
  4615. othIndex = othLength;
  4616. while (--othIndex) {
  4617. var cache = caches[othIndex];
  4618. if (!(cache
  4619. ? cacheHas(cache, computed)
  4620. : includes(arrays[othIndex], computed, comparator))
  4621. ) {
  4622. continue outer;
  4623. }
  4624. }
  4625. if (seen) {
  4626. seen.push(computed);
  4627. }
  4628. result.push(value);
  4629. }
  4630. }
  4631. return result;
  4632. }
  4633. /**
  4634. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4635. * `object` with values transformed by `iteratee` and set by `setter`.
  4636. *
  4637. * @private
  4638. * @param {Object} object The object to iterate over.
  4639. * @param {Function} setter The function to set `accumulator` values.
  4640. * @param {Function} iteratee The iteratee to transform values.
  4641. * @param {Object} accumulator The initial inverted object.
  4642. * @returns {Function} Returns `accumulator`.
  4643. */
  4644. function baseInverter(object, setter, iteratee, accumulator) {
  4645. baseForOwn(object, function(value, key, object) {
  4646. setter(accumulator, iteratee(value), key, object);
  4647. });
  4648. return accumulator;
  4649. }
  4650. /**
  4651. * The base implementation of `_.invoke` without support for individual
  4652. * method arguments.
  4653. *
  4654. * @private
  4655. * @param {Object} object The object to query.
  4656. * @param {Array|string} path The path of the method to invoke.
  4657. * @param {Array} args The arguments to invoke the method with.
  4658. * @returns {*} Returns the result of the invoked method.
  4659. */
  4660. function baseInvoke(object, path, args) {
  4661. path = castPath(path, object);
  4662. object = parent(object, path);
  4663. var func = object == null ? object : object[toKey(last(path))];
  4664. return func == null ? undefined : apply(func, object, args);
  4665. }
  4666. /**
  4667. * The base implementation of `_.isArguments`.
  4668. *
  4669. * @private
  4670. * @param {*} value The value to check.
  4671. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4672. */
  4673. function baseIsArguments(value) {
  4674. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4675. }
  4676. /**
  4677. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4678. *
  4679. * @private
  4680. * @param {*} value The value to check.
  4681. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4682. */
  4683. function baseIsArrayBuffer(value) {
  4684. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4685. }
  4686. /**
  4687. * The base implementation of `_.isDate` without Node.js optimizations.
  4688. *
  4689. * @private
  4690. * @param {*} value The value to check.
  4691. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4692. */
  4693. function baseIsDate(value) {
  4694. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4695. }
  4696. /**
  4697. * The base implementation of `_.isEqual` which supports partial comparisons
  4698. * and tracks traversed objects.
  4699. *
  4700. * @private
  4701. * @param {*} value The value to compare.
  4702. * @param {*} other The other value to compare.
  4703. * @param {boolean} bitmask The bitmask flags.
  4704. * 1 - Unordered comparison
  4705. * 2 - Partial comparison
  4706. * @param {Function} [customizer] The function to customize comparisons.
  4707. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4708. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4709. */
  4710. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4711. if (value === other) {
  4712. return true;
  4713. }
  4714. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4715. return value !== value && other !== other;
  4716. }
  4717. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4718. }
  4719. /**
  4720. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4721. * deep comparisons and tracks traversed objects enabling objects with circular
  4722. * references to be compared.
  4723. *
  4724. * @private
  4725. * @param {Object} object The object to compare.
  4726. * @param {Object} other The other object to compare.
  4727. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4728. * @param {Function} customizer The function to customize comparisons.
  4729. * @param {Function} equalFunc The function to determine equivalents of values.
  4730. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4731. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4732. */
  4733. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4734. var objIsArr = isArray(object),
  4735. othIsArr = isArray(other),
  4736. objTag = objIsArr ? arrayTag : getTag(object),
  4737. othTag = othIsArr ? arrayTag : getTag(other);
  4738. objTag = objTag == argsTag ? objectTag : objTag;
  4739. othTag = othTag == argsTag ? objectTag : othTag;
  4740. var objIsObj = objTag == objectTag,
  4741. othIsObj = othTag == objectTag,
  4742. isSameTag = objTag == othTag;
  4743. if (isSameTag && isBuffer(object)) {
  4744. if (!isBuffer(other)) {
  4745. return false;
  4746. }
  4747. objIsArr = true;
  4748. objIsObj = false;
  4749. }
  4750. if (isSameTag && !objIsObj) {
  4751. stack || (stack = new Stack);
  4752. return (objIsArr || isTypedArray(object))
  4753. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4754. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4755. }
  4756. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4757. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4758. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4759. if (objIsWrapped || othIsWrapped) {
  4760. var objUnwrapped = objIsWrapped ? object.value() : object,
  4761. othUnwrapped = othIsWrapped ? other.value() : other;
  4762. stack || (stack = new Stack);
  4763. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4764. }
  4765. }
  4766. if (!isSameTag) {
  4767. return false;
  4768. }
  4769. stack || (stack = new Stack);
  4770. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4771. }
  4772. /**
  4773. * The base implementation of `_.isMap` without Node.js optimizations.
  4774. *
  4775. * @private
  4776. * @param {*} value The value to check.
  4777. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4778. */
  4779. function baseIsMap(value) {
  4780. return isObjectLike(value) && getTag(value) == mapTag;
  4781. }
  4782. /**
  4783. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4784. *
  4785. * @private
  4786. * @param {Object} object The object to inspect.
  4787. * @param {Object} source The object of property values to match.
  4788. * @param {Array} matchData The property names, values, and compare flags to match.
  4789. * @param {Function} [customizer] The function to customize comparisons.
  4790. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4791. */
  4792. function baseIsMatch(object, source, matchData, customizer) {
  4793. var index = matchData.length,
  4794. length = index,
  4795. noCustomizer = !customizer;
  4796. if (object == null) {
  4797. return !length;
  4798. }
  4799. object = Object(object);
  4800. while (index--) {
  4801. var data = matchData[index];
  4802. if ((noCustomizer && data[2])
  4803. ? data[1] !== object[data[0]]
  4804. : !(data[0] in object)
  4805. ) {
  4806. return false;
  4807. }
  4808. }
  4809. while (++index < length) {
  4810. data = matchData[index];
  4811. var key = data[0],
  4812. objValue = object[key],
  4813. srcValue = data[1];
  4814. if (noCustomizer && data[2]) {
  4815. if (objValue === undefined && !(key in object)) {
  4816. return false;
  4817. }
  4818. } else {
  4819. var stack = new Stack;
  4820. if (customizer) {
  4821. var result = customizer(objValue, srcValue, key, object, source, stack);
  4822. }
  4823. if (!(result === undefined
  4824. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4825. : result
  4826. )) {
  4827. return false;
  4828. }
  4829. }
  4830. }
  4831. return true;
  4832. }
  4833. /**
  4834. * The base implementation of `_.isNative` without bad shim checks.
  4835. *
  4836. * @private
  4837. * @param {*} value The value to check.
  4838. * @returns {boolean} Returns `true` if `value` is a native function,
  4839. * else `false`.
  4840. */
  4841. function baseIsNative(value) {
  4842. if (!isObject(value) || isMasked(value)) {
  4843. return false;
  4844. }
  4845. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4846. return pattern.test(toSource(value));
  4847. }
  4848. /**
  4849. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4850. *
  4851. * @private
  4852. * @param {*} value The value to check.
  4853. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4854. */
  4855. function baseIsRegExp(value) {
  4856. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4857. }
  4858. /**
  4859. * The base implementation of `_.isSet` without Node.js optimizations.
  4860. *
  4861. * @private
  4862. * @param {*} value The value to check.
  4863. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4864. */
  4865. function baseIsSet(value) {
  4866. return isObjectLike(value) && getTag(value) == setTag;
  4867. }
  4868. /**
  4869. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4870. *
  4871. * @private
  4872. * @param {*} value The value to check.
  4873. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4874. */
  4875. function baseIsTypedArray(value) {
  4876. return isObjectLike(value) &&
  4877. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4878. }
  4879. /**
  4880. * The base implementation of `_.iteratee`.
  4881. *
  4882. * @private
  4883. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4884. * @returns {Function} Returns the iteratee.
  4885. */
  4886. function baseIteratee(value) {
  4887. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4888. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4889. if (typeof value == 'function') {
  4890. return value;
  4891. }
  4892. if (value == null) {
  4893. return identity;
  4894. }
  4895. if (typeof value == 'object') {
  4896. return isArray(value)
  4897. ? baseMatchesProperty(value[0], value[1])
  4898. : baseMatches(value);
  4899. }
  4900. return property(value);
  4901. }
  4902. /**
  4903. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4904. *
  4905. * @private
  4906. * @param {Object} object The object to query.
  4907. * @returns {Array} Returns the array of property names.
  4908. */
  4909. function baseKeys(object) {
  4910. if (!isPrototype(object)) {
  4911. return nativeKeys(object);
  4912. }
  4913. var result = [];
  4914. for (var key in Object(object)) {
  4915. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4916. result.push(key);
  4917. }
  4918. }
  4919. return result;
  4920. }
  4921. /**
  4922. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4923. *
  4924. * @private
  4925. * @param {Object} object The object to query.
  4926. * @returns {Array} Returns the array of property names.
  4927. */
  4928. function baseKeysIn(object) {
  4929. if (!isObject(object)) {
  4930. return nativeKeysIn(object);
  4931. }
  4932. var isProto = isPrototype(object),
  4933. result = [];
  4934. for (var key in object) {
  4935. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4936. result.push(key);
  4937. }
  4938. }
  4939. return result;
  4940. }
  4941. /**
  4942. * The base implementation of `_.lt` which doesn't coerce arguments.
  4943. *
  4944. * @private
  4945. * @param {*} value The value to compare.
  4946. * @param {*} other The other value to compare.
  4947. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4948. * else `false`.
  4949. */
  4950. function baseLt(value, other) {
  4951. return value < other;
  4952. }
  4953. /**
  4954. * The base implementation of `_.map` without support for iteratee shorthands.
  4955. *
  4956. * @private
  4957. * @param {Array|Object} collection The collection to iterate over.
  4958. * @param {Function} iteratee The function invoked per iteration.
  4959. * @returns {Array} Returns the new mapped array.
  4960. */
  4961. function baseMap(collection, iteratee) {
  4962. var index = -1,
  4963. result = isArrayLike(collection) ? Array(collection.length) : [];
  4964. baseEach(collection, function(value, key, collection) {
  4965. result[++index] = iteratee(value, key, collection);
  4966. });
  4967. return result;
  4968. }
  4969. /**
  4970. * The base implementation of `_.matches` which doesn't clone `source`.
  4971. *
  4972. * @private
  4973. * @param {Object} source The object of property values to match.
  4974. * @returns {Function} Returns the new spec function.
  4975. */
  4976. function baseMatches(source) {
  4977. var matchData = getMatchData(source);
  4978. if (matchData.length == 1 && matchData[0][2]) {
  4979. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4980. }
  4981. return function(object) {
  4982. return object === source || baseIsMatch(object, source, matchData);
  4983. };
  4984. }
  4985. /**
  4986. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4987. *
  4988. * @private
  4989. * @param {string} path The path of the property to get.
  4990. * @param {*} srcValue The value to match.
  4991. * @returns {Function} Returns the new spec function.
  4992. */
  4993. function baseMatchesProperty(path, srcValue) {
  4994. if (isKey(path) && isStrictComparable(srcValue)) {
  4995. return matchesStrictComparable(toKey(path), srcValue);
  4996. }
  4997. return function(object) {
  4998. var objValue = get(object, path);
  4999. return (objValue === undefined && objValue === srcValue)
  5000. ? hasIn(object, path)
  5001. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  5002. };
  5003. }
  5004. /**
  5005. * The base implementation of `_.merge` without support for multiple sources.
  5006. *
  5007. * @private
  5008. * @param {Object} object The destination object.
  5009. * @param {Object} source The source object.
  5010. * @param {number} srcIndex The index of `source`.
  5011. * @param {Function} [customizer] The function to customize merged values.
  5012. * @param {Object} [stack] Tracks traversed source values and their merged
  5013. * counterparts.
  5014. */
  5015. function baseMerge(object, source, srcIndex, customizer, stack) {
  5016. if (object === source) {
  5017. return;
  5018. }
  5019. baseFor(source, function(srcValue, key) {
  5020. stack || (stack = new Stack);
  5021. if (isObject(srcValue)) {
  5022. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  5023. }
  5024. else {
  5025. var newValue = customizer
  5026. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  5027. : undefined;
  5028. if (newValue === undefined) {
  5029. newValue = srcValue;
  5030. }
  5031. assignMergeValue(object, key, newValue);
  5032. }
  5033. }, keysIn);
  5034. }
  5035. /**
  5036. * A specialized version of `baseMerge` for arrays and objects which performs
  5037. * deep merges and tracks traversed objects enabling objects with circular
  5038. * references to be merged.
  5039. *
  5040. * @private
  5041. * @param {Object} object The destination object.
  5042. * @param {Object} source The source object.
  5043. * @param {string} key The key of the value to merge.
  5044. * @param {number} srcIndex The index of `source`.
  5045. * @param {Function} mergeFunc The function to merge values.
  5046. * @param {Function} [customizer] The function to customize assigned values.
  5047. * @param {Object} [stack] Tracks traversed source values and their merged
  5048. * counterparts.
  5049. */
  5050. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  5051. var objValue = safeGet(object, key),
  5052. srcValue = safeGet(source, key),
  5053. stacked = stack.get(srcValue);
  5054. if (stacked) {
  5055. assignMergeValue(object, key, stacked);
  5056. return;
  5057. }
  5058. var newValue = customizer
  5059. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  5060. : undefined;
  5061. var isCommon = newValue === undefined;
  5062. if (isCommon) {
  5063. var isArr = isArray(srcValue),
  5064. isBuff = !isArr && isBuffer(srcValue),
  5065. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  5066. newValue = srcValue;
  5067. if (isArr || isBuff || isTyped) {
  5068. if (isArray(objValue)) {
  5069. newValue = objValue;
  5070. }
  5071. else if (isArrayLikeObject(objValue)) {
  5072. newValue = copyArray(objValue);
  5073. }
  5074. else if (isBuff) {
  5075. isCommon = false;
  5076. newValue = cloneBuffer(srcValue, true);
  5077. }
  5078. else if (isTyped) {
  5079. isCommon = false;
  5080. newValue = cloneTypedArray(srcValue, true);
  5081. }
  5082. else {
  5083. newValue = [];
  5084. }
  5085. }
  5086. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  5087. newValue = objValue;
  5088. if (isArguments(objValue)) {
  5089. newValue = toPlainObject(objValue);
  5090. }
  5091. else if (!isObject(objValue) || isFunction(objValue)) {
  5092. newValue = initCloneObject(srcValue);
  5093. }
  5094. }
  5095. else {
  5096. isCommon = false;
  5097. }
  5098. }
  5099. if (isCommon) {
  5100. // Recursively merge objects and arrays (susceptible to call stack limits).
  5101. stack.set(srcValue, newValue);
  5102. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  5103. stack['delete'](srcValue);
  5104. }
  5105. assignMergeValue(object, key, newValue);
  5106. }
  5107. /**
  5108. * The base implementation of `_.nth` which doesn't coerce arguments.
  5109. *
  5110. * @private
  5111. * @param {Array} array The array to query.
  5112. * @param {number} n The index of the element to return.
  5113. * @returns {*} Returns the nth element of `array`.
  5114. */
  5115. function baseNth(array, n) {
  5116. var length = array.length;
  5117. if (!length) {
  5118. return;
  5119. }
  5120. n += n < 0 ? length : 0;
  5121. return isIndex(n, length) ? array[n] : undefined;
  5122. }
  5123. /**
  5124. * The base implementation of `_.orderBy` without param guards.
  5125. *
  5126. * @private
  5127. * @param {Array|Object} collection The collection to iterate over.
  5128. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  5129. * @param {string[]} orders The sort orders of `iteratees`.
  5130. * @returns {Array} Returns the new sorted array.
  5131. */
  5132. function baseOrderBy(collection, iteratees, orders) {
  5133. if (iteratees.length) {
  5134. iteratees = arrayMap(iteratees, function(iteratee) {
  5135. if (isArray(iteratee)) {
  5136. return function(value) {
  5137. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  5138. }
  5139. }
  5140. return iteratee;
  5141. });
  5142. } else {
  5143. iteratees = [identity];
  5144. }
  5145. var index = -1;
  5146. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5147. var result = baseMap(collection, function(value, key, collection) {
  5148. var criteria = arrayMap(iteratees, function(iteratee) {
  5149. return iteratee(value);
  5150. });
  5151. return { 'criteria': criteria, 'index': ++index, 'value': value };
  5152. });
  5153. return baseSortBy(result, function(object, other) {
  5154. return compareMultiple(object, other, orders);
  5155. });
  5156. }
  5157. /**
  5158. * The base implementation of `_.pick` without support for individual
  5159. * property identifiers.
  5160. *
  5161. * @private
  5162. * @param {Object} object The source object.
  5163. * @param {string[]} paths The property paths to pick.
  5164. * @returns {Object} Returns the new object.
  5165. */
  5166. function basePick(object, paths) {
  5167. return basePickBy(object, paths, function(value, path) {
  5168. return hasIn(object, path);
  5169. });
  5170. }
  5171. /**
  5172. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5173. *
  5174. * @private
  5175. * @param {Object} object The source object.
  5176. * @param {string[]} paths The property paths to pick.
  5177. * @param {Function} predicate The function invoked per property.
  5178. * @returns {Object} Returns the new object.
  5179. */
  5180. function basePickBy(object, paths, predicate) {
  5181. var index = -1,
  5182. length = paths.length,
  5183. result = {};
  5184. while (++index < length) {
  5185. var path = paths[index],
  5186. value = baseGet(object, path);
  5187. if (predicate(value, path)) {
  5188. baseSet(result, castPath(path, object), value);
  5189. }
  5190. }
  5191. return result;
  5192. }
  5193. /**
  5194. * A specialized version of `baseProperty` which supports deep paths.
  5195. *
  5196. * @private
  5197. * @param {Array|string} path The path of the property to get.
  5198. * @returns {Function} Returns the new accessor function.
  5199. */
  5200. function basePropertyDeep(path) {
  5201. return function(object) {
  5202. return baseGet(object, path);
  5203. };
  5204. }
  5205. /**
  5206. * The base implementation of `_.pullAllBy` without support for iteratee
  5207. * shorthands.
  5208. *
  5209. * @private
  5210. * @param {Array} array The array to modify.
  5211. * @param {Array} values The values to remove.
  5212. * @param {Function} [iteratee] The iteratee invoked per element.
  5213. * @param {Function} [comparator] The comparator invoked per element.
  5214. * @returns {Array} Returns `array`.
  5215. */
  5216. function basePullAll(array, values, iteratee, comparator) {
  5217. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  5218. index = -1,
  5219. length = values.length,
  5220. seen = array;
  5221. if (array === values) {
  5222. values = copyArray(values);
  5223. }
  5224. if (iteratee) {
  5225. seen = arrayMap(array, baseUnary(iteratee));
  5226. }
  5227. while (++index < length) {
  5228. var fromIndex = 0,
  5229. value = values[index],
  5230. computed = iteratee ? iteratee(value) : value;
  5231. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  5232. if (seen !== array) {
  5233. splice.call(seen, fromIndex, 1);
  5234. }
  5235. splice.call(array, fromIndex, 1);
  5236. }
  5237. }
  5238. return array;
  5239. }
  5240. /**
  5241. * The base implementation of `_.pullAt` without support for individual
  5242. * indexes or capturing the removed elements.
  5243. *
  5244. * @private
  5245. * @param {Array} array The array to modify.
  5246. * @param {number[]} indexes The indexes of elements to remove.
  5247. * @returns {Array} Returns `array`.
  5248. */
  5249. function basePullAt(array, indexes) {
  5250. var length = array ? indexes.length : 0,
  5251. lastIndex = length - 1;
  5252. while (length--) {
  5253. var index = indexes[length];
  5254. if (length == lastIndex || index !== previous) {
  5255. var previous = index;
  5256. if (isIndex(index)) {
  5257. splice.call(array, index, 1);
  5258. } else {
  5259. baseUnset(array, index);
  5260. }
  5261. }
  5262. }
  5263. return array;
  5264. }
  5265. /**
  5266. * The base implementation of `_.random` without support for returning
  5267. * floating-point numbers.
  5268. *
  5269. * @private
  5270. * @param {number} lower The lower bound.
  5271. * @param {number} upper The upper bound.
  5272. * @returns {number} Returns the random number.
  5273. */
  5274. function baseRandom(lower, upper) {
  5275. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  5276. }
  5277. /**
  5278. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  5279. * coerce arguments.
  5280. *
  5281. * @private
  5282. * @param {number} start The start of the range.
  5283. * @param {number} end The end of the range.
  5284. * @param {number} step The value to increment or decrement by.
  5285. * @param {boolean} [fromRight] Specify iterating from right to left.
  5286. * @returns {Array} Returns the range of numbers.
  5287. */
  5288. function baseRange(start, end, step, fromRight) {
  5289. var index = -1,
  5290. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  5291. result = Array(length);
  5292. while (length--) {
  5293. result[fromRight ? length : ++index] = start;
  5294. start += step;
  5295. }
  5296. return result;
  5297. }
  5298. /**
  5299. * The base implementation of `_.repeat` which doesn't coerce arguments.
  5300. *
  5301. * @private
  5302. * @param {string} string The string to repeat.
  5303. * @param {number} n The number of times to repeat the string.
  5304. * @returns {string} Returns the repeated string.
  5305. */
  5306. function baseRepeat(string, n) {
  5307. var result = '';
  5308. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  5309. return result;
  5310. }
  5311. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  5312. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  5313. do {
  5314. if (n % 2) {
  5315. result += string;
  5316. }
  5317. n = nativeFloor(n / 2);
  5318. if (n) {
  5319. string += string;
  5320. }
  5321. } while (n);
  5322. return result;
  5323. }
  5324. /**
  5325. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  5326. *
  5327. * @private
  5328. * @param {Function} func The function to apply a rest parameter to.
  5329. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5330. * @returns {Function} Returns the new function.
  5331. */
  5332. function baseRest(func, start) {
  5333. return setToString(overRest(func, start, identity), func + '');
  5334. }
  5335. /**
  5336. * The base implementation of `_.sample`.
  5337. *
  5338. * @private
  5339. * @param {Array|Object} collection The collection to sample.
  5340. * @returns {*} Returns the random element.
  5341. */
  5342. function baseSample(collection) {
  5343. return arraySample(values(collection));
  5344. }
  5345. /**
  5346. * The base implementation of `_.sampleSize` without param guards.
  5347. *
  5348. * @private
  5349. * @param {Array|Object} collection The collection to sample.
  5350. * @param {number} n The number of elements to sample.
  5351. * @returns {Array} Returns the random elements.
  5352. */
  5353. function baseSampleSize(collection, n) {
  5354. var array = values(collection);
  5355. return shuffleSelf(array, baseClamp(n, 0, array.length));
  5356. }
  5357. /**
  5358. * The base implementation of `_.set`.
  5359. *
  5360. * @private
  5361. * @param {Object} object The object to modify.
  5362. * @param {Array|string} path The path of the property to set.
  5363. * @param {*} value The value to set.
  5364. * @param {Function} [customizer] The function to customize path creation.
  5365. * @returns {Object} Returns `object`.
  5366. */
  5367. function baseSet(object, path, value, customizer) {
  5368. if (!isObject(object)) {
  5369. return object;
  5370. }
  5371. path = castPath(path, object);
  5372. var index = -1,
  5373. length = path.length,
  5374. lastIndex = length - 1,
  5375. nested = object;
  5376. while (nested != null && ++index < length) {
  5377. var key = toKey(path[index]),
  5378. newValue = value;
  5379. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  5380. return object;
  5381. }
  5382. if (index != lastIndex) {
  5383. var objValue = nested[key];
  5384. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5385. if (newValue === undefined) {
  5386. newValue = isObject(objValue)
  5387. ? objValue
  5388. : (isIndex(path[index + 1]) ? [] : {});
  5389. }
  5390. }
  5391. assignValue(nested, key, newValue);
  5392. nested = nested[key];
  5393. }
  5394. return object;
  5395. }
  5396. /**
  5397. * The base implementation of `setData` without support for hot loop shorting.
  5398. *
  5399. * @private
  5400. * @param {Function} func The function to associate metadata with.
  5401. * @param {*} data The metadata.
  5402. * @returns {Function} Returns `func`.
  5403. */
  5404. var baseSetData = !metaMap ? identity : function(func, data) {
  5405. metaMap.set(func, data);
  5406. return func;
  5407. };
  5408. /**
  5409. * The base implementation of `setToString` without support for hot loop shorting.
  5410. *
  5411. * @private
  5412. * @param {Function} func The function to modify.
  5413. * @param {Function} string The `toString` result.
  5414. * @returns {Function} Returns `func`.
  5415. */
  5416. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5417. return defineProperty(func, 'toString', {
  5418. 'configurable': true,
  5419. 'enumerable': false,
  5420. 'value': constant(string),
  5421. 'writable': true
  5422. });
  5423. };
  5424. /**
  5425. * The base implementation of `_.shuffle`.
  5426. *
  5427. * @private
  5428. * @param {Array|Object} collection The collection to shuffle.
  5429. * @returns {Array} Returns the new shuffled array.
  5430. */
  5431. function baseShuffle(collection) {
  5432. return shuffleSelf(values(collection));
  5433. }
  5434. /**
  5435. * The base implementation of `_.slice` without an iteratee call guard.
  5436. *
  5437. * @private
  5438. * @param {Array} array The array to slice.
  5439. * @param {number} [start=0] The start position.
  5440. * @param {number} [end=array.length] The end position.
  5441. * @returns {Array} Returns the slice of `array`.
  5442. */
  5443. function baseSlice(array, start, end) {
  5444. var index = -1,
  5445. length = array.length;
  5446. if (start < 0) {
  5447. start = -start > length ? 0 : (length + start);
  5448. }
  5449. end = end > length ? length : end;
  5450. if (end < 0) {
  5451. end += length;
  5452. }
  5453. length = start > end ? 0 : ((end - start) >>> 0);
  5454. start >>>= 0;
  5455. var result = Array(length);
  5456. while (++index < length) {
  5457. result[index] = array[index + start];
  5458. }
  5459. return result;
  5460. }
  5461. /**
  5462. * The base implementation of `_.some` without support for iteratee shorthands.
  5463. *
  5464. * @private
  5465. * @param {Array|Object} collection The collection to iterate over.
  5466. * @param {Function} predicate The function invoked per iteration.
  5467. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5468. * else `false`.
  5469. */
  5470. function baseSome(collection, predicate) {
  5471. var result;
  5472. baseEach(collection, function(value, index, collection) {
  5473. result = predicate(value, index, collection);
  5474. return !result;
  5475. });
  5476. return !!result;
  5477. }
  5478. /**
  5479. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5480. * performs a binary search of `array` to determine the index at which `value`
  5481. * should be inserted into `array` in order to maintain its sort order.
  5482. *
  5483. * @private
  5484. * @param {Array} array The sorted array to inspect.
  5485. * @param {*} value The value to evaluate.
  5486. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5487. * @returns {number} Returns the index at which `value` should be inserted
  5488. * into `array`.
  5489. */
  5490. function baseSortedIndex(array, value, retHighest) {
  5491. var low = 0,
  5492. high = array == null ? low : array.length;
  5493. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5494. while (low < high) {
  5495. var mid = (low + high) >>> 1,
  5496. computed = array[mid];
  5497. if (computed !== null && !isSymbol(computed) &&
  5498. (retHighest ? (computed <= value) : (computed < value))) {
  5499. low = mid + 1;
  5500. } else {
  5501. high = mid;
  5502. }
  5503. }
  5504. return high;
  5505. }
  5506. return baseSortedIndexBy(array, value, identity, retHighest);
  5507. }
  5508. /**
  5509. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5510. * which invokes `iteratee` for `value` and each element of `array` to compute
  5511. * their sort ranking. The iteratee is invoked with one argument; (value).
  5512. *
  5513. * @private
  5514. * @param {Array} array The sorted array to inspect.
  5515. * @param {*} value The value to evaluate.
  5516. * @param {Function} iteratee The iteratee invoked per element.
  5517. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5518. * @returns {number} Returns the index at which `value` should be inserted
  5519. * into `array`.
  5520. */
  5521. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5522. var low = 0,
  5523. high = array == null ? 0 : array.length;
  5524. if (high === 0) {
  5525. return 0;
  5526. }
  5527. value = iteratee(value);
  5528. var valIsNaN = value !== value,
  5529. valIsNull = value === null,
  5530. valIsSymbol = isSymbol(value),
  5531. valIsUndefined = value === undefined;
  5532. while (low < high) {
  5533. var mid = nativeFloor((low + high) / 2),
  5534. computed = iteratee(array[mid]),
  5535. othIsDefined = computed !== undefined,
  5536. othIsNull = computed === null,
  5537. othIsReflexive = computed === computed,
  5538. othIsSymbol = isSymbol(computed);
  5539. if (valIsNaN) {
  5540. var setLow = retHighest || othIsReflexive;
  5541. } else if (valIsUndefined) {
  5542. setLow = othIsReflexive && (retHighest || othIsDefined);
  5543. } else if (valIsNull) {
  5544. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5545. } else if (valIsSymbol) {
  5546. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5547. } else if (othIsNull || othIsSymbol) {
  5548. setLow = false;
  5549. } else {
  5550. setLow = retHighest ? (computed <= value) : (computed < value);
  5551. }
  5552. if (setLow) {
  5553. low = mid + 1;
  5554. } else {
  5555. high = mid;
  5556. }
  5557. }
  5558. return nativeMin(high, MAX_ARRAY_INDEX);
  5559. }
  5560. /**
  5561. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5562. * support for iteratee shorthands.
  5563. *
  5564. * @private
  5565. * @param {Array} array The array to inspect.
  5566. * @param {Function} [iteratee] The iteratee invoked per element.
  5567. * @returns {Array} Returns the new duplicate free array.
  5568. */
  5569. function baseSortedUniq(array, iteratee) {
  5570. var index = -1,
  5571. length = array.length,
  5572. resIndex = 0,
  5573. result = [];
  5574. while (++index < length) {
  5575. var value = array[index],
  5576. computed = iteratee ? iteratee(value) : value;
  5577. if (!index || !eq(computed, seen)) {
  5578. var seen = computed;
  5579. result[resIndex++] = value === 0 ? 0 : value;
  5580. }
  5581. }
  5582. return result;
  5583. }
  5584. /**
  5585. * The base implementation of `_.toNumber` which doesn't ensure correct
  5586. * conversions of binary, hexadecimal, or octal string values.
  5587. *
  5588. * @private
  5589. * @param {*} value The value to process.
  5590. * @returns {number} Returns the number.
  5591. */
  5592. function baseToNumber(value) {
  5593. if (typeof value == 'number') {
  5594. return value;
  5595. }
  5596. if (isSymbol(value)) {
  5597. return NAN;
  5598. }
  5599. return +value;
  5600. }
  5601. /**
  5602. * The base implementation of `_.toString` which doesn't convert nullish
  5603. * values to empty strings.
  5604. *
  5605. * @private
  5606. * @param {*} value The value to process.
  5607. * @returns {string} Returns the string.
  5608. */
  5609. function baseToString(value) {
  5610. // Exit early for strings to avoid a performance hit in some environments.
  5611. if (typeof value == 'string') {
  5612. return value;
  5613. }
  5614. if (isArray(value)) {
  5615. // Recursively convert values (susceptible to call stack limits).
  5616. return arrayMap(value, baseToString) + '';
  5617. }
  5618. if (isSymbol(value)) {
  5619. return symbolToString ? symbolToString.call(value) : '';
  5620. }
  5621. var result = (value + '');
  5622. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5623. }
  5624. /**
  5625. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5626. *
  5627. * @private
  5628. * @param {Array} array The array to inspect.
  5629. * @param {Function} [iteratee] The iteratee invoked per element.
  5630. * @param {Function} [comparator] The comparator invoked per element.
  5631. * @returns {Array} Returns the new duplicate free array.
  5632. */
  5633. function baseUniq(array, iteratee, comparator) {
  5634. var index = -1,
  5635. includes = arrayIncludes,
  5636. length = array.length,
  5637. isCommon = true,
  5638. result = [],
  5639. seen = result;
  5640. if (comparator) {
  5641. isCommon = false;
  5642. includes = arrayIncludesWith;
  5643. }
  5644. else if (length >= LARGE_ARRAY_SIZE) {
  5645. var set = iteratee ? null : createSet(array);
  5646. if (set) {
  5647. return setToArray(set);
  5648. }
  5649. isCommon = false;
  5650. includes = cacheHas;
  5651. seen = new SetCache;
  5652. }
  5653. else {
  5654. seen = iteratee ? [] : result;
  5655. }
  5656. outer:
  5657. while (++index < length) {
  5658. var value = array[index],
  5659. computed = iteratee ? iteratee(value) : value;
  5660. value = (comparator || value !== 0) ? value : 0;
  5661. if (isCommon && computed === computed) {
  5662. var seenIndex = seen.length;
  5663. while (seenIndex--) {
  5664. if (seen[seenIndex] === computed) {
  5665. continue outer;
  5666. }
  5667. }
  5668. if (iteratee) {
  5669. seen.push(computed);
  5670. }
  5671. result.push(value);
  5672. }
  5673. else if (!includes(seen, computed, comparator)) {
  5674. if (seen !== result) {
  5675. seen.push(computed);
  5676. }
  5677. result.push(value);
  5678. }
  5679. }
  5680. return result;
  5681. }
  5682. /**
  5683. * The base implementation of `_.unset`.
  5684. *
  5685. * @private
  5686. * @param {Object} object The object to modify.
  5687. * @param {Array|string} path The property path to unset.
  5688. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5689. */
  5690. function baseUnset(object, path) {
  5691. path = castPath(path, object);
  5692. object = parent(object, path);
  5693. return object == null || delete object[toKey(last(path))];
  5694. }
  5695. /**
  5696. * The base implementation of `_.update`.
  5697. *
  5698. * @private
  5699. * @param {Object} object The object to modify.
  5700. * @param {Array|string} path The path of the property to update.
  5701. * @param {Function} updater The function to produce the updated value.
  5702. * @param {Function} [customizer] The function to customize path creation.
  5703. * @returns {Object} Returns `object`.
  5704. */
  5705. function baseUpdate(object, path, updater, customizer) {
  5706. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5707. }
  5708. /**
  5709. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5710. * without support for iteratee shorthands.
  5711. *
  5712. * @private
  5713. * @param {Array} array The array to query.
  5714. * @param {Function} predicate The function invoked per iteration.
  5715. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5716. * @param {boolean} [fromRight] Specify iterating from right to left.
  5717. * @returns {Array} Returns the slice of `array`.
  5718. */
  5719. function baseWhile(array, predicate, isDrop, fromRight) {
  5720. var length = array.length,
  5721. index = fromRight ? length : -1;
  5722. while ((fromRight ? index-- : ++index < length) &&
  5723. predicate(array[index], index, array)) {}
  5724. return isDrop
  5725. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5726. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5727. }
  5728. /**
  5729. * The base implementation of `wrapperValue` which returns the result of
  5730. * performing a sequence of actions on the unwrapped `value`, where each
  5731. * successive action is supplied the return value of the previous.
  5732. *
  5733. * @private
  5734. * @param {*} value The unwrapped value.
  5735. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5736. * @returns {*} Returns the resolved value.
  5737. */
  5738. function baseWrapperValue(value, actions) {
  5739. var result = value;
  5740. if (result instanceof LazyWrapper) {
  5741. result = result.value();
  5742. }
  5743. return arrayReduce(actions, function(result, action) {
  5744. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5745. }, result);
  5746. }
  5747. /**
  5748. * The base implementation of methods like `_.xor`, without support for
  5749. * iteratee shorthands, that accepts an array of arrays to inspect.
  5750. *
  5751. * @private
  5752. * @param {Array} arrays The arrays to inspect.
  5753. * @param {Function} [iteratee] The iteratee invoked per element.
  5754. * @param {Function} [comparator] The comparator invoked per element.
  5755. * @returns {Array} Returns the new array of values.
  5756. */
  5757. function baseXor(arrays, iteratee, comparator) {
  5758. var length = arrays.length;
  5759. if (length < 2) {
  5760. return length ? baseUniq(arrays[0]) : [];
  5761. }
  5762. var index = -1,
  5763. result = Array(length);
  5764. while (++index < length) {
  5765. var array = arrays[index],
  5766. othIndex = -1;
  5767. while (++othIndex < length) {
  5768. if (othIndex != index) {
  5769. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5770. }
  5771. }
  5772. }
  5773. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5774. }
  5775. /**
  5776. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5777. *
  5778. * @private
  5779. * @param {Array} props The property identifiers.
  5780. * @param {Array} values The property values.
  5781. * @param {Function} assignFunc The function to assign values.
  5782. * @returns {Object} Returns the new object.
  5783. */
  5784. function baseZipObject(props, values, assignFunc) {
  5785. var index = -1,
  5786. length = props.length,
  5787. valsLength = values.length,
  5788. result = {};
  5789. while (++index < length) {
  5790. var value = index < valsLength ? values[index] : undefined;
  5791. assignFunc(result, props[index], value);
  5792. }
  5793. return result;
  5794. }
  5795. /**
  5796. * Casts `value` to an empty array if it's not an array like object.
  5797. *
  5798. * @private
  5799. * @param {*} value The value to inspect.
  5800. * @returns {Array|Object} Returns the cast array-like object.
  5801. */
  5802. function castArrayLikeObject(value) {
  5803. return isArrayLikeObject(value) ? value : [];
  5804. }
  5805. /**
  5806. * Casts `value` to `identity` if it's not a function.
  5807. *
  5808. * @private
  5809. * @param {*} value The value to inspect.
  5810. * @returns {Function} Returns cast function.
  5811. */
  5812. function castFunction(value) {
  5813. return typeof value == 'function' ? value : identity;
  5814. }
  5815. /**
  5816. * Casts `value` to a path array if it's not one.
  5817. *
  5818. * @private
  5819. * @param {*} value The value to inspect.
  5820. * @param {Object} [object] The object to query keys on.
  5821. * @returns {Array} Returns the cast property path array.
  5822. */
  5823. function castPath(value, object) {
  5824. if (isArray(value)) {
  5825. return value;
  5826. }
  5827. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5828. }
  5829. /**
  5830. * A `baseRest` alias which can be replaced with `identity` by module
  5831. * replacement plugins.
  5832. *
  5833. * @private
  5834. * @type {Function}
  5835. * @param {Function} func The function to apply a rest parameter to.
  5836. * @returns {Function} Returns the new function.
  5837. */
  5838. var castRest = baseRest;
  5839. /**
  5840. * Casts `array` to a slice if it's needed.
  5841. *
  5842. * @private
  5843. * @param {Array} array The array to inspect.
  5844. * @param {number} start The start position.
  5845. * @param {number} [end=array.length] The end position.
  5846. * @returns {Array} Returns the cast slice.
  5847. */
  5848. function castSlice(array, start, end) {
  5849. var length = array.length;
  5850. end = end === undefined ? length : end;
  5851. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5852. }
  5853. /**
  5854. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5855. *
  5856. * @private
  5857. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5858. */
  5859. var clearTimeout = ctxClearTimeout || function(id) {
  5860. return root.clearTimeout(id);
  5861. };
  5862. /**
  5863. * Creates a clone of `buffer`.
  5864. *
  5865. * @private
  5866. * @param {Buffer} buffer The buffer to clone.
  5867. * @param {boolean} [isDeep] Specify a deep clone.
  5868. * @returns {Buffer} Returns the cloned buffer.
  5869. */
  5870. function cloneBuffer(buffer, isDeep) {
  5871. if (isDeep) {
  5872. return buffer.slice();
  5873. }
  5874. var length = buffer.length,
  5875. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5876. buffer.copy(result);
  5877. return result;
  5878. }
  5879. /**
  5880. * Creates a clone of `arrayBuffer`.
  5881. *
  5882. * @private
  5883. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5884. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5885. */
  5886. function cloneArrayBuffer(arrayBuffer) {
  5887. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5888. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5889. return result;
  5890. }
  5891. /**
  5892. * Creates a clone of `dataView`.
  5893. *
  5894. * @private
  5895. * @param {Object} dataView The data view to clone.
  5896. * @param {boolean} [isDeep] Specify a deep clone.
  5897. * @returns {Object} Returns the cloned data view.
  5898. */
  5899. function cloneDataView(dataView, isDeep) {
  5900. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5901. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5902. }
  5903. /**
  5904. * Creates a clone of `regexp`.
  5905. *
  5906. * @private
  5907. * @param {Object} regexp The regexp to clone.
  5908. * @returns {Object} Returns the cloned regexp.
  5909. */
  5910. function cloneRegExp(regexp) {
  5911. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5912. result.lastIndex = regexp.lastIndex;
  5913. return result;
  5914. }
  5915. /**
  5916. * Creates a clone of the `symbol` object.
  5917. *
  5918. * @private
  5919. * @param {Object} symbol The symbol object to clone.
  5920. * @returns {Object} Returns the cloned symbol object.
  5921. */
  5922. function cloneSymbol(symbol) {
  5923. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5924. }
  5925. /**
  5926. * Creates a clone of `typedArray`.
  5927. *
  5928. * @private
  5929. * @param {Object} typedArray The typed array to clone.
  5930. * @param {boolean} [isDeep] Specify a deep clone.
  5931. * @returns {Object} Returns the cloned typed array.
  5932. */
  5933. function cloneTypedArray(typedArray, isDeep) {
  5934. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5935. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5936. }
  5937. /**
  5938. * Compares values to sort them in ascending order.
  5939. *
  5940. * @private
  5941. * @param {*} value The value to compare.
  5942. * @param {*} other The other value to compare.
  5943. * @returns {number} Returns the sort order indicator for `value`.
  5944. */
  5945. function compareAscending(value, other) {
  5946. if (value !== other) {
  5947. var valIsDefined = value !== undefined,
  5948. valIsNull = value === null,
  5949. valIsReflexive = value === value,
  5950. valIsSymbol = isSymbol(value);
  5951. var othIsDefined = other !== undefined,
  5952. othIsNull = other === null,
  5953. othIsReflexive = other === other,
  5954. othIsSymbol = isSymbol(other);
  5955. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5956. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5957. (valIsNull && othIsDefined && othIsReflexive) ||
  5958. (!valIsDefined && othIsReflexive) ||
  5959. !valIsReflexive) {
  5960. return 1;
  5961. }
  5962. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5963. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5964. (othIsNull && valIsDefined && valIsReflexive) ||
  5965. (!othIsDefined && valIsReflexive) ||
  5966. !othIsReflexive) {
  5967. return -1;
  5968. }
  5969. }
  5970. return 0;
  5971. }
  5972. /**
  5973. * Used by `_.orderBy` to compare multiple properties of a value to another
  5974. * and stable sort them.
  5975. *
  5976. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5977. * specify an order of "desc" for descending or "asc" for ascending sort order
  5978. * of corresponding values.
  5979. *
  5980. * @private
  5981. * @param {Object} object The object to compare.
  5982. * @param {Object} other The other object to compare.
  5983. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5984. * @returns {number} Returns the sort order indicator for `object`.
  5985. */
  5986. function compareMultiple(object, other, orders) {
  5987. var index = -1,
  5988. objCriteria = object.criteria,
  5989. othCriteria = other.criteria,
  5990. length = objCriteria.length,
  5991. ordersLength = orders.length;
  5992. while (++index < length) {
  5993. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5994. if (result) {
  5995. if (index >= ordersLength) {
  5996. return result;
  5997. }
  5998. var order = orders[index];
  5999. return result * (order == 'desc' ? -1 : 1);
  6000. }
  6001. }
  6002. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  6003. // that causes it, under certain circumstances, to provide the same value for
  6004. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  6005. // for more details.
  6006. //
  6007. // This also ensures a stable sort in V8 and other engines.
  6008. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  6009. return object.index - other.index;
  6010. }
  6011. /**
  6012. * Creates an array that is the composition of partially applied arguments,
  6013. * placeholders, and provided arguments into a single array of arguments.
  6014. *
  6015. * @private
  6016. * @param {Array} args The provided arguments.
  6017. * @param {Array} partials The arguments to prepend to those provided.
  6018. * @param {Array} holders The `partials` placeholder indexes.
  6019. * @params {boolean} [isCurried] Specify composing for a curried function.
  6020. * @returns {Array} Returns the new array of composed arguments.
  6021. */
  6022. function composeArgs(args, partials, holders, isCurried) {
  6023. var argsIndex = -1,
  6024. argsLength = args.length,
  6025. holdersLength = holders.length,
  6026. leftIndex = -1,
  6027. leftLength = partials.length,
  6028. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6029. result = Array(leftLength + rangeLength),
  6030. isUncurried = !isCurried;
  6031. while (++leftIndex < leftLength) {
  6032. result[leftIndex] = partials[leftIndex];
  6033. }
  6034. while (++argsIndex < holdersLength) {
  6035. if (isUncurried || argsIndex < argsLength) {
  6036. result[holders[argsIndex]] = args[argsIndex];
  6037. }
  6038. }
  6039. while (rangeLength--) {
  6040. result[leftIndex++] = args[argsIndex++];
  6041. }
  6042. return result;
  6043. }
  6044. /**
  6045. * This function is like `composeArgs` except that the arguments composition
  6046. * is tailored for `_.partialRight`.
  6047. *
  6048. * @private
  6049. * @param {Array} args The provided arguments.
  6050. * @param {Array} partials The arguments to append to those provided.
  6051. * @param {Array} holders The `partials` placeholder indexes.
  6052. * @params {boolean} [isCurried] Specify composing for a curried function.
  6053. * @returns {Array} Returns the new array of composed arguments.
  6054. */
  6055. function composeArgsRight(args, partials, holders, isCurried) {
  6056. var argsIndex = -1,
  6057. argsLength = args.length,
  6058. holdersIndex = -1,
  6059. holdersLength = holders.length,
  6060. rightIndex = -1,
  6061. rightLength = partials.length,
  6062. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6063. result = Array(rangeLength + rightLength),
  6064. isUncurried = !isCurried;
  6065. while (++argsIndex < rangeLength) {
  6066. result[argsIndex] = args[argsIndex];
  6067. }
  6068. var offset = argsIndex;
  6069. while (++rightIndex < rightLength) {
  6070. result[offset + rightIndex] = partials[rightIndex];
  6071. }
  6072. while (++holdersIndex < holdersLength) {
  6073. if (isUncurried || argsIndex < argsLength) {
  6074. result[offset + holders[holdersIndex]] = args[argsIndex++];
  6075. }
  6076. }
  6077. return result;
  6078. }
  6079. /**
  6080. * Copies the values of `source` to `array`.
  6081. *
  6082. * @private
  6083. * @param {Array} source The array to copy values from.
  6084. * @param {Array} [array=[]] The array to copy values to.
  6085. * @returns {Array} Returns `array`.
  6086. */
  6087. function copyArray(source, array) {
  6088. var index = -1,
  6089. length = source.length;
  6090. array || (array = Array(length));
  6091. while (++index < length) {
  6092. array[index] = source[index];
  6093. }
  6094. return array;
  6095. }
  6096. /**
  6097. * Copies properties of `source` to `object`.
  6098. *
  6099. * @private
  6100. * @param {Object} source The object to copy properties from.
  6101. * @param {Array} props The property identifiers to copy.
  6102. * @param {Object} [object={}] The object to copy properties to.
  6103. * @param {Function} [customizer] The function to customize copied values.
  6104. * @returns {Object} Returns `object`.
  6105. */
  6106. function copyObject(source, props, object, customizer) {
  6107. var isNew = !object;
  6108. object || (object = {});
  6109. var index = -1,
  6110. length = props.length;
  6111. while (++index < length) {
  6112. var key = props[index];
  6113. var newValue = customizer
  6114. ? customizer(object[key], source[key], key, object, source)
  6115. : undefined;
  6116. if (newValue === undefined) {
  6117. newValue = source[key];
  6118. }
  6119. if (isNew) {
  6120. baseAssignValue(object, key, newValue);
  6121. } else {
  6122. assignValue(object, key, newValue);
  6123. }
  6124. }
  6125. return object;
  6126. }
  6127. /**
  6128. * Copies own symbols of `source` to `object`.
  6129. *
  6130. * @private
  6131. * @param {Object} source The object to copy symbols from.
  6132. * @param {Object} [object={}] The object to copy symbols to.
  6133. * @returns {Object} Returns `object`.
  6134. */
  6135. function copySymbols(source, object) {
  6136. return copyObject(source, getSymbols(source), object);
  6137. }
  6138. /**
  6139. * Copies own and inherited symbols of `source` to `object`.
  6140. *
  6141. * @private
  6142. * @param {Object} source The object to copy symbols from.
  6143. * @param {Object} [object={}] The object to copy symbols to.
  6144. * @returns {Object} Returns `object`.
  6145. */
  6146. function copySymbolsIn(source, object) {
  6147. return copyObject(source, getSymbolsIn(source), object);
  6148. }
  6149. /**
  6150. * Creates a function like `_.groupBy`.
  6151. *
  6152. * @private
  6153. * @param {Function} setter The function to set accumulator values.
  6154. * @param {Function} [initializer] The accumulator object initializer.
  6155. * @returns {Function} Returns the new aggregator function.
  6156. */
  6157. function createAggregator(setter, initializer) {
  6158. return function(collection, iteratee) {
  6159. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  6160. accumulator = initializer ? initializer() : {};
  6161. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  6162. };
  6163. }
  6164. /**
  6165. * Creates a function like `_.assign`.
  6166. *
  6167. * @private
  6168. * @param {Function} assigner The function to assign values.
  6169. * @returns {Function} Returns the new assigner function.
  6170. */
  6171. function createAssigner(assigner) {
  6172. return baseRest(function(object, sources) {
  6173. var index = -1,
  6174. length = sources.length,
  6175. customizer = length > 1 ? sources[length - 1] : undefined,
  6176. guard = length > 2 ? sources[2] : undefined;
  6177. customizer = (assigner.length > 3 && typeof customizer == 'function')
  6178. ? (length--, customizer)
  6179. : undefined;
  6180. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  6181. customizer = length < 3 ? undefined : customizer;
  6182. length = 1;
  6183. }
  6184. object = Object(object);
  6185. while (++index < length) {
  6186. var source = sources[index];
  6187. if (source) {
  6188. assigner(object, source, index, customizer);
  6189. }
  6190. }
  6191. return object;
  6192. });
  6193. }
  6194. /**
  6195. * Creates a `baseEach` or `baseEachRight` function.
  6196. *
  6197. * @private
  6198. * @param {Function} eachFunc The function to iterate over a collection.
  6199. * @param {boolean} [fromRight] Specify iterating from right to left.
  6200. * @returns {Function} Returns the new base function.
  6201. */
  6202. function createBaseEach(eachFunc, fromRight) {
  6203. return function(collection, iteratee) {
  6204. if (collection == null) {
  6205. return collection;
  6206. }
  6207. if (!isArrayLike(collection)) {
  6208. return eachFunc(collection, iteratee);
  6209. }
  6210. var length = collection.length,
  6211. index = fromRight ? length : -1,
  6212. iterable = Object(collection);
  6213. while ((fromRight ? index-- : ++index < length)) {
  6214. if (iteratee(iterable[index], index, iterable) === false) {
  6215. break;
  6216. }
  6217. }
  6218. return collection;
  6219. };
  6220. }
  6221. /**
  6222. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  6223. *
  6224. * @private
  6225. * @param {boolean} [fromRight] Specify iterating from right to left.
  6226. * @returns {Function} Returns the new base function.
  6227. */
  6228. function createBaseFor(fromRight) {
  6229. return function(object, iteratee, keysFunc) {
  6230. var index = -1,
  6231. iterable = Object(object),
  6232. props = keysFunc(object),
  6233. length = props.length;
  6234. while (length--) {
  6235. var key = props[fromRight ? length : ++index];
  6236. if (iteratee(iterable[key], key, iterable) === false) {
  6237. break;
  6238. }
  6239. }
  6240. return object;
  6241. };
  6242. }
  6243. /**
  6244. * Creates a function that wraps `func` to invoke it with the optional `this`
  6245. * binding of `thisArg`.
  6246. *
  6247. * @private
  6248. * @param {Function} func The function to wrap.
  6249. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6250. * @param {*} [thisArg] The `this` binding of `func`.
  6251. * @returns {Function} Returns the new wrapped function.
  6252. */
  6253. function createBind(func, bitmask, thisArg) {
  6254. var isBind = bitmask & WRAP_BIND_FLAG,
  6255. Ctor = createCtor(func);
  6256. function wrapper() {
  6257. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6258. return fn.apply(isBind ? thisArg : this, arguments);
  6259. }
  6260. return wrapper;
  6261. }
  6262. /**
  6263. * Creates a function like `_.lowerFirst`.
  6264. *
  6265. * @private
  6266. * @param {string} methodName The name of the `String` case method to use.
  6267. * @returns {Function} Returns the new case function.
  6268. */
  6269. function createCaseFirst(methodName) {
  6270. return function(string) {
  6271. string = toString(string);
  6272. var strSymbols = hasUnicode(string)
  6273. ? stringToArray(string)
  6274. : undefined;
  6275. var chr = strSymbols
  6276. ? strSymbols[0]
  6277. : string.charAt(0);
  6278. var trailing = strSymbols
  6279. ? castSlice(strSymbols, 1).join('')
  6280. : string.slice(1);
  6281. return chr[methodName]() + trailing;
  6282. };
  6283. }
  6284. /**
  6285. * Creates a function like `_.camelCase`.
  6286. *
  6287. * @private
  6288. * @param {Function} callback The function to combine each word.
  6289. * @returns {Function} Returns the new compounder function.
  6290. */
  6291. function createCompounder(callback) {
  6292. return function(string) {
  6293. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  6294. };
  6295. }
  6296. /**
  6297. * Creates a function that produces an instance of `Ctor` regardless of
  6298. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  6299. *
  6300. * @private
  6301. * @param {Function} Ctor The constructor to wrap.
  6302. * @returns {Function} Returns the new wrapped function.
  6303. */
  6304. function createCtor(Ctor) {
  6305. return function() {
  6306. // Use a `switch` statement to work with class constructors. See
  6307. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  6308. // for more details.
  6309. var args = arguments;
  6310. switch (args.length) {
  6311. case 0: return new Ctor;
  6312. case 1: return new Ctor(args[0]);
  6313. case 2: return new Ctor(args[0], args[1]);
  6314. case 3: return new Ctor(args[0], args[1], args[2]);
  6315. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  6316. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  6317. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  6318. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  6319. }
  6320. var thisBinding = baseCreate(Ctor.prototype),
  6321. result = Ctor.apply(thisBinding, args);
  6322. // Mimic the constructor's `return` behavior.
  6323. // See https://es5.github.io/#x13.2.2 for more details.
  6324. return isObject(result) ? result : thisBinding;
  6325. };
  6326. }
  6327. /**
  6328. * Creates a function that wraps `func` to enable currying.
  6329. *
  6330. * @private
  6331. * @param {Function} func The function to wrap.
  6332. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6333. * @param {number} arity The arity of `func`.
  6334. * @returns {Function} Returns the new wrapped function.
  6335. */
  6336. function createCurry(func, bitmask, arity) {
  6337. var Ctor = createCtor(func);
  6338. function wrapper() {
  6339. var length = arguments.length,
  6340. args = Array(length),
  6341. index = length,
  6342. placeholder = getHolder(wrapper);
  6343. while (index--) {
  6344. args[index] = arguments[index];
  6345. }
  6346. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  6347. ? []
  6348. : replaceHolders(args, placeholder);
  6349. length -= holders.length;
  6350. if (length < arity) {
  6351. return createRecurry(
  6352. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  6353. args, holders, undefined, undefined, arity - length);
  6354. }
  6355. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6356. return apply(fn, this, args);
  6357. }
  6358. return wrapper;
  6359. }
  6360. /**
  6361. * Creates a `_.find` or `_.findLast` function.
  6362. *
  6363. * @private
  6364. * @param {Function} findIndexFunc The function to find the collection index.
  6365. * @returns {Function} Returns the new find function.
  6366. */
  6367. function createFind(findIndexFunc) {
  6368. return function(collection, predicate, fromIndex) {
  6369. var iterable = Object(collection);
  6370. if (!isArrayLike(collection)) {
  6371. var iteratee = getIteratee(predicate, 3);
  6372. collection = keys(collection);
  6373. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  6374. }
  6375. var index = findIndexFunc(collection, predicate, fromIndex);
  6376. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  6377. };
  6378. }
  6379. /**
  6380. * Creates a `_.flow` or `_.flowRight` function.
  6381. *
  6382. * @private
  6383. * @param {boolean} [fromRight] Specify iterating from right to left.
  6384. * @returns {Function} Returns the new flow function.
  6385. */
  6386. function createFlow(fromRight) {
  6387. return flatRest(function(funcs) {
  6388. var length = funcs.length,
  6389. index = length,
  6390. prereq = LodashWrapper.prototype.thru;
  6391. if (fromRight) {
  6392. funcs.reverse();
  6393. }
  6394. while (index--) {
  6395. var func = funcs[index];
  6396. if (typeof func != 'function') {
  6397. throw new TypeError(FUNC_ERROR_TEXT);
  6398. }
  6399. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6400. var wrapper = new LodashWrapper([], true);
  6401. }
  6402. }
  6403. index = wrapper ? index : length;
  6404. while (++index < length) {
  6405. func = funcs[index];
  6406. var funcName = getFuncName(func),
  6407. data = funcName == 'wrapper' ? getData(func) : undefined;
  6408. if (data && isLaziable(data[0]) &&
  6409. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6410. !data[4].length && data[9] == 1
  6411. ) {
  6412. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6413. } else {
  6414. wrapper = (func.length == 1 && isLaziable(func))
  6415. ? wrapper[funcName]()
  6416. : wrapper.thru(func);
  6417. }
  6418. }
  6419. return function() {
  6420. var args = arguments,
  6421. value = args[0];
  6422. if (wrapper && args.length == 1 && isArray(value)) {
  6423. return wrapper.plant(value).value();
  6424. }
  6425. var index = 0,
  6426. result = length ? funcs[index].apply(this, args) : value;
  6427. while (++index < length) {
  6428. result = funcs[index].call(this, result);
  6429. }
  6430. return result;
  6431. };
  6432. });
  6433. }
  6434. /**
  6435. * Creates a function that wraps `func` to invoke it with optional `this`
  6436. * binding of `thisArg`, partial application, and currying.
  6437. *
  6438. * @private
  6439. * @param {Function|string} func The function or method name to wrap.
  6440. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6441. * @param {*} [thisArg] The `this` binding of `func`.
  6442. * @param {Array} [partials] The arguments to prepend to those provided to
  6443. * the new function.
  6444. * @param {Array} [holders] The `partials` placeholder indexes.
  6445. * @param {Array} [partialsRight] The arguments to append to those provided
  6446. * to the new function.
  6447. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6448. * @param {Array} [argPos] The argument positions of the new function.
  6449. * @param {number} [ary] The arity cap of `func`.
  6450. * @param {number} [arity] The arity of `func`.
  6451. * @returns {Function} Returns the new wrapped function.
  6452. */
  6453. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6454. var isAry = bitmask & WRAP_ARY_FLAG,
  6455. isBind = bitmask & WRAP_BIND_FLAG,
  6456. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6457. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6458. isFlip = bitmask & WRAP_FLIP_FLAG,
  6459. Ctor = isBindKey ? undefined : createCtor(func);
  6460. function wrapper() {
  6461. var length = arguments.length,
  6462. args = Array(length),
  6463. index = length;
  6464. while (index--) {
  6465. args[index] = arguments[index];
  6466. }
  6467. if (isCurried) {
  6468. var placeholder = getHolder(wrapper),
  6469. holdersCount = countHolders(args, placeholder);
  6470. }
  6471. if (partials) {
  6472. args = composeArgs(args, partials, holders, isCurried);
  6473. }
  6474. if (partialsRight) {
  6475. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6476. }
  6477. length -= holdersCount;
  6478. if (isCurried && length < arity) {
  6479. var newHolders = replaceHolders(args, placeholder);
  6480. return createRecurry(
  6481. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6482. args, newHolders, argPos, ary, arity - length
  6483. );
  6484. }
  6485. var thisBinding = isBind ? thisArg : this,
  6486. fn = isBindKey ? thisBinding[func] : func;
  6487. length = args.length;
  6488. if (argPos) {
  6489. args = reorder(args, argPos);
  6490. } else if (isFlip && length > 1) {
  6491. args.reverse();
  6492. }
  6493. if (isAry && ary < length) {
  6494. args.length = ary;
  6495. }
  6496. if (this && this !== root && this instanceof wrapper) {
  6497. fn = Ctor || createCtor(fn);
  6498. }
  6499. return fn.apply(thisBinding, args);
  6500. }
  6501. return wrapper;
  6502. }
  6503. /**
  6504. * Creates a function like `_.invertBy`.
  6505. *
  6506. * @private
  6507. * @param {Function} setter The function to set accumulator values.
  6508. * @param {Function} toIteratee The function to resolve iteratees.
  6509. * @returns {Function} Returns the new inverter function.
  6510. */
  6511. function createInverter(setter, toIteratee) {
  6512. return function(object, iteratee) {
  6513. return baseInverter(object, setter, toIteratee(iteratee), {});
  6514. };
  6515. }
  6516. /**
  6517. * Creates a function that performs a mathematical operation on two values.
  6518. *
  6519. * @private
  6520. * @param {Function} operator The function to perform the operation.
  6521. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6522. * @returns {Function} Returns the new mathematical operation function.
  6523. */
  6524. function createMathOperation(operator, defaultValue) {
  6525. return function(value, other) {
  6526. var result;
  6527. if (value === undefined && other === undefined) {
  6528. return defaultValue;
  6529. }
  6530. if (value !== undefined) {
  6531. result = value;
  6532. }
  6533. if (other !== undefined) {
  6534. if (result === undefined) {
  6535. return other;
  6536. }
  6537. if (typeof value == 'string' || typeof other == 'string') {
  6538. value = baseToString(value);
  6539. other = baseToString(other);
  6540. } else {
  6541. value = baseToNumber(value);
  6542. other = baseToNumber(other);
  6543. }
  6544. result = operator(value, other);
  6545. }
  6546. return result;
  6547. };
  6548. }
  6549. /**
  6550. * Creates a function like `_.over`.
  6551. *
  6552. * @private
  6553. * @param {Function} arrayFunc The function to iterate over iteratees.
  6554. * @returns {Function} Returns the new over function.
  6555. */
  6556. function createOver(arrayFunc) {
  6557. return flatRest(function(iteratees) {
  6558. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6559. return baseRest(function(args) {
  6560. var thisArg = this;
  6561. return arrayFunc(iteratees, function(iteratee) {
  6562. return apply(iteratee, thisArg, args);
  6563. });
  6564. });
  6565. });
  6566. }
  6567. /**
  6568. * Creates the padding for `string` based on `length`. The `chars` string
  6569. * is truncated if the number of characters exceeds `length`.
  6570. *
  6571. * @private
  6572. * @param {number} length The padding length.
  6573. * @param {string} [chars=' '] The string used as padding.
  6574. * @returns {string} Returns the padding for `string`.
  6575. */
  6576. function createPadding(length, chars) {
  6577. chars = chars === undefined ? ' ' : baseToString(chars);
  6578. var charsLength = chars.length;
  6579. if (charsLength < 2) {
  6580. return charsLength ? baseRepeat(chars, length) : chars;
  6581. }
  6582. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6583. return hasUnicode(chars)
  6584. ? castSlice(stringToArray(result), 0, length).join('')
  6585. : result.slice(0, length);
  6586. }
  6587. /**
  6588. * Creates a function that wraps `func` to invoke it with the `this` binding
  6589. * of `thisArg` and `partials` prepended to the arguments it receives.
  6590. *
  6591. * @private
  6592. * @param {Function} func The function to wrap.
  6593. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6594. * @param {*} thisArg The `this` binding of `func`.
  6595. * @param {Array} partials The arguments to prepend to those provided to
  6596. * the new function.
  6597. * @returns {Function} Returns the new wrapped function.
  6598. */
  6599. function createPartial(func, bitmask, thisArg, partials) {
  6600. var isBind = bitmask & WRAP_BIND_FLAG,
  6601. Ctor = createCtor(func);
  6602. function wrapper() {
  6603. var argsIndex = -1,
  6604. argsLength = arguments.length,
  6605. leftIndex = -1,
  6606. leftLength = partials.length,
  6607. args = Array(leftLength + argsLength),
  6608. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6609. while (++leftIndex < leftLength) {
  6610. args[leftIndex] = partials[leftIndex];
  6611. }
  6612. while (argsLength--) {
  6613. args[leftIndex++] = arguments[++argsIndex];
  6614. }
  6615. return apply(fn, isBind ? thisArg : this, args);
  6616. }
  6617. return wrapper;
  6618. }
  6619. /**
  6620. * Creates a `_.range` or `_.rangeRight` function.
  6621. *
  6622. * @private
  6623. * @param {boolean} [fromRight] Specify iterating from right to left.
  6624. * @returns {Function} Returns the new range function.
  6625. */
  6626. function createRange(fromRight) {
  6627. return function(start, end, step) {
  6628. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6629. end = step = undefined;
  6630. }
  6631. // Ensure the sign of `-0` is preserved.
  6632. start = toFinite(start);
  6633. if (end === undefined) {
  6634. end = start;
  6635. start = 0;
  6636. } else {
  6637. end = toFinite(end);
  6638. }
  6639. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6640. return baseRange(start, end, step, fromRight);
  6641. };
  6642. }
  6643. /**
  6644. * Creates a function that performs a relational operation on two values.
  6645. *
  6646. * @private
  6647. * @param {Function} operator The function to perform the operation.
  6648. * @returns {Function} Returns the new relational operation function.
  6649. */
  6650. function createRelationalOperation(operator) {
  6651. return function(value, other) {
  6652. if (!(typeof value == 'string' && typeof other == 'string')) {
  6653. value = toNumber(value);
  6654. other = toNumber(other);
  6655. }
  6656. return operator(value, other);
  6657. };
  6658. }
  6659. /**
  6660. * Creates a function that wraps `func` to continue currying.
  6661. *
  6662. * @private
  6663. * @param {Function} func The function to wrap.
  6664. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6665. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6666. * @param {*} placeholder The placeholder value.
  6667. * @param {*} [thisArg] The `this` binding of `func`.
  6668. * @param {Array} [partials] The arguments to prepend to those provided to
  6669. * the new function.
  6670. * @param {Array} [holders] The `partials` placeholder indexes.
  6671. * @param {Array} [argPos] The argument positions of the new function.
  6672. * @param {number} [ary] The arity cap of `func`.
  6673. * @param {number} [arity] The arity of `func`.
  6674. * @returns {Function} Returns the new wrapped function.
  6675. */
  6676. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6677. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6678. newHolders = isCurry ? holders : undefined,
  6679. newHoldersRight = isCurry ? undefined : holders,
  6680. newPartials = isCurry ? partials : undefined,
  6681. newPartialsRight = isCurry ? undefined : partials;
  6682. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6683. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6684. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6685. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6686. }
  6687. var newData = [
  6688. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6689. newHoldersRight, argPos, ary, arity
  6690. ];
  6691. var result = wrapFunc.apply(undefined, newData);
  6692. if (isLaziable(func)) {
  6693. setData(result, newData);
  6694. }
  6695. result.placeholder = placeholder;
  6696. return setWrapToString(result, func, bitmask);
  6697. }
  6698. /**
  6699. * Creates a function like `_.round`.
  6700. *
  6701. * @private
  6702. * @param {string} methodName The name of the `Math` method to use when rounding.
  6703. * @returns {Function} Returns the new round function.
  6704. */
  6705. function createRound(methodName) {
  6706. var func = Math[methodName];
  6707. return function(number, precision) {
  6708. number = toNumber(number);
  6709. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6710. if (precision && nativeIsFinite(number)) {
  6711. // Shift with exponential notation to avoid floating-point issues.
  6712. // See [MDN](https://mdn.io/round#Examples) for more details.
  6713. var pair = (toString(number) + 'e').split('e'),
  6714. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6715. pair = (toString(value) + 'e').split('e');
  6716. return +(pair[0] + 'e' + (+pair[1] - precision));
  6717. }
  6718. return func(number);
  6719. };
  6720. }
  6721. /**
  6722. * Creates a set object of `values`.
  6723. *
  6724. * @private
  6725. * @param {Array} values The values to add to the set.
  6726. * @returns {Object} Returns the new set.
  6727. */
  6728. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6729. return new Set(values);
  6730. };
  6731. /**
  6732. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6733. *
  6734. * @private
  6735. * @param {Function} keysFunc The function to get the keys of a given object.
  6736. * @returns {Function} Returns the new pairs function.
  6737. */
  6738. function createToPairs(keysFunc) {
  6739. return function(object) {
  6740. var tag = getTag(object);
  6741. if (tag == mapTag) {
  6742. return mapToArray(object);
  6743. }
  6744. if (tag == setTag) {
  6745. return setToPairs(object);
  6746. }
  6747. return baseToPairs(object, keysFunc(object));
  6748. };
  6749. }
  6750. /**
  6751. * Creates a function that either curries or invokes `func` with optional
  6752. * `this` binding and partially applied arguments.
  6753. *
  6754. * @private
  6755. * @param {Function|string} func The function or method name to wrap.
  6756. * @param {number} bitmask The bitmask flags.
  6757. * 1 - `_.bind`
  6758. * 2 - `_.bindKey`
  6759. * 4 - `_.curry` or `_.curryRight` of a bound function
  6760. * 8 - `_.curry`
  6761. * 16 - `_.curryRight`
  6762. * 32 - `_.partial`
  6763. * 64 - `_.partialRight`
  6764. * 128 - `_.rearg`
  6765. * 256 - `_.ary`
  6766. * 512 - `_.flip`
  6767. * @param {*} [thisArg] The `this` binding of `func`.
  6768. * @param {Array} [partials] The arguments to be partially applied.
  6769. * @param {Array} [holders] The `partials` placeholder indexes.
  6770. * @param {Array} [argPos] The argument positions of the new function.
  6771. * @param {number} [ary] The arity cap of `func`.
  6772. * @param {number} [arity] The arity of `func`.
  6773. * @returns {Function} Returns the new wrapped function.
  6774. */
  6775. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6776. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6777. if (!isBindKey && typeof func != 'function') {
  6778. throw new TypeError(FUNC_ERROR_TEXT);
  6779. }
  6780. var length = partials ? partials.length : 0;
  6781. if (!length) {
  6782. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6783. partials = holders = undefined;
  6784. }
  6785. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6786. arity = arity === undefined ? arity : toInteger(arity);
  6787. length -= holders ? holders.length : 0;
  6788. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6789. var partialsRight = partials,
  6790. holdersRight = holders;
  6791. partials = holders = undefined;
  6792. }
  6793. var data = isBindKey ? undefined : getData(func);
  6794. var newData = [
  6795. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6796. argPos, ary, arity
  6797. ];
  6798. if (data) {
  6799. mergeData(newData, data);
  6800. }
  6801. func = newData[0];
  6802. bitmask = newData[1];
  6803. thisArg = newData[2];
  6804. partials = newData[3];
  6805. holders = newData[4];
  6806. arity = newData[9] = newData[9] === undefined
  6807. ? (isBindKey ? 0 : func.length)
  6808. : nativeMax(newData[9] - length, 0);
  6809. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6810. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6811. }
  6812. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6813. var result = createBind(func, bitmask, thisArg);
  6814. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6815. result = createCurry(func, bitmask, arity);
  6816. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6817. result = createPartial(func, bitmask, thisArg, partials);
  6818. } else {
  6819. result = createHybrid.apply(undefined, newData);
  6820. }
  6821. var setter = data ? baseSetData : setData;
  6822. return setWrapToString(setter(result, newData), func, bitmask);
  6823. }
  6824. /**
  6825. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6826. * of source objects to the destination object for all destination properties
  6827. * that resolve to `undefined`.
  6828. *
  6829. * @private
  6830. * @param {*} objValue The destination value.
  6831. * @param {*} srcValue The source value.
  6832. * @param {string} key The key of the property to assign.
  6833. * @param {Object} object The parent object of `objValue`.
  6834. * @returns {*} Returns the value to assign.
  6835. */
  6836. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6837. if (objValue === undefined ||
  6838. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6839. return srcValue;
  6840. }
  6841. return objValue;
  6842. }
  6843. /**
  6844. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6845. * objects into destination objects that are passed thru.
  6846. *
  6847. * @private
  6848. * @param {*} objValue The destination value.
  6849. * @param {*} srcValue The source value.
  6850. * @param {string} key The key of the property to merge.
  6851. * @param {Object} object The parent object of `objValue`.
  6852. * @param {Object} source The parent object of `srcValue`.
  6853. * @param {Object} [stack] Tracks traversed source values and their merged
  6854. * counterparts.
  6855. * @returns {*} Returns the value to assign.
  6856. */
  6857. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6858. if (isObject(objValue) && isObject(srcValue)) {
  6859. // Recursively merge objects and arrays (susceptible to call stack limits).
  6860. stack.set(srcValue, objValue);
  6861. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6862. stack['delete'](srcValue);
  6863. }
  6864. return objValue;
  6865. }
  6866. /**
  6867. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6868. * objects.
  6869. *
  6870. * @private
  6871. * @param {*} value The value to inspect.
  6872. * @param {string} key The key of the property to inspect.
  6873. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6874. */
  6875. function customOmitClone(value) {
  6876. return isPlainObject(value) ? undefined : value;
  6877. }
  6878. /**
  6879. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6880. * partial deep comparisons.
  6881. *
  6882. * @private
  6883. * @param {Array} array The array to compare.
  6884. * @param {Array} other The other array to compare.
  6885. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6886. * @param {Function} customizer The function to customize comparisons.
  6887. * @param {Function} equalFunc The function to determine equivalents of values.
  6888. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6889. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6890. */
  6891. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6892. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6893. arrLength = array.length,
  6894. othLength = other.length;
  6895. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6896. return false;
  6897. }
  6898. // Check that cyclic values are equal.
  6899. var arrStacked = stack.get(array);
  6900. var othStacked = stack.get(other);
  6901. if (arrStacked && othStacked) {
  6902. return arrStacked == other && othStacked == array;
  6903. }
  6904. var index = -1,
  6905. result = true,
  6906. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6907. stack.set(array, other);
  6908. stack.set(other, array);
  6909. // Ignore non-index properties.
  6910. while (++index < arrLength) {
  6911. var arrValue = array[index],
  6912. othValue = other[index];
  6913. if (customizer) {
  6914. var compared = isPartial
  6915. ? customizer(othValue, arrValue, index, other, array, stack)
  6916. : customizer(arrValue, othValue, index, array, other, stack);
  6917. }
  6918. if (compared !== undefined) {
  6919. if (compared) {
  6920. continue;
  6921. }
  6922. result = false;
  6923. break;
  6924. }
  6925. // Recursively compare arrays (susceptible to call stack limits).
  6926. if (seen) {
  6927. if (!arraySome(other, function(othValue, othIndex) {
  6928. if (!cacheHas(seen, othIndex) &&
  6929. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6930. return seen.push(othIndex);
  6931. }
  6932. })) {
  6933. result = false;
  6934. break;
  6935. }
  6936. } else if (!(
  6937. arrValue === othValue ||
  6938. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6939. )) {
  6940. result = false;
  6941. break;
  6942. }
  6943. }
  6944. stack['delete'](array);
  6945. stack['delete'](other);
  6946. return result;
  6947. }
  6948. /**
  6949. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6950. * the same `toStringTag`.
  6951. *
  6952. * **Note:** This function only supports comparing values with tags of
  6953. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6954. *
  6955. * @private
  6956. * @param {Object} object The object to compare.
  6957. * @param {Object} other The other object to compare.
  6958. * @param {string} tag The `toStringTag` of the objects to compare.
  6959. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6960. * @param {Function} customizer The function to customize comparisons.
  6961. * @param {Function} equalFunc The function to determine equivalents of values.
  6962. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6963. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6964. */
  6965. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6966. switch (tag) {
  6967. case dataViewTag:
  6968. if ((object.byteLength != other.byteLength) ||
  6969. (object.byteOffset != other.byteOffset)) {
  6970. return false;
  6971. }
  6972. object = object.buffer;
  6973. other = other.buffer;
  6974. case arrayBufferTag:
  6975. if ((object.byteLength != other.byteLength) ||
  6976. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6977. return false;
  6978. }
  6979. return true;
  6980. case boolTag:
  6981. case dateTag:
  6982. case numberTag:
  6983. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6984. // Invalid dates are coerced to `NaN`.
  6985. return eq(+object, +other);
  6986. case errorTag:
  6987. return object.name == other.name && object.message == other.message;
  6988. case regexpTag:
  6989. case stringTag:
  6990. // Coerce regexes to strings and treat strings, primitives and objects,
  6991. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6992. // for more details.
  6993. return object == (other + '');
  6994. case mapTag:
  6995. var convert = mapToArray;
  6996. case setTag:
  6997. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6998. convert || (convert = setToArray);
  6999. if (object.size != other.size && !isPartial) {
  7000. return false;
  7001. }
  7002. // Assume cyclic values are equal.
  7003. var stacked = stack.get(object);
  7004. if (stacked) {
  7005. return stacked == other;
  7006. }
  7007. bitmask |= COMPARE_UNORDERED_FLAG;
  7008. // Recursively compare objects (susceptible to call stack limits).
  7009. stack.set(object, other);
  7010. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  7011. stack['delete'](object);
  7012. return result;
  7013. case symbolTag:
  7014. if (symbolValueOf) {
  7015. return symbolValueOf.call(object) == symbolValueOf.call(other);
  7016. }
  7017. }
  7018. return false;
  7019. }
  7020. /**
  7021. * A specialized version of `baseIsEqualDeep` for objects with support for
  7022. * partial deep comparisons.
  7023. *
  7024. * @private
  7025. * @param {Object} object The object to compare.
  7026. * @param {Object} other The other object to compare.
  7027. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7028. * @param {Function} customizer The function to customize comparisons.
  7029. * @param {Function} equalFunc The function to determine equivalents of values.
  7030. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7031. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7032. */
  7033. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  7034. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7035. objProps = getAllKeys(object),
  7036. objLength = objProps.length,
  7037. othProps = getAllKeys(other),
  7038. othLength = othProps.length;
  7039. if (objLength != othLength && !isPartial) {
  7040. return false;
  7041. }
  7042. var index = objLength;
  7043. while (index--) {
  7044. var key = objProps[index];
  7045. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7046. return false;
  7047. }
  7048. }
  7049. // Check that cyclic values are equal.
  7050. var objStacked = stack.get(object);
  7051. var othStacked = stack.get(other);
  7052. if (objStacked && othStacked) {
  7053. return objStacked == other && othStacked == object;
  7054. }
  7055. var result = true;
  7056. stack.set(object, other);
  7057. stack.set(other, object);
  7058. var skipCtor = isPartial;
  7059. while (++index < objLength) {
  7060. key = objProps[index];
  7061. var objValue = object[key],
  7062. othValue = other[key];
  7063. if (customizer) {
  7064. var compared = isPartial
  7065. ? customizer(othValue, objValue, key, other, object, stack)
  7066. : customizer(objValue, othValue, key, object, other, stack);
  7067. }
  7068. // Recursively compare objects (susceptible to call stack limits).
  7069. if (!(compared === undefined
  7070. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  7071. : compared
  7072. )) {
  7073. result = false;
  7074. break;
  7075. }
  7076. skipCtor || (skipCtor = key == 'constructor');
  7077. }
  7078. if (result && !skipCtor) {
  7079. var objCtor = object.constructor,
  7080. othCtor = other.constructor;
  7081. // Non `Object` object instances with different constructors are not equal.
  7082. if (objCtor != othCtor &&
  7083. ('constructor' in object && 'constructor' in other) &&
  7084. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  7085. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7086. result = false;
  7087. }
  7088. }
  7089. stack['delete'](object);
  7090. stack['delete'](other);
  7091. return result;
  7092. }
  7093. /**
  7094. * A specialized version of `baseRest` which flattens the rest array.
  7095. *
  7096. * @private
  7097. * @param {Function} func The function to apply a rest parameter to.
  7098. * @returns {Function} Returns the new function.
  7099. */
  7100. function flatRest(func) {
  7101. return setToString(overRest(func, undefined, flatten), func + '');
  7102. }
  7103. /**
  7104. * Creates an array of own enumerable property names and symbols of `object`.
  7105. *
  7106. * @private
  7107. * @param {Object} object The object to query.
  7108. * @returns {Array} Returns the array of property names and symbols.
  7109. */
  7110. function getAllKeys(object) {
  7111. return baseGetAllKeys(object, keys, getSymbols);
  7112. }
  7113. /**
  7114. * Creates an array of own and inherited enumerable property names and
  7115. * symbols of `object`.
  7116. *
  7117. * @private
  7118. * @param {Object} object The object to query.
  7119. * @returns {Array} Returns the array of property names and symbols.
  7120. */
  7121. function getAllKeysIn(object) {
  7122. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  7123. }
  7124. /**
  7125. * Gets metadata for `func`.
  7126. *
  7127. * @private
  7128. * @param {Function} func The function to query.
  7129. * @returns {*} Returns the metadata for `func`.
  7130. */
  7131. var getData = !metaMap ? noop : function(func) {
  7132. return metaMap.get(func);
  7133. };
  7134. /**
  7135. * Gets the name of `func`.
  7136. *
  7137. * @private
  7138. * @param {Function} func The function to query.
  7139. * @returns {string} Returns the function name.
  7140. */
  7141. function getFuncName(func) {
  7142. var result = (func.name + ''),
  7143. array = realNames[result],
  7144. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  7145. while (length--) {
  7146. var data = array[length],
  7147. otherFunc = data.func;
  7148. if (otherFunc == null || otherFunc == func) {
  7149. return data.name;
  7150. }
  7151. }
  7152. return result;
  7153. }
  7154. /**
  7155. * Gets the argument placeholder value for `func`.
  7156. *
  7157. * @private
  7158. * @param {Function} func The function to inspect.
  7159. * @returns {*} Returns the placeholder value.
  7160. */
  7161. function getHolder(func) {
  7162. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  7163. return object.placeholder;
  7164. }
  7165. /**
  7166. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  7167. * this function returns the custom method, otherwise it returns `baseIteratee`.
  7168. * If arguments are provided, the chosen function is invoked with them and
  7169. * its result is returned.
  7170. *
  7171. * @private
  7172. * @param {*} [value] The value to convert to an iteratee.
  7173. * @param {number} [arity] The arity of the created iteratee.
  7174. * @returns {Function} Returns the chosen function or its result.
  7175. */
  7176. function getIteratee() {
  7177. var result = lodash.iteratee || iteratee;
  7178. result = result === iteratee ? baseIteratee : result;
  7179. return arguments.length ? result(arguments[0], arguments[1]) : result;
  7180. }
  7181. /**
  7182. * Gets the data for `map`.
  7183. *
  7184. * @private
  7185. * @param {Object} map The map to query.
  7186. * @param {string} key The reference key.
  7187. * @returns {*} Returns the map data.
  7188. */
  7189. function getMapData(map, key) {
  7190. var data = map.__data__;
  7191. return isKeyable(key)
  7192. ? data[typeof key == 'string' ? 'string' : 'hash']
  7193. : data.map;
  7194. }
  7195. /**
  7196. * Gets the property names, values, and compare flags of `object`.
  7197. *
  7198. * @private
  7199. * @param {Object} object The object to query.
  7200. * @returns {Array} Returns the match data of `object`.
  7201. */
  7202. function getMatchData(object) {
  7203. var result = keys(object),
  7204. length = result.length;
  7205. while (length--) {
  7206. var key = result[length],
  7207. value = object[key];
  7208. result[length] = [key, value, isStrictComparable(value)];
  7209. }
  7210. return result;
  7211. }
  7212. /**
  7213. * Gets the native function at `key` of `object`.
  7214. *
  7215. * @private
  7216. * @param {Object} object The object to query.
  7217. * @param {string} key The key of the method to get.
  7218. * @returns {*} Returns the function if it's native, else `undefined`.
  7219. */
  7220. function getNative(object, key) {
  7221. var value = getValue(object, key);
  7222. return baseIsNative(value) ? value : undefined;
  7223. }
  7224. /**
  7225. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7226. *
  7227. * @private
  7228. * @param {*} value The value to query.
  7229. * @returns {string} Returns the raw `toStringTag`.
  7230. */
  7231. function getRawTag(value) {
  7232. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7233. tag = value[symToStringTag];
  7234. try {
  7235. value[symToStringTag] = undefined;
  7236. var unmasked = true;
  7237. } catch (e) {}
  7238. var result = nativeObjectToString.call(value);
  7239. if (unmasked) {
  7240. if (isOwn) {
  7241. value[symToStringTag] = tag;
  7242. } else {
  7243. delete value[symToStringTag];
  7244. }
  7245. }
  7246. return result;
  7247. }
  7248. /**
  7249. * Creates an array of the own enumerable symbols of `object`.
  7250. *
  7251. * @private
  7252. * @param {Object} object The object to query.
  7253. * @returns {Array} Returns the array of symbols.
  7254. */
  7255. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  7256. if (object == null) {
  7257. return [];
  7258. }
  7259. object = Object(object);
  7260. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  7261. return propertyIsEnumerable.call(object, symbol);
  7262. });
  7263. };
  7264. /**
  7265. * Creates an array of the own and inherited enumerable symbols of `object`.
  7266. *
  7267. * @private
  7268. * @param {Object} object The object to query.
  7269. * @returns {Array} Returns the array of symbols.
  7270. */
  7271. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  7272. var result = [];
  7273. while (object) {
  7274. arrayPush(result, getSymbols(object));
  7275. object = getPrototype(object);
  7276. }
  7277. return result;
  7278. };
  7279. /**
  7280. * Gets the `toStringTag` of `value`.
  7281. *
  7282. * @private
  7283. * @param {*} value The value to query.
  7284. * @returns {string} Returns the `toStringTag`.
  7285. */
  7286. var getTag = baseGetTag;
  7287. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  7288. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  7289. (Map && getTag(new Map) != mapTag) ||
  7290. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  7291. (Set && getTag(new Set) != setTag) ||
  7292. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  7293. getTag = function(value) {
  7294. var result = baseGetTag(value),
  7295. Ctor = result == objectTag ? value.constructor : undefined,
  7296. ctorString = Ctor ? toSource(Ctor) : '';
  7297. if (ctorString) {
  7298. switch (ctorString) {
  7299. case dataViewCtorString: return dataViewTag;
  7300. case mapCtorString: return mapTag;
  7301. case promiseCtorString: return promiseTag;
  7302. case setCtorString: return setTag;
  7303. case weakMapCtorString: return weakMapTag;
  7304. }
  7305. }
  7306. return result;
  7307. };
  7308. }
  7309. /**
  7310. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  7311. *
  7312. * @private
  7313. * @param {number} start The start of the view.
  7314. * @param {number} end The end of the view.
  7315. * @param {Array} transforms The transformations to apply to the view.
  7316. * @returns {Object} Returns an object containing the `start` and `end`
  7317. * positions of the view.
  7318. */
  7319. function getView(start, end, transforms) {
  7320. var index = -1,
  7321. length = transforms.length;
  7322. while (++index < length) {
  7323. var data = transforms[index],
  7324. size = data.size;
  7325. switch (data.type) {
  7326. case 'drop': start += size; break;
  7327. case 'dropRight': end -= size; break;
  7328. case 'take': end = nativeMin(end, start + size); break;
  7329. case 'takeRight': start = nativeMax(start, end - size); break;
  7330. }
  7331. }
  7332. return { 'start': start, 'end': end };
  7333. }
  7334. /**
  7335. * Extracts wrapper details from the `source` body comment.
  7336. *
  7337. * @private
  7338. * @param {string} source The source to inspect.
  7339. * @returns {Array} Returns the wrapper details.
  7340. */
  7341. function getWrapDetails(source) {
  7342. var match = source.match(reWrapDetails);
  7343. return match ? match[1].split(reSplitDetails) : [];
  7344. }
  7345. /**
  7346. * Checks if `path` exists on `object`.
  7347. *
  7348. * @private
  7349. * @param {Object} object The object to query.
  7350. * @param {Array|string} path The path to check.
  7351. * @param {Function} hasFunc The function to check properties.
  7352. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7353. */
  7354. function hasPath(object, path, hasFunc) {
  7355. path = castPath(path, object);
  7356. var index = -1,
  7357. length = path.length,
  7358. result = false;
  7359. while (++index < length) {
  7360. var key = toKey(path[index]);
  7361. if (!(result = object != null && hasFunc(object, key))) {
  7362. break;
  7363. }
  7364. object = object[key];
  7365. }
  7366. if (result || ++index != length) {
  7367. return result;
  7368. }
  7369. length = object == null ? 0 : object.length;
  7370. return !!length && isLength(length) && isIndex(key, length) &&
  7371. (isArray(object) || isArguments(object));
  7372. }
  7373. /**
  7374. * Initializes an array clone.
  7375. *
  7376. * @private
  7377. * @param {Array} array The array to clone.
  7378. * @returns {Array} Returns the initialized clone.
  7379. */
  7380. function initCloneArray(array) {
  7381. var length = array.length,
  7382. result = new array.constructor(length);
  7383. // Add properties assigned by `RegExp#exec`.
  7384. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7385. result.index = array.index;
  7386. result.input = array.input;
  7387. }
  7388. return result;
  7389. }
  7390. /**
  7391. * Initializes an object clone.
  7392. *
  7393. * @private
  7394. * @param {Object} object The object to clone.
  7395. * @returns {Object} Returns the initialized clone.
  7396. */
  7397. function initCloneObject(object) {
  7398. return (typeof object.constructor == 'function' && !isPrototype(object))
  7399. ? baseCreate(getPrototype(object))
  7400. : {};
  7401. }
  7402. /**
  7403. * Initializes an object clone based on its `toStringTag`.
  7404. *
  7405. * **Note:** This function only supports cloning values with tags of
  7406. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7407. *
  7408. * @private
  7409. * @param {Object} object The object to clone.
  7410. * @param {string} tag The `toStringTag` of the object to clone.
  7411. * @param {boolean} [isDeep] Specify a deep clone.
  7412. * @returns {Object} Returns the initialized clone.
  7413. */
  7414. function initCloneByTag(object, tag, isDeep) {
  7415. var Ctor = object.constructor;
  7416. switch (tag) {
  7417. case arrayBufferTag:
  7418. return cloneArrayBuffer(object);
  7419. case boolTag:
  7420. case dateTag:
  7421. return new Ctor(+object);
  7422. case dataViewTag:
  7423. return cloneDataView(object, isDeep);
  7424. case float32Tag: case float64Tag:
  7425. case int8Tag: case int16Tag: case int32Tag:
  7426. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7427. return cloneTypedArray(object, isDeep);
  7428. case mapTag:
  7429. return new Ctor;
  7430. case numberTag:
  7431. case stringTag:
  7432. return new Ctor(object);
  7433. case regexpTag:
  7434. return cloneRegExp(object);
  7435. case setTag:
  7436. return new Ctor;
  7437. case symbolTag:
  7438. return cloneSymbol(object);
  7439. }
  7440. }
  7441. /**
  7442. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7443. *
  7444. * @private
  7445. * @param {string} source The source to modify.
  7446. * @returns {Array} details The details to insert.
  7447. * @returns {string} Returns the modified source.
  7448. */
  7449. function insertWrapDetails(source, details) {
  7450. var length = details.length;
  7451. if (!length) {
  7452. return source;
  7453. }
  7454. var lastIndex = length - 1;
  7455. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7456. details = details.join(length > 2 ? ', ' : ' ');
  7457. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7458. }
  7459. /**
  7460. * Checks if `value` is a flattenable `arguments` object or array.
  7461. *
  7462. * @private
  7463. * @param {*} value The value to check.
  7464. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7465. */
  7466. function isFlattenable(value) {
  7467. return isArray(value) || isArguments(value) ||
  7468. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7469. }
  7470. /**
  7471. * Checks if `value` is a valid array-like index.
  7472. *
  7473. * @private
  7474. * @param {*} value The value to check.
  7475. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7476. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7477. */
  7478. function isIndex(value, length) {
  7479. var type = typeof value;
  7480. length = length == null ? MAX_SAFE_INTEGER : length;
  7481. return !!length &&
  7482. (type == 'number' ||
  7483. (type != 'symbol' && reIsUint.test(value))) &&
  7484. (value > -1 && value % 1 == 0 && value < length);
  7485. }
  7486. /**
  7487. * Checks if the given arguments are from an iteratee call.
  7488. *
  7489. * @private
  7490. * @param {*} value The potential iteratee value argument.
  7491. * @param {*} index The potential iteratee index or key argument.
  7492. * @param {*} object The potential iteratee object argument.
  7493. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7494. * else `false`.
  7495. */
  7496. function isIterateeCall(value, index, object) {
  7497. if (!isObject(object)) {
  7498. return false;
  7499. }
  7500. var type = typeof index;
  7501. if (type == 'number'
  7502. ? (isArrayLike(object) && isIndex(index, object.length))
  7503. : (type == 'string' && index in object)
  7504. ) {
  7505. return eq(object[index], value);
  7506. }
  7507. return false;
  7508. }
  7509. /**
  7510. * Checks if `value` is a property name and not a property path.
  7511. *
  7512. * @private
  7513. * @param {*} value The value to check.
  7514. * @param {Object} [object] The object to query keys on.
  7515. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7516. */
  7517. function isKey(value, object) {
  7518. if (isArray(value)) {
  7519. return false;
  7520. }
  7521. var type = typeof value;
  7522. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7523. value == null || isSymbol(value)) {
  7524. return true;
  7525. }
  7526. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7527. (object != null && value in Object(object));
  7528. }
  7529. /**
  7530. * Checks if `value` is suitable for use as unique object key.
  7531. *
  7532. * @private
  7533. * @param {*} value The value to check.
  7534. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7535. */
  7536. function isKeyable(value) {
  7537. var type = typeof value;
  7538. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7539. ? (value !== '__proto__')
  7540. : (value === null);
  7541. }
  7542. /**
  7543. * Checks if `func` has a lazy counterpart.
  7544. *
  7545. * @private
  7546. * @param {Function} func The function to check.
  7547. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7548. * else `false`.
  7549. */
  7550. function isLaziable(func) {
  7551. var funcName = getFuncName(func),
  7552. other = lodash[funcName];
  7553. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7554. return false;
  7555. }
  7556. if (func === other) {
  7557. return true;
  7558. }
  7559. var data = getData(other);
  7560. return !!data && func === data[0];
  7561. }
  7562. /**
  7563. * Checks if `func` has its source masked.
  7564. *
  7565. * @private
  7566. * @param {Function} func The function to check.
  7567. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7568. */
  7569. function isMasked(func) {
  7570. return !!maskSrcKey && (maskSrcKey in func);
  7571. }
  7572. /**
  7573. * Checks if `func` is capable of being masked.
  7574. *
  7575. * @private
  7576. * @param {*} value The value to check.
  7577. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7578. */
  7579. var isMaskable = coreJsData ? isFunction : stubFalse;
  7580. /**
  7581. * Checks if `value` is likely a prototype object.
  7582. *
  7583. * @private
  7584. * @param {*} value The value to check.
  7585. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7586. */
  7587. function isPrototype(value) {
  7588. var Ctor = value && value.constructor,
  7589. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7590. return value === proto;
  7591. }
  7592. /**
  7593. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7594. *
  7595. * @private
  7596. * @param {*} value The value to check.
  7597. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7598. * equality comparisons, else `false`.
  7599. */
  7600. function isStrictComparable(value) {
  7601. return value === value && !isObject(value);
  7602. }
  7603. /**
  7604. * A specialized version of `matchesProperty` for source values suitable
  7605. * for strict equality comparisons, i.e. `===`.
  7606. *
  7607. * @private
  7608. * @param {string} key The key of the property to get.
  7609. * @param {*} srcValue The value to match.
  7610. * @returns {Function} Returns the new spec function.
  7611. */
  7612. function matchesStrictComparable(key, srcValue) {
  7613. return function(object) {
  7614. if (object == null) {
  7615. return false;
  7616. }
  7617. return object[key] === srcValue &&
  7618. (srcValue !== undefined || (key in Object(object)));
  7619. };
  7620. }
  7621. /**
  7622. * A specialized version of `_.memoize` which clears the memoized function's
  7623. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7624. *
  7625. * @private
  7626. * @param {Function} func The function to have its output memoized.
  7627. * @returns {Function} Returns the new memoized function.
  7628. */
  7629. function memoizeCapped(func) {
  7630. var result = memoize(func, function(key) {
  7631. if (cache.size === MAX_MEMOIZE_SIZE) {
  7632. cache.clear();
  7633. }
  7634. return key;
  7635. });
  7636. var cache = result.cache;
  7637. return result;
  7638. }
  7639. /**
  7640. * Merges the function metadata of `source` into `data`.
  7641. *
  7642. * Merging metadata reduces the number of wrappers used to invoke a function.
  7643. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7644. * may be applied regardless of execution order. Methods like `_.ary` and
  7645. * `_.rearg` modify function arguments, making the order in which they are
  7646. * executed important, preventing the merging of metadata. However, we make
  7647. * an exception for a safe combined case where curried functions have `_.ary`
  7648. * and or `_.rearg` applied.
  7649. *
  7650. * @private
  7651. * @param {Array} data The destination metadata.
  7652. * @param {Array} source The source metadata.
  7653. * @returns {Array} Returns `data`.
  7654. */
  7655. function mergeData(data, source) {
  7656. var bitmask = data[1],
  7657. srcBitmask = source[1],
  7658. newBitmask = bitmask | srcBitmask,
  7659. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7660. var isCombo =
  7661. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7662. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7663. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7664. // Exit early if metadata can't be merged.
  7665. if (!(isCommon || isCombo)) {
  7666. return data;
  7667. }
  7668. // Use source `thisArg` if available.
  7669. if (srcBitmask & WRAP_BIND_FLAG) {
  7670. data[2] = source[2];
  7671. // Set when currying a bound function.
  7672. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7673. }
  7674. // Compose partial arguments.
  7675. var value = source[3];
  7676. if (value) {
  7677. var partials = data[3];
  7678. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7679. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7680. }
  7681. // Compose partial right arguments.
  7682. value = source[5];
  7683. if (value) {
  7684. partials = data[5];
  7685. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7686. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7687. }
  7688. // Use source `argPos` if available.
  7689. value = source[7];
  7690. if (value) {
  7691. data[7] = value;
  7692. }
  7693. // Use source `ary` if it's smaller.
  7694. if (srcBitmask & WRAP_ARY_FLAG) {
  7695. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7696. }
  7697. // Use source `arity` if one is not provided.
  7698. if (data[9] == null) {
  7699. data[9] = source[9];
  7700. }
  7701. // Use source `func` and merge bitmasks.
  7702. data[0] = source[0];
  7703. data[1] = newBitmask;
  7704. return data;
  7705. }
  7706. /**
  7707. * This function is like
  7708. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7709. * except that it includes inherited enumerable properties.
  7710. *
  7711. * @private
  7712. * @param {Object} object The object to query.
  7713. * @returns {Array} Returns the array of property names.
  7714. */
  7715. function nativeKeysIn(object) {
  7716. var result = [];
  7717. if (object != null) {
  7718. for (var key in Object(object)) {
  7719. result.push(key);
  7720. }
  7721. }
  7722. return result;
  7723. }
  7724. /**
  7725. * Converts `value` to a string using `Object.prototype.toString`.
  7726. *
  7727. * @private
  7728. * @param {*} value The value to convert.
  7729. * @returns {string} Returns the converted string.
  7730. */
  7731. function objectToString(value) {
  7732. return nativeObjectToString.call(value);
  7733. }
  7734. /**
  7735. * A specialized version of `baseRest` which transforms the rest array.
  7736. *
  7737. * @private
  7738. * @param {Function} func The function to apply a rest parameter to.
  7739. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7740. * @param {Function} transform The rest array transform.
  7741. * @returns {Function} Returns the new function.
  7742. */
  7743. function overRest(func, start, transform) {
  7744. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7745. return function() {
  7746. var args = arguments,
  7747. index = -1,
  7748. length = nativeMax(args.length - start, 0),
  7749. array = Array(length);
  7750. while (++index < length) {
  7751. array[index] = args[start + index];
  7752. }
  7753. index = -1;
  7754. var otherArgs = Array(start + 1);
  7755. while (++index < start) {
  7756. otherArgs[index] = args[index];
  7757. }
  7758. otherArgs[start] = transform(array);
  7759. return apply(func, this, otherArgs);
  7760. };
  7761. }
  7762. /**
  7763. * Gets the parent value at `path` of `object`.
  7764. *
  7765. * @private
  7766. * @param {Object} object The object to query.
  7767. * @param {Array} path The path to get the parent value of.
  7768. * @returns {*} Returns the parent value.
  7769. */
  7770. function parent(object, path) {
  7771. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7772. }
  7773. /**
  7774. * Reorder `array` according to the specified indexes where the element at
  7775. * the first index is assigned as the first element, the element at
  7776. * the second index is assigned as the second element, and so on.
  7777. *
  7778. * @private
  7779. * @param {Array} array The array to reorder.
  7780. * @param {Array} indexes The arranged array indexes.
  7781. * @returns {Array} Returns `array`.
  7782. */
  7783. function reorder(array, indexes) {
  7784. var arrLength = array.length,
  7785. length = nativeMin(indexes.length, arrLength),
  7786. oldArray = copyArray(array);
  7787. while (length--) {
  7788. var index = indexes[length];
  7789. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7790. }
  7791. return array;
  7792. }
  7793. /**
  7794. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7795. *
  7796. * @private
  7797. * @param {Object} object The object to query.
  7798. * @param {string} key The key of the property to get.
  7799. * @returns {*} Returns the property value.
  7800. */
  7801. function safeGet(object, key) {
  7802. if (key === 'constructor' && typeof object[key] === 'function') {
  7803. return;
  7804. }
  7805. if (key == '__proto__') {
  7806. return;
  7807. }
  7808. return object[key];
  7809. }
  7810. /**
  7811. * Sets metadata for `func`.
  7812. *
  7813. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7814. * period of time, it will trip its breaker and transition to an identity
  7815. * function to avoid garbage collection pauses in V8. See
  7816. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7817. * for more details.
  7818. *
  7819. * @private
  7820. * @param {Function} func The function to associate metadata with.
  7821. * @param {*} data The metadata.
  7822. * @returns {Function} Returns `func`.
  7823. */
  7824. var setData = shortOut(baseSetData);
  7825. /**
  7826. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7827. *
  7828. * @private
  7829. * @param {Function} func The function to delay.
  7830. * @param {number} wait The number of milliseconds to delay invocation.
  7831. * @returns {number|Object} Returns the timer id or timeout object.
  7832. */
  7833. var setTimeout = ctxSetTimeout || function(func, wait) {
  7834. return root.setTimeout(func, wait);
  7835. };
  7836. /**
  7837. * Sets the `toString` method of `func` to return `string`.
  7838. *
  7839. * @private
  7840. * @param {Function} func The function to modify.
  7841. * @param {Function} string The `toString` result.
  7842. * @returns {Function} Returns `func`.
  7843. */
  7844. var setToString = shortOut(baseSetToString);
  7845. /**
  7846. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7847. * with wrapper details in a comment at the top of the source body.
  7848. *
  7849. * @private
  7850. * @param {Function} wrapper The function to modify.
  7851. * @param {Function} reference The reference function.
  7852. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7853. * @returns {Function} Returns `wrapper`.
  7854. */
  7855. function setWrapToString(wrapper, reference, bitmask) {
  7856. var source = (reference + '');
  7857. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7858. }
  7859. /**
  7860. * Creates a function that'll short out and invoke `identity` instead
  7861. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7862. * milliseconds.
  7863. *
  7864. * @private
  7865. * @param {Function} func The function to restrict.
  7866. * @returns {Function} Returns the new shortable function.
  7867. */
  7868. function shortOut(func) {
  7869. var count = 0,
  7870. lastCalled = 0;
  7871. return function() {
  7872. var stamp = nativeNow(),
  7873. remaining = HOT_SPAN - (stamp - lastCalled);
  7874. lastCalled = stamp;
  7875. if (remaining > 0) {
  7876. if (++count >= HOT_COUNT) {
  7877. return arguments[0];
  7878. }
  7879. } else {
  7880. count = 0;
  7881. }
  7882. return func.apply(undefined, arguments);
  7883. };
  7884. }
  7885. /**
  7886. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7887. *
  7888. * @private
  7889. * @param {Array} array The array to shuffle.
  7890. * @param {number} [size=array.length] The size of `array`.
  7891. * @returns {Array} Returns `array`.
  7892. */
  7893. function shuffleSelf(array, size) {
  7894. var index = -1,
  7895. length = array.length,
  7896. lastIndex = length - 1;
  7897. size = size === undefined ? length : size;
  7898. while (++index < size) {
  7899. var rand = baseRandom(index, lastIndex),
  7900. value = array[rand];
  7901. array[rand] = array[index];
  7902. array[index] = value;
  7903. }
  7904. array.length = size;
  7905. return array;
  7906. }
  7907. /**
  7908. * Converts `string` to a property path array.
  7909. *
  7910. * @private
  7911. * @param {string} string The string to convert.
  7912. * @returns {Array} Returns the property path array.
  7913. */
  7914. var stringToPath = memoizeCapped(function(string) {
  7915. var result = [];
  7916. if (string.charCodeAt(0) === 46 /* . */) {
  7917. result.push('');
  7918. }
  7919. string.replace(rePropName, function(match, number, quote, subString) {
  7920. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7921. });
  7922. return result;
  7923. });
  7924. /**
  7925. * Converts `value` to a string key if it's not a string or symbol.
  7926. *
  7927. * @private
  7928. * @param {*} value The value to inspect.
  7929. * @returns {string|symbol} Returns the key.
  7930. */
  7931. function toKey(value) {
  7932. if (typeof value == 'string' || isSymbol(value)) {
  7933. return value;
  7934. }
  7935. var result = (value + '');
  7936. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7937. }
  7938. /**
  7939. * Converts `func` to its source code.
  7940. *
  7941. * @private
  7942. * @param {Function} func The function to convert.
  7943. * @returns {string} Returns the source code.
  7944. */
  7945. function toSource(func) {
  7946. if (func != null) {
  7947. try {
  7948. return funcToString.call(func);
  7949. } catch (e) {}
  7950. try {
  7951. return (func + '');
  7952. } catch (e) {}
  7953. }
  7954. return '';
  7955. }
  7956. /**
  7957. * Updates wrapper `details` based on `bitmask` flags.
  7958. *
  7959. * @private
  7960. * @returns {Array} details The details to modify.
  7961. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7962. * @returns {Array} Returns `details`.
  7963. */
  7964. function updateWrapDetails(details, bitmask) {
  7965. arrayEach(wrapFlags, function(pair) {
  7966. var value = '_.' + pair[0];
  7967. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7968. details.push(value);
  7969. }
  7970. });
  7971. return details.sort();
  7972. }
  7973. /**
  7974. * Creates a clone of `wrapper`.
  7975. *
  7976. * @private
  7977. * @param {Object} wrapper The wrapper to clone.
  7978. * @returns {Object} Returns the cloned wrapper.
  7979. */
  7980. function wrapperClone(wrapper) {
  7981. if (wrapper instanceof LazyWrapper) {
  7982. return wrapper.clone();
  7983. }
  7984. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7985. result.__actions__ = copyArray(wrapper.__actions__);
  7986. result.__index__ = wrapper.__index__;
  7987. result.__values__ = wrapper.__values__;
  7988. return result;
  7989. }
  7990. /*------------------------------------------------------------------------*/
  7991. /**
  7992. * Creates an array of elements split into groups the length of `size`.
  7993. * If `array` can't be split evenly, the final chunk will be the remaining
  7994. * elements.
  7995. *
  7996. * @static
  7997. * @memberOf _
  7998. * @since 3.0.0
  7999. * @category Array
  8000. * @param {Array} array The array to process.
  8001. * @param {number} [size=1] The length of each chunk
  8002. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8003. * @returns {Array} Returns the new array of chunks.
  8004. * @example
  8005. *
  8006. * _.chunk(['a', 'b', 'c', 'd'], 2);
  8007. * // => [['a', 'b'], ['c', 'd']]
  8008. *
  8009. * _.chunk(['a', 'b', 'c', 'd'], 3);
  8010. * // => [['a', 'b', 'c'], ['d']]
  8011. */
  8012. function chunk(array, size, guard) {
  8013. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  8014. size = 1;
  8015. } else {
  8016. size = nativeMax(toInteger(size), 0);
  8017. }
  8018. var length = array == null ? 0 : array.length;
  8019. if (!length || size < 1) {
  8020. return [];
  8021. }
  8022. var index = 0,
  8023. resIndex = 0,
  8024. result = Array(nativeCeil(length / size));
  8025. while (index < length) {
  8026. result[resIndex++] = baseSlice(array, index, (index += size));
  8027. }
  8028. return result;
  8029. }
  8030. /**
  8031. * Creates an array with all falsey values removed. The values `false`, `null`,
  8032. * `0`, `""`, `undefined`, and `NaN` are falsey.
  8033. *
  8034. * @static
  8035. * @memberOf _
  8036. * @since 0.1.0
  8037. * @category Array
  8038. * @param {Array} array The array to compact.
  8039. * @returns {Array} Returns the new array of filtered values.
  8040. * @example
  8041. *
  8042. * _.compact([0, 1, false, 2, '', 3]);
  8043. * // => [1, 2, 3]
  8044. */
  8045. function compact(array) {
  8046. var index = -1,
  8047. length = array == null ? 0 : array.length,
  8048. resIndex = 0,
  8049. result = [];
  8050. while (++index < length) {
  8051. var value = array[index];
  8052. if (value) {
  8053. result[resIndex++] = value;
  8054. }
  8055. }
  8056. return result;
  8057. }
  8058. /**
  8059. * Creates a new array concatenating `array` with any additional arrays
  8060. * and/or values.
  8061. *
  8062. * @static
  8063. * @memberOf _
  8064. * @since 4.0.0
  8065. * @category Array
  8066. * @param {Array} array The array to concatenate.
  8067. * @param {...*} [values] The values to concatenate.
  8068. * @returns {Array} Returns the new concatenated array.
  8069. * @example
  8070. *
  8071. * var array = [1];
  8072. * var other = _.concat(array, 2, [3], [[4]]);
  8073. *
  8074. * console.log(other);
  8075. * // => [1, 2, 3, [4]]
  8076. *
  8077. * console.log(array);
  8078. * // => [1]
  8079. */
  8080. function concat() {
  8081. var length = arguments.length;
  8082. if (!length) {
  8083. return [];
  8084. }
  8085. var args = Array(length - 1),
  8086. array = arguments[0],
  8087. index = length;
  8088. while (index--) {
  8089. args[index - 1] = arguments[index];
  8090. }
  8091. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  8092. }
  8093. /**
  8094. * Creates an array of `array` values not included in the other given arrays
  8095. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8096. * for equality comparisons. The order and references of result values are
  8097. * determined by the first array.
  8098. *
  8099. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  8100. *
  8101. * @static
  8102. * @memberOf _
  8103. * @since 0.1.0
  8104. * @category Array
  8105. * @param {Array} array The array to inspect.
  8106. * @param {...Array} [values] The values to exclude.
  8107. * @returns {Array} Returns the new array of filtered values.
  8108. * @see _.without, _.xor
  8109. * @example
  8110. *
  8111. * _.difference([2, 1], [2, 3]);
  8112. * // => [1]
  8113. */
  8114. var difference = baseRest(function(array, values) {
  8115. return isArrayLikeObject(array)
  8116. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  8117. : [];
  8118. });
  8119. /**
  8120. * This method is like `_.difference` except that it accepts `iteratee` which
  8121. * is invoked for each element of `array` and `values` to generate the criterion
  8122. * by which they're compared. The order and references of result values are
  8123. * determined by the first array. The iteratee is invoked with one argument:
  8124. * (value).
  8125. *
  8126. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  8127. *
  8128. * @static
  8129. * @memberOf _
  8130. * @since 4.0.0
  8131. * @category Array
  8132. * @param {Array} array The array to inspect.
  8133. * @param {...Array} [values] The values to exclude.
  8134. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8135. * @returns {Array} Returns the new array of filtered values.
  8136. * @example
  8137. *
  8138. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8139. * // => [1.2]
  8140. *
  8141. * // The `_.property` iteratee shorthand.
  8142. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  8143. * // => [{ 'x': 2 }]
  8144. */
  8145. var differenceBy = baseRest(function(array, values) {
  8146. var iteratee = last(values);
  8147. if (isArrayLikeObject(iteratee)) {
  8148. iteratee = undefined;
  8149. }
  8150. return isArrayLikeObject(array)
  8151. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  8152. : [];
  8153. });
  8154. /**
  8155. * This method is like `_.difference` except that it accepts `comparator`
  8156. * which is invoked to compare elements of `array` to `values`. The order and
  8157. * references of result values are determined by the first array. The comparator
  8158. * is invoked with two arguments: (arrVal, othVal).
  8159. *
  8160. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  8161. *
  8162. * @static
  8163. * @memberOf _
  8164. * @since 4.0.0
  8165. * @category Array
  8166. * @param {Array} array The array to inspect.
  8167. * @param {...Array} [values] The values to exclude.
  8168. * @param {Function} [comparator] The comparator invoked per element.
  8169. * @returns {Array} Returns the new array of filtered values.
  8170. * @example
  8171. *
  8172. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8173. *
  8174. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  8175. * // => [{ 'x': 2, 'y': 1 }]
  8176. */
  8177. var differenceWith = baseRest(function(array, values) {
  8178. var comparator = last(values);
  8179. if (isArrayLikeObject(comparator)) {
  8180. comparator = undefined;
  8181. }
  8182. return isArrayLikeObject(array)
  8183. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  8184. : [];
  8185. });
  8186. /**
  8187. * Creates a slice of `array` with `n` elements dropped from the beginning.
  8188. *
  8189. * @static
  8190. * @memberOf _
  8191. * @since 0.5.0
  8192. * @category Array
  8193. * @param {Array} array The array to query.
  8194. * @param {number} [n=1] The number of elements to drop.
  8195. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8196. * @returns {Array} Returns the slice of `array`.
  8197. * @example
  8198. *
  8199. * _.drop([1, 2, 3]);
  8200. * // => [2, 3]
  8201. *
  8202. * _.drop([1, 2, 3], 2);
  8203. * // => [3]
  8204. *
  8205. * _.drop([1, 2, 3], 5);
  8206. * // => []
  8207. *
  8208. * _.drop([1, 2, 3], 0);
  8209. * // => [1, 2, 3]
  8210. */
  8211. function drop(array, n, guard) {
  8212. var length = array == null ? 0 : array.length;
  8213. if (!length) {
  8214. return [];
  8215. }
  8216. n = (guard || n === undefined) ? 1 : toInteger(n);
  8217. return baseSlice(array, n < 0 ? 0 : n, length);
  8218. }
  8219. /**
  8220. * Creates a slice of `array` with `n` elements dropped from the end.
  8221. *
  8222. * @static
  8223. * @memberOf _
  8224. * @since 3.0.0
  8225. * @category Array
  8226. * @param {Array} array The array to query.
  8227. * @param {number} [n=1] The number of elements to drop.
  8228. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8229. * @returns {Array} Returns the slice of `array`.
  8230. * @example
  8231. *
  8232. * _.dropRight([1, 2, 3]);
  8233. * // => [1, 2]
  8234. *
  8235. * _.dropRight([1, 2, 3], 2);
  8236. * // => [1]
  8237. *
  8238. * _.dropRight([1, 2, 3], 5);
  8239. * // => []
  8240. *
  8241. * _.dropRight([1, 2, 3], 0);
  8242. * // => [1, 2, 3]
  8243. */
  8244. function dropRight(array, n, guard) {
  8245. var length = array == null ? 0 : array.length;
  8246. if (!length) {
  8247. return [];
  8248. }
  8249. n = (guard || n === undefined) ? 1 : toInteger(n);
  8250. n = length - n;
  8251. return baseSlice(array, 0, n < 0 ? 0 : n);
  8252. }
  8253. /**
  8254. * Creates a slice of `array` excluding elements dropped from the end.
  8255. * Elements are dropped until `predicate` returns falsey. The predicate is
  8256. * invoked with three arguments: (value, index, array).
  8257. *
  8258. * @static
  8259. * @memberOf _
  8260. * @since 3.0.0
  8261. * @category Array
  8262. * @param {Array} array The array to query.
  8263. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8264. * @returns {Array} Returns the slice of `array`.
  8265. * @example
  8266. *
  8267. * var users = [
  8268. * { 'user': 'barney', 'active': true },
  8269. * { 'user': 'fred', 'active': false },
  8270. * { 'user': 'pebbles', 'active': false }
  8271. * ];
  8272. *
  8273. * _.dropRightWhile(users, function(o) { return !o.active; });
  8274. * // => objects for ['barney']
  8275. *
  8276. * // The `_.matches` iteratee shorthand.
  8277. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  8278. * // => objects for ['barney', 'fred']
  8279. *
  8280. * // The `_.matchesProperty` iteratee shorthand.
  8281. * _.dropRightWhile(users, ['active', false]);
  8282. * // => objects for ['barney']
  8283. *
  8284. * // The `_.property` iteratee shorthand.
  8285. * _.dropRightWhile(users, 'active');
  8286. * // => objects for ['barney', 'fred', 'pebbles']
  8287. */
  8288. function dropRightWhile(array, predicate) {
  8289. return (array && array.length)
  8290. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  8291. : [];
  8292. }
  8293. /**
  8294. * Creates a slice of `array` excluding elements dropped from the beginning.
  8295. * Elements are dropped until `predicate` returns falsey. The predicate is
  8296. * invoked with three arguments: (value, index, array).
  8297. *
  8298. * @static
  8299. * @memberOf _
  8300. * @since 3.0.0
  8301. * @category Array
  8302. * @param {Array} array The array to query.
  8303. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8304. * @returns {Array} Returns the slice of `array`.
  8305. * @example
  8306. *
  8307. * var users = [
  8308. * { 'user': 'barney', 'active': false },
  8309. * { 'user': 'fred', 'active': false },
  8310. * { 'user': 'pebbles', 'active': true }
  8311. * ];
  8312. *
  8313. * _.dropWhile(users, function(o) { return !o.active; });
  8314. * // => objects for ['pebbles']
  8315. *
  8316. * // The `_.matches` iteratee shorthand.
  8317. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  8318. * // => objects for ['fred', 'pebbles']
  8319. *
  8320. * // The `_.matchesProperty` iteratee shorthand.
  8321. * _.dropWhile(users, ['active', false]);
  8322. * // => objects for ['pebbles']
  8323. *
  8324. * // The `_.property` iteratee shorthand.
  8325. * _.dropWhile(users, 'active');
  8326. * // => objects for ['barney', 'fred', 'pebbles']
  8327. */
  8328. function dropWhile(array, predicate) {
  8329. return (array && array.length)
  8330. ? baseWhile(array, getIteratee(predicate, 3), true)
  8331. : [];
  8332. }
  8333. /**
  8334. * Fills elements of `array` with `value` from `start` up to, but not
  8335. * including, `end`.
  8336. *
  8337. * **Note:** This method mutates `array`.
  8338. *
  8339. * @static
  8340. * @memberOf _
  8341. * @since 3.2.0
  8342. * @category Array
  8343. * @param {Array} array The array to fill.
  8344. * @param {*} value The value to fill `array` with.
  8345. * @param {number} [start=0] The start position.
  8346. * @param {number} [end=array.length] The end position.
  8347. * @returns {Array} Returns `array`.
  8348. * @example
  8349. *
  8350. * var array = [1, 2, 3];
  8351. *
  8352. * _.fill(array, 'a');
  8353. * console.log(array);
  8354. * // => ['a', 'a', 'a']
  8355. *
  8356. * _.fill(Array(3), 2);
  8357. * // => [2, 2, 2]
  8358. *
  8359. * _.fill([4, 6, 8, 10], '*', 1, 3);
  8360. * // => [4, '*', '*', 10]
  8361. */
  8362. function fill(array, value, start, end) {
  8363. var length = array == null ? 0 : array.length;
  8364. if (!length) {
  8365. return [];
  8366. }
  8367. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  8368. start = 0;
  8369. end = length;
  8370. }
  8371. return baseFill(array, value, start, end);
  8372. }
  8373. /**
  8374. * This method is like `_.find` except that it returns the index of the first
  8375. * element `predicate` returns truthy for instead of the element itself.
  8376. *
  8377. * @static
  8378. * @memberOf _
  8379. * @since 1.1.0
  8380. * @category Array
  8381. * @param {Array} array The array to inspect.
  8382. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8383. * @param {number} [fromIndex=0] The index to search from.
  8384. * @returns {number} Returns the index of the found element, else `-1`.
  8385. * @example
  8386. *
  8387. * var users = [
  8388. * { 'user': 'barney', 'active': false },
  8389. * { 'user': 'fred', 'active': false },
  8390. * { 'user': 'pebbles', 'active': true }
  8391. * ];
  8392. *
  8393. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8394. * // => 0
  8395. *
  8396. * // The `_.matches` iteratee shorthand.
  8397. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8398. * // => 1
  8399. *
  8400. * // The `_.matchesProperty` iteratee shorthand.
  8401. * _.findIndex(users, ['active', false]);
  8402. * // => 0
  8403. *
  8404. * // The `_.property` iteratee shorthand.
  8405. * _.findIndex(users, 'active');
  8406. * // => 2
  8407. */
  8408. function findIndex(array, predicate, fromIndex) {
  8409. var length = array == null ? 0 : array.length;
  8410. if (!length) {
  8411. return -1;
  8412. }
  8413. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8414. if (index < 0) {
  8415. index = nativeMax(length + index, 0);
  8416. }
  8417. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8418. }
  8419. /**
  8420. * This method is like `_.findIndex` except that it iterates over elements
  8421. * of `collection` from right to left.
  8422. *
  8423. * @static
  8424. * @memberOf _
  8425. * @since 2.0.0
  8426. * @category Array
  8427. * @param {Array} array The array to inspect.
  8428. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8429. * @param {number} [fromIndex=array.length-1] The index to search from.
  8430. * @returns {number} Returns the index of the found element, else `-1`.
  8431. * @example
  8432. *
  8433. * var users = [
  8434. * { 'user': 'barney', 'active': true },
  8435. * { 'user': 'fred', 'active': false },
  8436. * { 'user': 'pebbles', 'active': false }
  8437. * ];
  8438. *
  8439. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8440. * // => 2
  8441. *
  8442. * // The `_.matches` iteratee shorthand.
  8443. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8444. * // => 0
  8445. *
  8446. * // The `_.matchesProperty` iteratee shorthand.
  8447. * _.findLastIndex(users, ['active', false]);
  8448. * // => 2
  8449. *
  8450. * // The `_.property` iteratee shorthand.
  8451. * _.findLastIndex(users, 'active');
  8452. * // => 0
  8453. */
  8454. function findLastIndex(array, predicate, fromIndex) {
  8455. var length = array == null ? 0 : array.length;
  8456. if (!length) {
  8457. return -1;
  8458. }
  8459. var index = length - 1;
  8460. if (fromIndex !== undefined) {
  8461. index = toInteger(fromIndex);
  8462. index = fromIndex < 0
  8463. ? nativeMax(length + index, 0)
  8464. : nativeMin(index, length - 1);
  8465. }
  8466. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8467. }
  8468. /**
  8469. * Flattens `array` a single level deep.
  8470. *
  8471. * @static
  8472. * @memberOf _
  8473. * @since 0.1.0
  8474. * @category Array
  8475. * @param {Array} array The array to flatten.
  8476. * @returns {Array} Returns the new flattened array.
  8477. * @example
  8478. *
  8479. * _.flatten([1, [2, [3, [4]], 5]]);
  8480. * // => [1, 2, [3, [4]], 5]
  8481. */
  8482. function flatten(array) {
  8483. var length = array == null ? 0 : array.length;
  8484. return length ? baseFlatten(array, 1) : [];
  8485. }
  8486. /**
  8487. * Recursively flattens `array`.
  8488. *
  8489. * @static
  8490. * @memberOf _
  8491. * @since 3.0.0
  8492. * @category Array
  8493. * @param {Array} array The array to flatten.
  8494. * @returns {Array} Returns the new flattened array.
  8495. * @example
  8496. *
  8497. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8498. * // => [1, 2, 3, 4, 5]
  8499. */
  8500. function flattenDeep(array) {
  8501. var length = array == null ? 0 : array.length;
  8502. return length ? baseFlatten(array, INFINITY) : [];
  8503. }
  8504. /**
  8505. * Recursively flatten `array` up to `depth` times.
  8506. *
  8507. * @static
  8508. * @memberOf _
  8509. * @since 4.4.0
  8510. * @category Array
  8511. * @param {Array} array The array to flatten.
  8512. * @param {number} [depth=1] The maximum recursion depth.
  8513. * @returns {Array} Returns the new flattened array.
  8514. * @example
  8515. *
  8516. * var array = [1, [2, [3, [4]], 5]];
  8517. *
  8518. * _.flattenDepth(array, 1);
  8519. * // => [1, 2, [3, [4]], 5]
  8520. *
  8521. * _.flattenDepth(array, 2);
  8522. * // => [1, 2, 3, [4], 5]
  8523. */
  8524. function flattenDepth(array, depth) {
  8525. var length = array == null ? 0 : array.length;
  8526. if (!length) {
  8527. return [];
  8528. }
  8529. depth = depth === undefined ? 1 : toInteger(depth);
  8530. return baseFlatten(array, depth);
  8531. }
  8532. /**
  8533. * The inverse of `_.toPairs`; this method returns an object composed
  8534. * from key-value `pairs`.
  8535. *
  8536. * @static
  8537. * @memberOf _
  8538. * @since 4.0.0
  8539. * @category Array
  8540. * @param {Array} pairs The key-value pairs.
  8541. * @returns {Object} Returns the new object.
  8542. * @example
  8543. *
  8544. * _.fromPairs([['a', 1], ['b', 2]]);
  8545. * // => { 'a': 1, 'b': 2 }
  8546. */
  8547. function fromPairs(pairs) {
  8548. var index = -1,
  8549. length = pairs == null ? 0 : pairs.length,
  8550. result = {};
  8551. while (++index < length) {
  8552. var pair = pairs[index];
  8553. result[pair[0]] = pair[1];
  8554. }
  8555. return result;
  8556. }
  8557. /**
  8558. * Gets the first element of `array`.
  8559. *
  8560. * @static
  8561. * @memberOf _
  8562. * @since 0.1.0
  8563. * @alias first
  8564. * @category Array
  8565. * @param {Array} array The array to query.
  8566. * @returns {*} Returns the first element of `array`.
  8567. * @example
  8568. *
  8569. * _.head([1, 2, 3]);
  8570. * // => 1
  8571. *
  8572. * _.head([]);
  8573. * // => undefined
  8574. */
  8575. function head(array) {
  8576. return (array && array.length) ? array[0] : undefined;
  8577. }
  8578. /**
  8579. * Gets the index at which the first occurrence of `value` is found in `array`
  8580. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8581. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8582. * offset from the end of `array`.
  8583. *
  8584. * @static
  8585. * @memberOf _
  8586. * @since 0.1.0
  8587. * @category Array
  8588. * @param {Array} array The array to inspect.
  8589. * @param {*} value The value to search for.
  8590. * @param {number} [fromIndex=0] The index to search from.
  8591. * @returns {number} Returns the index of the matched value, else `-1`.
  8592. * @example
  8593. *
  8594. * _.indexOf([1, 2, 1, 2], 2);
  8595. * // => 1
  8596. *
  8597. * // Search from the `fromIndex`.
  8598. * _.indexOf([1, 2, 1, 2], 2, 2);
  8599. * // => 3
  8600. */
  8601. function indexOf(array, value, fromIndex) {
  8602. var length = array == null ? 0 : array.length;
  8603. if (!length) {
  8604. return -1;
  8605. }
  8606. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8607. if (index < 0) {
  8608. index = nativeMax(length + index, 0);
  8609. }
  8610. return baseIndexOf(array, value, index);
  8611. }
  8612. /**
  8613. * Gets all but the last element of `array`.
  8614. *
  8615. * @static
  8616. * @memberOf _
  8617. * @since 0.1.0
  8618. * @category Array
  8619. * @param {Array} array The array to query.
  8620. * @returns {Array} Returns the slice of `array`.
  8621. * @example
  8622. *
  8623. * _.initial([1, 2, 3]);
  8624. * // => [1, 2]
  8625. */
  8626. function initial(array) {
  8627. var length = array == null ? 0 : array.length;
  8628. return length ? baseSlice(array, 0, -1) : [];
  8629. }
  8630. /**
  8631. * Creates an array of unique values that are included in all given arrays
  8632. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8633. * for equality comparisons. The order and references of result values are
  8634. * determined by the first array.
  8635. *
  8636. * @static
  8637. * @memberOf _
  8638. * @since 0.1.0
  8639. * @category Array
  8640. * @param {...Array} [arrays] The arrays to inspect.
  8641. * @returns {Array} Returns the new array of intersecting values.
  8642. * @example
  8643. *
  8644. * _.intersection([2, 1], [2, 3]);
  8645. * // => [2]
  8646. */
  8647. var intersection = baseRest(function(arrays) {
  8648. var mapped = arrayMap(arrays, castArrayLikeObject);
  8649. return (mapped.length && mapped[0] === arrays[0])
  8650. ? baseIntersection(mapped)
  8651. : [];
  8652. });
  8653. /**
  8654. * This method is like `_.intersection` except that it accepts `iteratee`
  8655. * which is invoked for each element of each `arrays` to generate the criterion
  8656. * by which they're compared. The order and references of result values are
  8657. * determined by the first array. The iteratee is invoked with one argument:
  8658. * (value).
  8659. *
  8660. * @static
  8661. * @memberOf _
  8662. * @since 4.0.0
  8663. * @category Array
  8664. * @param {...Array} [arrays] The arrays to inspect.
  8665. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8666. * @returns {Array} Returns the new array of intersecting values.
  8667. * @example
  8668. *
  8669. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8670. * // => [2.1]
  8671. *
  8672. * // The `_.property` iteratee shorthand.
  8673. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8674. * // => [{ 'x': 1 }]
  8675. */
  8676. var intersectionBy = baseRest(function(arrays) {
  8677. var iteratee = last(arrays),
  8678. mapped = arrayMap(arrays, castArrayLikeObject);
  8679. if (iteratee === last(mapped)) {
  8680. iteratee = undefined;
  8681. } else {
  8682. mapped.pop();
  8683. }
  8684. return (mapped.length && mapped[0] === arrays[0])
  8685. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8686. : [];
  8687. });
  8688. /**
  8689. * This method is like `_.intersection` except that it accepts `comparator`
  8690. * which is invoked to compare elements of `arrays`. The order and references
  8691. * of result values are determined by the first array. The comparator is
  8692. * invoked with two arguments: (arrVal, othVal).
  8693. *
  8694. * @static
  8695. * @memberOf _
  8696. * @since 4.0.0
  8697. * @category Array
  8698. * @param {...Array} [arrays] The arrays to inspect.
  8699. * @param {Function} [comparator] The comparator invoked per element.
  8700. * @returns {Array} Returns the new array of intersecting values.
  8701. * @example
  8702. *
  8703. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8704. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8705. *
  8706. * _.intersectionWith(objects, others, _.isEqual);
  8707. * // => [{ 'x': 1, 'y': 2 }]
  8708. */
  8709. var intersectionWith = baseRest(function(arrays) {
  8710. var comparator = last(arrays),
  8711. mapped = arrayMap(arrays, castArrayLikeObject);
  8712. comparator = typeof comparator == 'function' ? comparator : undefined;
  8713. if (comparator) {
  8714. mapped.pop();
  8715. }
  8716. return (mapped.length && mapped[0] === arrays[0])
  8717. ? baseIntersection(mapped, undefined, comparator)
  8718. : [];
  8719. });
  8720. /**
  8721. * Converts all elements in `array` into a string separated by `separator`.
  8722. *
  8723. * @static
  8724. * @memberOf _
  8725. * @since 4.0.0
  8726. * @category Array
  8727. * @param {Array} array The array to convert.
  8728. * @param {string} [separator=','] The element separator.
  8729. * @returns {string} Returns the joined string.
  8730. * @example
  8731. *
  8732. * _.join(['a', 'b', 'c'], '~');
  8733. * // => 'a~b~c'
  8734. */
  8735. function join(array, separator) {
  8736. return array == null ? '' : nativeJoin.call(array, separator);
  8737. }
  8738. /**
  8739. * Gets the last element of `array`.
  8740. *
  8741. * @static
  8742. * @memberOf _
  8743. * @since 0.1.0
  8744. * @category Array
  8745. * @param {Array} array The array to query.
  8746. * @returns {*} Returns the last element of `array`.
  8747. * @example
  8748. *
  8749. * _.last([1, 2, 3]);
  8750. * // => 3
  8751. */
  8752. function last(array) {
  8753. var length = array == null ? 0 : array.length;
  8754. return length ? array[length - 1] : undefined;
  8755. }
  8756. /**
  8757. * This method is like `_.indexOf` except that it iterates over elements of
  8758. * `array` from right to left.
  8759. *
  8760. * @static
  8761. * @memberOf _
  8762. * @since 0.1.0
  8763. * @category Array
  8764. * @param {Array} array The array to inspect.
  8765. * @param {*} value The value to search for.
  8766. * @param {number} [fromIndex=array.length-1] The index to search from.
  8767. * @returns {number} Returns the index of the matched value, else `-1`.
  8768. * @example
  8769. *
  8770. * _.lastIndexOf([1, 2, 1, 2], 2);
  8771. * // => 3
  8772. *
  8773. * // Search from the `fromIndex`.
  8774. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8775. * // => 1
  8776. */
  8777. function lastIndexOf(array, value, fromIndex) {
  8778. var length = array == null ? 0 : array.length;
  8779. if (!length) {
  8780. return -1;
  8781. }
  8782. var index = length;
  8783. if (fromIndex !== undefined) {
  8784. index = toInteger(fromIndex);
  8785. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8786. }
  8787. return value === value
  8788. ? strictLastIndexOf(array, value, index)
  8789. : baseFindIndex(array, baseIsNaN, index, true);
  8790. }
  8791. /**
  8792. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8793. * element from the end is returned.
  8794. *
  8795. * @static
  8796. * @memberOf _
  8797. * @since 4.11.0
  8798. * @category Array
  8799. * @param {Array} array The array to query.
  8800. * @param {number} [n=0] The index of the element to return.
  8801. * @returns {*} Returns the nth element of `array`.
  8802. * @example
  8803. *
  8804. * var array = ['a', 'b', 'c', 'd'];
  8805. *
  8806. * _.nth(array, 1);
  8807. * // => 'b'
  8808. *
  8809. * _.nth(array, -2);
  8810. * // => 'c';
  8811. */
  8812. function nth(array, n) {
  8813. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8814. }
  8815. /**
  8816. * Removes all given values from `array` using
  8817. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8818. * for equality comparisons.
  8819. *
  8820. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8821. * to remove elements from an array by predicate.
  8822. *
  8823. * @static
  8824. * @memberOf _
  8825. * @since 2.0.0
  8826. * @category Array
  8827. * @param {Array} array The array to modify.
  8828. * @param {...*} [values] The values to remove.
  8829. * @returns {Array} Returns `array`.
  8830. * @example
  8831. *
  8832. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8833. *
  8834. * _.pull(array, 'a', 'c');
  8835. * console.log(array);
  8836. * // => ['b', 'b']
  8837. */
  8838. var pull = baseRest(pullAll);
  8839. /**
  8840. * This method is like `_.pull` except that it accepts an array of values to remove.
  8841. *
  8842. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8843. *
  8844. * @static
  8845. * @memberOf _
  8846. * @since 4.0.0
  8847. * @category Array
  8848. * @param {Array} array The array to modify.
  8849. * @param {Array} values The values to remove.
  8850. * @returns {Array} Returns `array`.
  8851. * @example
  8852. *
  8853. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8854. *
  8855. * _.pullAll(array, ['a', 'c']);
  8856. * console.log(array);
  8857. * // => ['b', 'b']
  8858. */
  8859. function pullAll(array, values) {
  8860. return (array && array.length && values && values.length)
  8861. ? basePullAll(array, values)
  8862. : array;
  8863. }
  8864. /**
  8865. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8866. * invoked for each element of `array` and `values` to generate the criterion
  8867. * by which they're compared. The iteratee is invoked with one argument: (value).
  8868. *
  8869. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8870. *
  8871. * @static
  8872. * @memberOf _
  8873. * @since 4.0.0
  8874. * @category Array
  8875. * @param {Array} array The array to modify.
  8876. * @param {Array} values The values to remove.
  8877. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8878. * @returns {Array} Returns `array`.
  8879. * @example
  8880. *
  8881. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8882. *
  8883. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8884. * console.log(array);
  8885. * // => [{ 'x': 2 }]
  8886. */
  8887. function pullAllBy(array, values, iteratee) {
  8888. return (array && array.length && values && values.length)
  8889. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8890. : array;
  8891. }
  8892. /**
  8893. * This method is like `_.pullAll` except that it accepts `comparator` which
  8894. * is invoked to compare elements of `array` to `values`. The comparator is
  8895. * invoked with two arguments: (arrVal, othVal).
  8896. *
  8897. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8898. *
  8899. * @static
  8900. * @memberOf _
  8901. * @since 4.6.0
  8902. * @category Array
  8903. * @param {Array} array The array to modify.
  8904. * @param {Array} values The values to remove.
  8905. * @param {Function} [comparator] The comparator invoked per element.
  8906. * @returns {Array} Returns `array`.
  8907. * @example
  8908. *
  8909. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8910. *
  8911. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8912. * console.log(array);
  8913. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8914. */
  8915. function pullAllWith(array, values, comparator) {
  8916. return (array && array.length && values && values.length)
  8917. ? basePullAll(array, values, undefined, comparator)
  8918. : array;
  8919. }
  8920. /**
  8921. * Removes elements from `array` corresponding to `indexes` and returns an
  8922. * array of removed elements.
  8923. *
  8924. * **Note:** Unlike `_.at`, this method mutates `array`.
  8925. *
  8926. * @static
  8927. * @memberOf _
  8928. * @since 3.0.0
  8929. * @category Array
  8930. * @param {Array} array The array to modify.
  8931. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8932. * @returns {Array} Returns the new array of removed elements.
  8933. * @example
  8934. *
  8935. * var array = ['a', 'b', 'c', 'd'];
  8936. * var pulled = _.pullAt(array, [1, 3]);
  8937. *
  8938. * console.log(array);
  8939. * // => ['a', 'c']
  8940. *
  8941. * console.log(pulled);
  8942. * // => ['b', 'd']
  8943. */
  8944. var pullAt = flatRest(function(array, indexes) {
  8945. var length = array == null ? 0 : array.length,
  8946. result = baseAt(array, indexes);
  8947. basePullAt(array, arrayMap(indexes, function(index) {
  8948. return isIndex(index, length) ? +index : index;
  8949. }).sort(compareAscending));
  8950. return result;
  8951. });
  8952. /**
  8953. * Removes all elements from `array` that `predicate` returns truthy for
  8954. * and returns an array of the removed elements. The predicate is invoked
  8955. * with three arguments: (value, index, array).
  8956. *
  8957. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8958. * to pull elements from an array by value.
  8959. *
  8960. * @static
  8961. * @memberOf _
  8962. * @since 2.0.0
  8963. * @category Array
  8964. * @param {Array} array The array to modify.
  8965. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8966. * @returns {Array} Returns the new array of removed elements.
  8967. * @example
  8968. *
  8969. * var array = [1, 2, 3, 4];
  8970. * var evens = _.remove(array, function(n) {
  8971. * return n % 2 == 0;
  8972. * });
  8973. *
  8974. * console.log(array);
  8975. * // => [1, 3]
  8976. *
  8977. * console.log(evens);
  8978. * // => [2, 4]
  8979. */
  8980. function remove(array, predicate) {
  8981. var result = [];
  8982. if (!(array && array.length)) {
  8983. return result;
  8984. }
  8985. var index = -1,
  8986. indexes = [],
  8987. length = array.length;
  8988. predicate = getIteratee(predicate, 3);
  8989. while (++index < length) {
  8990. var value = array[index];
  8991. if (predicate(value, index, array)) {
  8992. result.push(value);
  8993. indexes.push(index);
  8994. }
  8995. }
  8996. basePullAt(array, indexes);
  8997. return result;
  8998. }
  8999. /**
  9000. * Reverses `array` so that the first element becomes the last, the second
  9001. * element becomes the second to last, and so on.
  9002. *
  9003. * **Note:** This method mutates `array` and is based on
  9004. * [`Array#reverse`](https://mdn.io/Array/reverse).
  9005. *
  9006. * @static
  9007. * @memberOf _
  9008. * @since 4.0.0
  9009. * @category Array
  9010. * @param {Array} array The array to modify.
  9011. * @returns {Array} Returns `array`.
  9012. * @example
  9013. *
  9014. * var array = [1, 2, 3];
  9015. *
  9016. * _.reverse(array);
  9017. * // => [3, 2, 1]
  9018. *
  9019. * console.log(array);
  9020. * // => [3, 2, 1]
  9021. */
  9022. function reverse(array) {
  9023. return array == null ? array : nativeReverse.call(array);
  9024. }
  9025. /**
  9026. * Creates a slice of `array` from `start` up to, but not including, `end`.
  9027. *
  9028. * **Note:** This method is used instead of
  9029. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  9030. * returned.
  9031. *
  9032. * @static
  9033. * @memberOf _
  9034. * @since 3.0.0
  9035. * @category Array
  9036. * @param {Array} array The array to slice.
  9037. * @param {number} [start=0] The start position.
  9038. * @param {number} [end=array.length] The end position.
  9039. * @returns {Array} Returns the slice of `array`.
  9040. */
  9041. function slice(array, start, end) {
  9042. var length = array == null ? 0 : array.length;
  9043. if (!length) {
  9044. return [];
  9045. }
  9046. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  9047. start = 0;
  9048. end = length;
  9049. }
  9050. else {
  9051. start = start == null ? 0 : toInteger(start);
  9052. end = end === undefined ? length : toInteger(end);
  9053. }
  9054. return baseSlice(array, start, end);
  9055. }
  9056. /**
  9057. * Uses a binary search to determine the lowest index at which `value`
  9058. * should be inserted into `array` in order to maintain its sort order.
  9059. *
  9060. * @static
  9061. * @memberOf _
  9062. * @since 0.1.0
  9063. * @category Array
  9064. * @param {Array} array The sorted array to inspect.
  9065. * @param {*} value The value to evaluate.
  9066. * @returns {number} Returns the index at which `value` should be inserted
  9067. * into `array`.
  9068. * @example
  9069. *
  9070. * _.sortedIndex([30, 50], 40);
  9071. * // => 1
  9072. */
  9073. function sortedIndex(array, value) {
  9074. return baseSortedIndex(array, value);
  9075. }
  9076. /**
  9077. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  9078. * which is invoked for `value` and each element of `array` to compute their
  9079. * sort ranking. The iteratee is invoked with one argument: (value).
  9080. *
  9081. * @static
  9082. * @memberOf _
  9083. * @since 4.0.0
  9084. * @category Array
  9085. * @param {Array} array The sorted array to inspect.
  9086. * @param {*} value The value to evaluate.
  9087. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9088. * @returns {number} Returns the index at which `value` should be inserted
  9089. * into `array`.
  9090. * @example
  9091. *
  9092. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9093. *
  9094. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9095. * // => 0
  9096. *
  9097. * // The `_.property` iteratee shorthand.
  9098. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  9099. * // => 0
  9100. */
  9101. function sortedIndexBy(array, value, iteratee) {
  9102. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  9103. }
  9104. /**
  9105. * This method is like `_.indexOf` except that it performs a binary
  9106. * search on a sorted `array`.
  9107. *
  9108. * @static
  9109. * @memberOf _
  9110. * @since 4.0.0
  9111. * @category Array
  9112. * @param {Array} array The array to inspect.
  9113. * @param {*} value The value to search for.
  9114. * @returns {number} Returns the index of the matched value, else `-1`.
  9115. * @example
  9116. *
  9117. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  9118. * // => 1
  9119. */
  9120. function sortedIndexOf(array, value) {
  9121. var length = array == null ? 0 : array.length;
  9122. if (length) {
  9123. var index = baseSortedIndex(array, value);
  9124. if (index < length && eq(array[index], value)) {
  9125. return index;
  9126. }
  9127. }
  9128. return -1;
  9129. }
  9130. /**
  9131. * This method is like `_.sortedIndex` except that it returns the highest
  9132. * index at which `value` should be inserted into `array` in order to
  9133. * maintain its sort order.
  9134. *
  9135. * @static
  9136. * @memberOf _
  9137. * @since 3.0.0
  9138. * @category Array
  9139. * @param {Array} array The sorted array to inspect.
  9140. * @param {*} value The value to evaluate.
  9141. * @returns {number} Returns the index at which `value` should be inserted
  9142. * into `array`.
  9143. * @example
  9144. *
  9145. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  9146. * // => 4
  9147. */
  9148. function sortedLastIndex(array, value) {
  9149. return baseSortedIndex(array, value, true);
  9150. }
  9151. /**
  9152. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  9153. * which is invoked for `value` and each element of `array` to compute their
  9154. * sort ranking. The iteratee is invoked with one argument: (value).
  9155. *
  9156. * @static
  9157. * @memberOf _
  9158. * @since 4.0.0
  9159. * @category Array
  9160. * @param {Array} array The sorted array to inspect.
  9161. * @param {*} value The value to evaluate.
  9162. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9163. * @returns {number} Returns the index at which `value` should be inserted
  9164. * into `array`.
  9165. * @example
  9166. *
  9167. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9168. *
  9169. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9170. * // => 1
  9171. *
  9172. * // The `_.property` iteratee shorthand.
  9173. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  9174. * // => 1
  9175. */
  9176. function sortedLastIndexBy(array, value, iteratee) {
  9177. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  9178. }
  9179. /**
  9180. * This method is like `_.lastIndexOf` except that it performs a binary
  9181. * search on a sorted `array`.
  9182. *
  9183. * @static
  9184. * @memberOf _
  9185. * @since 4.0.0
  9186. * @category Array
  9187. * @param {Array} array The array to inspect.
  9188. * @param {*} value The value to search for.
  9189. * @returns {number} Returns the index of the matched value, else `-1`.
  9190. * @example
  9191. *
  9192. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  9193. * // => 3
  9194. */
  9195. function sortedLastIndexOf(array, value) {
  9196. var length = array == null ? 0 : array.length;
  9197. if (length) {
  9198. var index = baseSortedIndex(array, value, true) - 1;
  9199. if (eq(array[index], value)) {
  9200. return index;
  9201. }
  9202. }
  9203. return -1;
  9204. }
  9205. /**
  9206. * This method is like `_.uniq` except that it's designed and optimized
  9207. * for sorted arrays.
  9208. *
  9209. * @static
  9210. * @memberOf _
  9211. * @since 4.0.0
  9212. * @category Array
  9213. * @param {Array} array The array to inspect.
  9214. * @returns {Array} Returns the new duplicate free array.
  9215. * @example
  9216. *
  9217. * _.sortedUniq([1, 1, 2]);
  9218. * // => [1, 2]
  9219. */
  9220. function sortedUniq(array) {
  9221. return (array && array.length)
  9222. ? baseSortedUniq(array)
  9223. : [];
  9224. }
  9225. /**
  9226. * This method is like `_.uniqBy` except that it's designed and optimized
  9227. * for sorted arrays.
  9228. *
  9229. * @static
  9230. * @memberOf _
  9231. * @since 4.0.0
  9232. * @category Array
  9233. * @param {Array} array The array to inspect.
  9234. * @param {Function} [iteratee] The iteratee invoked per element.
  9235. * @returns {Array} Returns the new duplicate free array.
  9236. * @example
  9237. *
  9238. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  9239. * // => [1.1, 2.3]
  9240. */
  9241. function sortedUniqBy(array, iteratee) {
  9242. return (array && array.length)
  9243. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  9244. : [];
  9245. }
  9246. /**
  9247. * Gets all but the first element of `array`.
  9248. *
  9249. * @static
  9250. * @memberOf _
  9251. * @since 4.0.0
  9252. * @category Array
  9253. * @param {Array} array The array to query.
  9254. * @returns {Array} Returns the slice of `array`.
  9255. * @example
  9256. *
  9257. * _.tail([1, 2, 3]);
  9258. * // => [2, 3]
  9259. */
  9260. function tail(array) {
  9261. var length = array == null ? 0 : array.length;
  9262. return length ? baseSlice(array, 1, length) : [];
  9263. }
  9264. /**
  9265. * Creates a slice of `array` with `n` elements taken from the beginning.
  9266. *
  9267. * @static
  9268. * @memberOf _
  9269. * @since 0.1.0
  9270. * @category Array
  9271. * @param {Array} array The array to query.
  9272. * @param {number} [n=1] The number of elements to take.
  9273. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9274. * @returns {Array} Returns the slice of `array`.
  9275. * @example
  9276. *
  9277. * _.take([1, 2, 3]);
  9278. * // => [1]
  9279. *
  9280. * _.take([1, 2, 3], 2);
  9281. * // => [1, 2]
  9282. *
  9283. * _.take([1, 2, 3], 5);
  9284. * // => [1, 2, 3]
  9285. *
  9286. * _.take([1, 2, 3], 0);
  9287. * // => []
  9288. */
  9289. function take(array, n, guard) {
  9290. if (!(array && array.length)) {
  9291. return [];
  9292. }
  9293. n = (guard || n === undefined) ? 1 : toInteger(n);
  9294. return baseSlice(array, 0, n < 0 ? 0 : n);
  9295. }
  9296. /**
  9297. * Creates a slice of `array` with `n` elements taken from the end.
  9298. *
  9299. * @static
  9300. * @memberOf _
  9301. * @since 3.0.0
  9302. * @category Array
  9303. * @param {Array} array The array to query.
  9304. * @param {number} [n=1] The number of elements to take.
  9305. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9306. * @returns {Array} Returns the slice of `array`.
  9307. * @example
  9308. *
  9309. * _.takeRight([1, 2, 3]);
  9310. * // => [3]
  9311. *
  9312. * _.takeRight([1, 2, 3], 2);
  9313. * // => [2, 3]
  9314. *
  9315. * _.takeRight([1, 2, 3], 5);
  9316. * // => [1, 2, 3]
  9317. *
  9318. * _.takeRight([1, 2, 3], 0);
  9319. * // => []
  9320. */
  9321. function takeRight(array, n, guard) {
  9322. var length = array == null ? 0 : array.length;
  9323. if (!length) {
  9324. return [];
  9325. }
  9326. n = (guard || n === undefined) ? 1 : toInteger(n);
  9327. n = length - n;
  9328. return baseSlice(array, n < 0 ? 0 : n, length);
  9329. }
  9330. /**
  9331. * Creates a slice of `array` with elements taken from the end. Elements are
  9332. * taken until `predicate` returns falsey. The predicate is invoked with
  9333. * three arguments: (value, index, array).
  9334. *
  9335. * @static
  9336. * @memberOf _
  9337. * @since 3.0.0
  9338. * @category Array
  9339. * @param {Array} array The array to query.
  9340. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9341. * @returns {Array} Returns the slice of `array`.
  9342. * @example
  9343. *
  9344. * var users = [
  9345. * { 'user': 'barney', 'active': true },
  9346. * { 'user': 'fred', 'active': false },
  9347. * { 'user': 'pebbles', 'active': false }
  9348. * ];
  9349. *
  9350. * _.takeRightWhile(users, function(o) { return !o.active; });
  9351. * // => objects for ['fred', 'pebbles']
  9352. *
  9353. * // The `_.matches` iteratee shorthand.
  9354. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  9355. * // => objects for ['pebbles']
  9356. *
  9357. * // The `_.matchesProperty` iteratee shorthand.
  9358. * _.takeRightWhile(users, ['active', false]);
  9359. * // => objects for ['fred', 'pebbles']
  9360. *
  9361. * // The `_.property` iteratee shorthand.
  9362. * _.takeRightWhile(users, 'active');
  9363. * // => []
  9364. */
  9365. function takeRightWhile(array, predicate) {
  9366. return (array && array.length)
  9367. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  9368. : [];
  9369. }
  9370. /**
  9371. * Creates a slice of `array` with elements taken from the beginning. Elements
  9372. * are taken until `predicate` returns falsey. The predicate is invoked with
  9373. * three arguments: (value, index, array).
  9374. *
  9375. * @static
  9376. * @memberOf _
  9377. * @since 3.0.0
  9378. * @category Array
  9379. * @param {Array} array The array to query.
  9380. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9381. * @returns {Array} Returns the slice of `array`.
  9382. * @example
  9383. *
  9384. * var users = [
  9385. * { 'user': 'barney', 'active': false },
  9386. * { 'user': 'fred', 'active': false },
  9387. * { 'user': 'pebbles', 'active': true }
  9388. * ];
  9389. *
  9390. * _.takeWhile(users, function(o) { return !o.active; });
  9391. * // => objects for ['barney', 'fred']
  9392. *
  9393. * // The `_.matches` iteratee shorthand.
  9394. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9395. * // => objects for ['barney']
  9396. *
  9397. * // The `_.matchesProperty` iteratee shorthand.
  9398. * _.takeWhile(users, ['active', false]);
  9399. * // => objects for ['barney', 'fred']
  9400. *
  9401. * // The `_.property` iteratee shorthand.
  9402. * _.takeWhile(users, 'active');
  9403. * // => []
  9404. */
  9405. function takeWhile(array, predicate) {
  9406. return (array && array.length)
  9407. ? baseWhile(array, getIteratee(predicate, 3))
  9408. : [];
  9409. }
  9410. /**
  9411. * Creates an array of unique values, in order, from all given arrays using
  9412. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9413. * for equality comparisons.
  9414. *
  9415. * @static
  9416. * @memberOf _
  9417. * @since 0.1.0
  9418. * @category Array
  9419. * @param {...Array} [arrays] The arrays to inspect.
  9420. * @returns {Array} Returns the new array of combined values.
  9421. * @example
  9422. *
  9423. * _.union([2], [1, 2]);
  9424. * // => [2, 1]
  9425. */
  9426. var union = baseRest(function(arrays) {
  9427. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9428. });
  9429. /**
  9430. * This method is like `_.union` except that it accepts `iteratee` which is
  9431. * invoked for each element of each `arrays` to generate the criterion by
  9432. * which uniqueness is computed. Result values are chosen from the first
  9433. * array in which the value occurs. The iteratee is invoked with one argument:
  9434. * (value).
  9435. *
  9436. * @static
  9437. * @memberOf _
  9438. * @since 4.0.0
  9439. * @category Array
  9440. * @param {...Array} [arrays] The arrays to inspect.
  9441. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9442. * @returns {Array} Returns the new array of combined values.
  9443. * @example
  9444. *
  9445. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9446. * // => [2.1, 1.2]
  9447. *
  9448. * // The `_.property` iteratee shorthand.
  9449. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9450. * // => [{ 'x': 1 }, { 'x': 2 }]
  9451. */
  9452. var unionBy = baseRest(function(arrays) {
  9453. var iteratee = last(arrays);
  9454. if (isArrayLikeObject(iteratee)) {
  9455. iteratee = undefined;
  9456. }
  9457. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9458. });
  9459. /**
  9460. * This method is like `_.union` except that it accepts `comparator` which
  9461. * is invoked to compare elements of `arrays`. Result values are chosen from
  9462. * the first array in which the value occurs. The comparator is invoked
  9463. * with two arguments: (arrVal, othVal).
  9464. *
  9465. * @static
  9466. * @memberOf _
  9467. * @since 4.0.0
  9468. * @category Array
  9469. * @param {...Array} [arrays] The arrays to inspect.
  9470. * @param {Function} [comparator] The comparator invoked per element.
  9471. * @returns {Array} Returns the new array of combined values.
  9472. * @example
  9473. *
  9474. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9475. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9476. *
  9477. * _.unionWith(objects, others, _.isEqual);
  9478. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9479. */
  9480. var unionWith = baseRest(function(arrays) {
  9481. var comparator = last(arrays);
  9482. comparator = typeof comparator == 'function' ? comparator : undefined;
  9483. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9484. });
  9485. /**
  9486. * Creates a duplicate-free version of an array, using
  9487. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9488. * for equality comparisons, in which only the first occurrence of each element
  9489. * is kept. The order of result values is determined by the order they occur
  9490. * in the array.
  9491. *
  9492. * @static
  9493. * @memberOf _
  9494. * @since 0.1.0
  9495. * @category Array
  9496. * @param {Array} array The array to inspect.
  9497. * @returns {Array} Returns the new duplicate free array.
  9498. * @example
  9499. *
  9500. * _.uniq([2, 1, 2]);
  9501. * // => [2, 1]
  9502. */
  9503. function uniq(array) {
  9504. return (array && array.length) ? baseUniq(array) : [];
  9505. }
  9506. /**
  9507. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9508. * invoked for each element in `array` to generate the criterion by which
  9509. * uniqueness is computed. The order of result values is determined by the
  9510. * order they occur in the array. The iteratee is invoked with one argument:
  9511. * (value).
  9512. *
  9513. * @static
  9514. * @memberOf _
  9515. * @since 4.0.0
  9516. * @category Array
  9517. * @param {Array} array The array to inspect.
  9518. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9519. * @returns {Array} Returns the new duplicate free array.
  9520. * @example
  9521. *
  9522. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9523. * // => [2.1, 1.2]
  9524. *
  9525. * // The `_.property` iteratee shorthand.
  9526. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9527. * // => [{ 'x': 1 }, { 'x': 2 }]
  9528. */
  9529. function uniqBy(array, iteratee) {
  9530. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9531. }
  9532. /**
  9533. * This method is like `_.uniq` except that it accepts `comparator` which
  9534. * is invoked to compare elements of `array`. The order of result values is
  9535. * determined by the order they occur in the array.The comparator is invoked
  9536. * with two arguments: (arrVal, othVal).
  9537. *
  9538. * @static
  9539. * @memberOf _
  9540. * @since 4.0.0
  9541. * @category Array
  9542. * @param {Array} array The array to inspect.
  9543. * @param {Function} [comparator] The comparator invoked per element.
  9544. * @returns {Array} Returns the new duplicate free array.
  9545. * @example
  9546. *
  9547. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9548. *
  9549. * _.uniqWith(objects, _.isEqual);
  9550. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9551. */
  9552. function uniqWith(array, comparator) {
  9553. comparator = typeof comparator == 'function' ? comparator : undefined;
  9554. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9555. }
  9556. /**
  9557. * This method is like `_.zip` except that it accepts an array of grouped
  9558. * elements and creates an array regrouping the elements to their pre-zip
  9559. * configuration.
  9560. *
  9561. * @static
  9562. * @memberOf _
  9563. * @since 1.2.0
  9564. * @category Array
  9565. * @param {Array} array The array of grouped elements to process.
  9566. * @returns {Array} Returns the new array of regrouped elements.
  9567. * @example
  9568. *
  9569. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9570. * // => [['a', 1, true], ['b', 2, false]]
  9571. *
  9572. * _.unzip(zipped);
  9573. * // => [['a', 'b'], [1, 2], [true, false]]
  9574. */
  9575. function unzip(array) {
  9576. if (!(array && array.length)) {
  9577. return [];
  9578. }
  9579. var length = 0;
  9580. array = arrayFilter(array, function(group) {
  9581. if (isArrayLikeObject(group)) {
  9582. length = nativeMax(group.length, length);
  9583. return true;
  9584. }
  9585. });
  9586. return baseTimes(length, function(index) {
  9587. return arrayMap(array, baseProperty(index));
  9588. });
  9589. }
  9590. /**
  9591. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9592. * how regrouped values should be combined. The iteratee is invoked with the
  9593. * elements of each group: (...group).
  9594. *
  9595. * @static
  9596. * @memberOf _
  9597. * @since 3.8.0
  9598. * @category Array
  9599. * @param {Array} array The array of grouped elements to process.
  9600. * @param {Function} [iteratee=_.identity] The function to combine
  9601. * regrouped values.
  9602. * @returns {Array} Returns the new array of regrouped elements.
  9603. * @example
  9604. *
  9605. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9606. * // => [[1, 10, 100], [2, 20, 200]]
  9607. *
  9608. * _.unzipWith(zipped, _.add);
  9609. * // => [3, 30, 300]
  9610. */
  9611. function unzipWith(array, iteratee) {
  9612. if (!(array && array.length)) {
  9613. return [];
  9614. }
  9615. var result = unzip(array);
  9616. if (iteratee == null) {
  9617. return result;
  9618. }
  9619. return arrayMap(result, function(group) {
  9620. return apply(iteratee, undefined, group);
  9621. });
  9622. }
  9623. /**
  9624. * Creates an array excluding all given values using
  9625. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9626. * for equality comparisons.
  9627. *
  9628. * **Note:** Unlike `_.pull`, this method returns a new array.
  9629. *
  9630. * @static
  9631. * @memberOf _
  9632. * @since 0.1.0
  9633. * @category Array
  9634. * @param {Array} array The array to inspect.
  9635. * @param {...*} [values] The values to exclude.
  9636. * @returns {Array} Returns the new array of filtered values.
  9637. * @see _.difference, _.xor
  9638. * @example
  9639. *
  9640. * _.without([2, 1, 2, 3], 1, 2);
  9641. * // => [3]
  9642. */
  9643. var without = baseRest(function(array, values) {
  9644. return isArrayLikeObject(array)
  9645. ? baseDifference(array, values)
  9646. : [];
  9647. });
  9648. /**
  9649. * Creates an array of unique values that is the
  9650. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9651. * of the given arrays. The order of result values is determined by the order
  9652. * they occur in the arrays.
  9653. *
  9654. * @static
  9655. * @memberOf _
  9656. * @since 2.4.0
  9657. * @category Array
  9658. * @param {...Array} [arrays] The arrays to inspect.
  9659. * @returns {Array} Returns the new array of filtered values.
  9660. * @see _.difference, _.without
  9661. * @example
  9662. *
  9663. * _.xor([2, 1], [2, 3]);
  9664. * // => [1, 3]
  9665. */
  9666. var xor = baseRest(function(arrays) {
  9667. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9668. });
  9669. /**
  9670. * This method is like `_.xor` except that it accepts `iteratee` which is
  9671. * invoked for each element of each `arrays` to generate the criterion by
  9672. * which by which they're compared. The order of result values is determined
  9673. * by the order they occur in the arrays. The iteratee is invoked with one
  9674. * argument: (value).
  9675. *
  9676. * @static
  9677. * @memberOf _
  9678. * @since 4.0.0
  9679. * @category Array
  9680. * @param {...Array} [arrays] The arrays to inspect.
  9681. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9682. * @returns {Array} Returns the new array of filtered values.
  9683. * @example
  9684. *
  9685. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9686. * // => [1.2, 3.4]
  9687. *
  9688. * // The `_.property` iteratee shorthand.
  9689. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9690. * // => [{ 'x': 2 }]
  9691. */
  9692. var xorBy = baseRest(function(arrays) {
  9693. var iteratee = last(arrays);
  9694. if (isArrayLikeObject(iteratee)) {
  9695. iteratee = undefined;
  9696. }
  9697. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9698. });
  9699. /**
  9700. * This method is like `_.xor` except that it accepts `comparator` which is
  9701. * invoked to compare elements of `arrays`. The order of result values is
  9702. * determined by the order they occur in the arrays. The comparator is invoked
  9703. * with two arguments: (arrVal, othVal).
  9704. *
  9705. * @static
  9706. * @memberOf _
  9707. * @since 4.0.0
  9708. * @category Array
  9709. * @param {...Array} [arrays] The arrays to inspect.
  9710. * @param {Function} [comparator] The comparator invoked per element.
  9711. * @returns {Array} Returns the new array of filtered values.
  9712. * @example
  9713. *
  9714. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9715. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9716. *
  9717. * _.xorWith(objects, others, _.isEqual);
  9718. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9719. */
  9720. var xorWith = baseRest(function(arrays) {
  9721. var comparator = last(arrays);
  9722. comparator = typeof comparator == 'function' ? comparator : undefined;
  9723. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9724. });
  9725. /**
  9726. * Creates an array of grouped elements, the first of which contains the
  9727. * first elements of the given arrays, the second of which contains the
  9728. * second elements of the given arrays, and so on.
  9729. *
  9730. * @static
  9731. * @memberOf _
  9732. * @since 0.1.0
  9733. * @category Array
  9734. * @param {...Array} [arrays] The arrays to process.
  9735. * @returns {Array} Returns the new array of grouped elements.
  9736. * @example
  9737. *
  9738. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9739. * // => [['a', 1, true], ['b', 2, false]]
  9740. */
  9741. var zip = baseRest(unzip);
  9742. /**
  9743. * This method is like `_.fromPairs` except that it accepts two arrays,
  9744. * one of property identifiers and one of corresponding values.
  9745. *
  9746. * @static
  9747. * @memberOf _
  9748. * @since 0.4.0
  9749. * @category Array
  9750. * @param {Array} [props=[]] The property identifiers.
  9751. * @param {Array} [values=[]] The property values.
  9752. * @returns {Object} Returns the new object.
  9753. * @example
  9754. *
  9755. * _.zipObject(['a', 'b'], [1, 2]);
  9756. * // => { 'a': 1, 'b': 2 }
  9757. */
  9758. function zipObject(props, values) {
  9759. return baseZipObject(props || [], values || [], assignValue);
  9760. }
  9761. /**
  9762. * This method is like `_.zipObject` except that it supports property paths.
  9763. *
  9764. * @static
  9765. * @memberOf _
  9766. * @since 4.1.0
  9767. * @category Array
  9768. * @param {Array} [props=[]] The property identifiers.
  9769. * @param {Array} [values=[]] The property values.
  9770. * @returns {Object} Returns the new object.
  9771. * @example
  9772. *
  9773. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9774. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9775. */
  9776. function zipObjectDeep(props, values) {
  9777. return baseZipObject(props || [], values || [], baseSet);
  9778. }
  9779. /**
  9780. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9781. * how grouped values should be combined. The iteratee is invoked with the
  9782. * elements of each group: (...group).
  9783. *
  9784. * @static
  9785. * @memberOf _
  9786. * @since 3.8.0
  9787. * @category Array
  9788. * @param {...Array} [arrays] The arrays to process.
  9789. * @param {Function} [iteratee=_.identity] The function to combine
  9790. * grouped values.
  9791. * @returns {Array} Returns the new array of grouped elements.
  9792. * @example
  9793. *
  9794. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9795. * return a + b + c;
  9796. * });
  9797. * // => [111, 222]
  9798. */
  9799. var zipWith = baseRest(function(arrays) {
  9800. var length = arrays.length,
  9801. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9802. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9803. return unzipWith(arrays, iteratee);
  9804. });
  9805. /*------------------------------------------------------------------------*/
  9806. /**
  9807. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9808. * chain sequences enabled. The result of such sequences must be unwrapped
  9809. * with `_#value`.
  9810. *
  9811. * @static
  9812. * @memberOf _
  9813. * @since 1.3.0
  9814. * @category Seq
  9815. * @param {*} value The value to wrap.
  9816. * @returns {Object} Returns the new `lodash` wrapper instance.
  9817. * @example
  9818. *
  9819. * var users = [
  9820. * { 'user': 'barney', 'age': 36 },
  9821. * { 'user': 'fred', 'age': 40 },
  9822. * { 'user': 'pebbles', 'age': 1 }
  9823. * ];
  9824. *
  9825. * var youngest = _
  9826. * .chain(users)
  9827. * .sortBy('age')
  9828. * .map(function(o) {
  9829. * return o.user + ' is ' + o.age;
  9830. * })
  9831. * .head()
  9832. * .value();
  9833. * // => 'pebbles is 1'
  9834. */
  9835. function chain(value) {
  9836. var result = lodash(value);
  9837. result.__chain__ = true;
  9838. return result;
  9839. }
  9840. /**
  9841. * This method invokes `interceptor` and returns `value`. The interceptor
  9842. * is invoked with one argument; (value). The purpose of this method is to
  9843. * "tap into" a method chain sequence in order to modify intermediate results.
  9844. *
  9845. * @static
  9846. * @memberOf _
  9847. * @since 0.1.0
  9848. * @category Seq
  9849. * @param {*} value The value to provide to `interceptor`.
  9850. * @param {Function} interceptor The function to invoke.
  9851. * @returns {*} Returns `value`.
  9852. * @example
  9853. *
  9854. * _([1, 2, 3])
  9855. * .tap(function(array) {
  9856. * // Mutate input array.
  9857. * array.pop();
  9858. * })
  9859. * .reverse()
  9860. * .value();
  9861. * // => [2, 1]
  9862. */
  9863. function tap(value, interceptor) {
  9864. interceptor(value);
  9865. return value;
  9866. }
  9867. /**
  9868. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9869. * The purpose of this method is to "pass thru" values replacing intermediate
  9870. * results in a method chain sequence.
  9871. *
  9872. * @static
  9873. * @memberOf _
  9874. * @since 3.0.0
  9875. * @category Seq
  9876. * @param {*} value The value to provide to `interceptor`.
  9877. * @param {Function} interceptor The function to invoke.
  9878. * @returns {*} Returns the result of `interceptor`.
  9879. * @example
  9880. *
  9881. * _(' abc ')
  9882. * .chain()
  9883. * .trim()
  9884. * .thru(function(value) {
  9885. * return [value];
  9886. * })
  9887. * .value();
  9888. * // => ['abc']
  9889. */
  9890. function thru(value, interceptor) {
  9891. return interceptor(value);
  9892. }
  9893. /**
  9894. * This method is the wrapper version of `_.at`.
  9895. *
  9896. * @name at
  9897. * @memberOf _
  9898. * @since 1.0.0
  9899. * @category Seq
  9900. * @param {...(string|string[])} [paths] The property paths to pick.
  9901. * @returns {Object} Returns the new `lodash` wrapper instance.
  9902. * @example
  9903. *
  9904. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9905. *
  9906. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9907. * // => [3, 4]
  9908. */
  9909. var wrapperAt = flatRest(function(paths) {
  9910. var length = paths.length,
  9911. start = length ? paths[0] : 0,
  9912. value = this.__wrapped__,
  9913. interceptor = function(object) { return baseAt(object, paths); };
  9914. if (length > 1 || this.__actions__.length ||
  9915. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9916. return this.thru(interceptor);
  9917. }
  9918. value = value.slice(start, +start + (length ? 1 : 0));
  9919. value.__actions__.push({
  9920. 'func': thru,
  9921. 'args': [interceptor],
  9922. 'thisArg': undefined
  9923. });
  9924. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9925. if (length && !array.length) {
  9926. array.push(undefined);
  9927. }
  9928. return array;
  9929. });
  9930. });
  9931. /**
  9932. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9933. *
  9934. * @name chain
  9935. * @memberOf _
  9936. * @since 0.1.0
  9937. * @category Seq
  9938. * @returns {Object} Returns the new `lodash` wrapper instance.
  9939. * @example
  9940. *
  9941. * var users = [
  9942. * { 'user': 'barney', 'age': 36 },
  9943. * { 'user': 'fred', 'age': 40 }
  9944. * ];
  9945. *
  9946. * // A sequence without explicit chaining.
  9947. * _(users).head();
  9948. * // => { 'user': 'barney', 'age': 36 }
  9949. *
  9950. * // A sequence with explicit chaining.
  9951. * _(users)
  9952. * .chain()
  9953. * .head()
  9954. * .pick('user')
  9955. * .value();
  9956. * // => { 'user': 'barney' }
  9957. */
  9958. function wrapperChain() {
  9959. return chain(this);
  9960. }
  9961. /**
  9962. * Executes the chain sequence and returns the wrapped result.
  9963. *
  9964. * @name commit
  9965. * @memberOf _
  9966. * @since 3.2.0
  9967. * @category Seq
  9968. * @returns {Object} Returns the new `lodash` wrapper instance.
  9969. * @example
  9970. *
  9971. * var array = [1, 2];
  9972. * var wrapped = _(array).push(3);
  9973. *
  9974. * console.log(array);
  9975. * // => [1, 2]
  9976. *
  9977. * wrapped = wrapped.commit();
  9978. * console.log(array);
  9979. * // => [1, 2, 3]
  9980. *
  9981. * wrapped.last();
  9982. * // => 3
  9983. *
  9984. * console.log(array);
  9985. * // => [1, 2, 3]
  9986. */
  9987. function wrapperCommit() {
  9988. return new LodashWrapper(this.value(), this.__chain__);
  9989. }
  9990. /**
  9991. * Gets the next value on a wrapped object following the
  9992. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9993. *
  9994. * @name next
  9995. * @memberOf _
  9996. * @since 4.0.0
  9997. * @category Seq
  9998. * @returns {Object} Returns the next iterator value.
  9999. * @example
  10000. *
  10001. * var wrapped = _([1, 2]);
  10002. *
  10003. * wrapped.next();
  10004. * // => { 'done': false, 'value': 1 }
  10005. *
  10006. * wrapped.next();
  10007. * // => { 'done': false, 'value': 2 }
  10008. *
  10009. * wrapped.next();
  10010. * // => { 'done': true, 'value': undefined }
  10011. */
  10012. function wrapperNext() {
  10013. if (this.__values__ === undefined) {
  10014. this.__values__ = toArray(this.value());
  10015. }
  10016. var done = this.__index__ >= this.__values__.length,
  10017. value = done ? undefined : this.__values__[this.__index__++];
  10018. return { 'done': done, 'value': value };
  10019. }
  10020. /**
  10021. * Enables the wrapper to be iterable.
  10022. *
  10023. * @name Symbol.iterator
  10024. * @memberOf _
  10025. * @since 4.0.0
  10026. * @category Seq
  10027. * @returns {Object} Returns the wrapper object.
  10028. * @example
  10029. *
  10030. * var wrapped = _([1, 2]);
  10031. *
  10032. * wrapped[Symbol.iterator]() === wrapped;
  10033. * // => true
  10034. *
  10035. * Array.from(wrapped);
  10036. * // => [1, 2]
  10037. */
  10038. function wrapperToIterator() {
  10039. return this;
  10040. }
  10041. /**
  10042. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  10043. *
  10044. * @name plant
  10045. * @memberOf _
  10046. * @since 3.2.0
  10047. * @category Seq
  10048. * @param {*} value The value to plant.
  10049. * @returns {Object} Returns the new `lodash` wrapper instance.
  10050. * @example
  10051. *
  10052. * function square(n) {
  10053. * return n * n;
  10054. * }
  10055. *
  10056. * var wrapped = _([1, 2]).map(square);
  10057. * var other = wrapped.plant([3, 4]);
  10058. *
  10059. * other.value();
  10060. * // => [9, 16]
  10061. *
  10062. * wrapped.value();
  10063. * // => [1, 4]
  10064. */
  10065. function wrapperPlant(value) {
  10066. var result,
  10067. parent = this;
  10068. while (parent instanceof baseLodash) {
  10069. var clone = wrapperClone(parent);
  10070. clone.__index__ = 0;
  10071. clone.__values__ = undefined;
  10072. if (result) {
  10073. previous.__wrapped__ = clone;
  10074. } else {
  10075. result = clone;
  10076. }
  10077. var previous = clone;
  10078. parent = parent.__wrapped__;
  10079. }
  10080. previous.__wrapped__ = value;
  10081. return result;
  10082. }
  10083. /**
  10084. * This method is the wrapper version of `_.reverse`.
  10085. *
  10086. * **Note:** This method mutates the wrapped array.
  10087. *
  10088. * @name reverse
  10089. * @memberOf _
  10090. * @since 0.1.0
  10091. * @category Seq
  10092. * @returns {Object} Returns the new `lodash` wrapper instance.
  10093. * @example
  10094. *
  10095. * var array = [1, 2, 3];
  10096. *
  10097. * _(array).reverse().value()
  10098. * // => [3, 2, 1]
  10099. *
  10100. * console.log(array);
  10101. * // => [3, 2, 1]
  10102. */
  10103. function wrapperReverse() {
  10104. var value = this.__wrapped__;
  10105. if (value instanceof LazyWrapper) {
  10106. var wrapped = value;
  10107. if (this.__actions__.length) {
  10108. wrapped = new LazyWrapper(this);
  10109. }
  10110. wrapped = wrapped.reverse();
  10111. wrapped.__actions__.push({
  10112. 'func': thru,
  10113. 'args': [reverse],
  10114. 'thisArg': undefined
  10115. });
  10116. return new LodashWrapper(wrapped, this.__chain__);
  10117. }
  10118. return this.thru(reverse);
  10119. }
  10120. /**
  10121. * Executes the chain sequence to resolve the unwrapped value.
  10122. *
  10123. * @name value
  10124. * @memberOf _
  10125. * @since 0.1.0
  10126. * @alias toJSON, valueOf
  10127. * @category Seq
  10128. * @returns {*} Returns the resolved unwrapped value.
  10129. * @example
  10130. *
  10131. * _([1, 2, 3]).value();
  10132. * // => [1, 2, 3]
  10133. */
  10134. function wrapperValue() {
  10135. return baseWrapperValue(this.__wrapped__, this.__actions__);
  10136. }
  10137. /*------------------------------------------------------------------------*/
  10138. /**
  10139. * Creates an object composed of keys generated from the results of running
  10140. * each element of `collection` thru `iteratee`. The corresponding value of
  10141. * each key is the number of times the key was returned by `iteratee`. The
  10142. * iteratee is invoked with one argument: (value).
  10143. *
  10144. * @static
  10145. * @memberOf _
  10146. * @since 0.5.0
  10147. * @category Collection
  10148. * @param {Array|Object} collection The collection to iterate over.
  10149. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10150. * @returns {Object} Returns the composed aggregate object.
  10151. * @example
  10152. *
  10153. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  10154. * // => { '4': 1, '6': 2 }
  10155. *
  10156. * // The `_.property` iteratee shorthand.
  10157. * _.countBy(['one', 'two', 'three'], 'length');
  10158. * // => { '3': 2, '5': 1 }
  10159. */
  10160. var countBy = createAggregator(function(result, value, key) {
  10161. if (hasOwnProperty.call(result, key)) {
  10162. ++result[key];
  10163. } else {
  10164. baseAssignValue(result, key, 1);
  10165. }
  10166. });
  10167. /**
  10168. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  10169. * Iteration is stopped once `predicate` returns falsey. The predicate is
  10170. * invoked with three arguments: (value, index|key, collection).
  10171. *
  10172. * **Note:** This method returns `true` for
  10173. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  10174. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  10175. * elements of empty collections.
  10176. *
  10177. * @static
  10178. * @memberOf _
  10179. * @since 0.1.0
  10180. * @category Collection
  10181. * @param {Array|Object} collection The collection to iterate over.
  10182. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10183. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10184. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  10185. * else `false`.
  10186. * @example
  10187. *
  10188. * _.every([true, 1, null, 'yes'], Boolean);
  10189. * // => false
  10190. *
  10191. * var users = [
  10192. * { 'user': 'barney', 'age': 36, 'active': false },
  10193. * { 'user': 'fred', 'age': 40, 'active': false }
  10194. * ];
  10195. *
  10196. * // The `_.matches` iteratee shorthand.
  10197. * _.every(users, { 'user': 'barney', 'active': false });
  10198. * // => false
  10199. *
  10200. * // The `_.matchesProperty` iteratee shorthand.
  10201. * _.every(users, ['active', false]);
  10202. * // => true
  10203. *
  10204. * // The `_.property` iteratee shorthand.
  10205. * _.every(users, 'active');
  10206. * // => false
  10207. */
  10208. function every(collection, predicate, guard) {
  10209. var func = isArray(collection) ? arrayEvery : baseEvery;
  10210. if (guard && isIterateeCall(collection, predicate, guard)) {
  10211. predicate = undefined;
  10212. }
  10213. return func(collection, getIteratee(predicate, 3));
  10214. }
  10215. /**
  10216. * Iterates over elements of `collection`, returning an array of all elements
  10217. * `predicate` returns truthy for. The predicate is invoked with three
  10218. * arguments: (value, index|key, collection).
  10219. *
  10220. * **Note:** Unlike `_.remove`, this method returns a new array.
  10221. *
  10222. * @static
  10223. * @memberOf _
  10224. * @since 0.1.0
  10225. * @category Collection
  10226. * @param {Array|Object} collection The collection to iterate over.
  10227. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10228. * @returns {Array} Returns the new filtered array.
  10229. * @see _.reject
  10230. * @example
  10231. *
  10232. * var users = [
  10233. * { 'user': 'barney', 'age': 36, 'active': true },
  10234. * { 'user': 'fred', 'age': 40, 'active': false }
  10235. * ];
  10236. *
  10237. * _.filter(users, function(o) { return !o.active; });
  10238. * // => objects for ['fred']
  10239. *
  10240. * // The `_.matches` iteratee shorthand.
  10241. * _.filter(users, { 'age': 36, 'active': true });
  10242. * // => objects for ['barney']
  10243. *
  10244. * // The `_.matchesProperty` iteratee shorthand.
  10245. * _.filter(users, ['active', false]);
  10246. * // => objects for ['fred']
  10247. *
  10248. * // The `_.property` iteratee shorthand.
  10249. * _.filter(users, 'active');
  10250. * // => objects for ['barney']
  10251. *
  10252. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  10253. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  10254. * // => objects for ['fred', 'barney']
  10255. */
  10256. function filter(collection, predicate) {
  10257. var func = isArray(collection) ? arrayFilter : baseFilter;
  10258. return func(collection, getIteratee(predicate, 3));
  10259. }
  10260. /**
  10261. * Iterates over elements of `collection`, returning the first element
  10262. * `predicate` returns truthy for. The predicate is invoked with three
  10263. * arguments: (value, index|key, collection).
  10264. *
  10265. * @static
  10266. * @memberOf _
  10267. * @since 0.1.0
  10268. * @category Collection
  10269. * @param {Array|Object} collection The collection to inspect.
  10270. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10271. * @param {number} [fromIndex=0] The index to search from.
  10272. * @returns {*} Returns the matched element, else `undefined`.
  10273. * @example
  10274. *
  10275. * var users = [
  10276. * { 'user': 'barney', 'age': 36, 'active': true },
  10277. * { 'user': 'fred', 'age': 40, 'active': false },
  10278. * { 'user': 'pebbles', 'age': 1, 'active': true }
  10279. * ];
  10280. *
  10281. * _.find(users, function(o) { return o.age < 40; });
  10282. * // => object for 'barney'
  10283. *
  10284. * // The `_.matches` iteratee shorthand.
  10285. * _.find(users, { 'age': 1, 'active': true });
  10286. * // => object for 'pebbles'
  10287. *
  10288. * // The `_.matchesProperty` iteratee shorthand.
  10289. * _.find(users, ['active', false]);
  10290. * // => object for 'fred'
  10291. *
  10292. * // The `_.property` iteratee shorthand.
  10293. * _.find(users, 'active');
  10294. * // => object for 'barney'
  10295. */
  10296. var find = createFind(findIndex);
  10297. /**
  10298. * This method is like `_.find` except that it iterates over elements of
  10299. * `collection` from right to left.
  10300. *
  10301. * @static
  10302. * @memberOf _
  10303. * @since 2.0.0
  10304. * @category Collection
  10305. * @param {Array|Object} collection The collection to inspect.
  10306. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10307. * @param {number} [fromIndex=collection.length-1] The index to search from.
  10308. * @returns {*} Returns the matched element, else `undefined`.
  10309. * @example
  10310. *
  10311. * _.findLast([1, 2, 3, 4], function(n) {
  10312. * return n % 2 == 1;
  10313. * });
  10314. * // => 3
  10315. */
  10316. var findLast = createFind(findLastIndex);
  10317. /**
  10318. * Creates a flattened array of values by running each element in `collection`
  10319. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  10320. * with three arguments: (value, index|key, collection).
  10321. *
  10322. * @static
  10323. * @memberOf _
  10324. * @since 4.0.0
  10325. * @category Collection
  10326. * @param {Array|Object} collection The collection to iterate over.
  10327. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10328. * @returns {Array} Returns the new flattened array.
  10329. * @example
  10330. *
  10331. * function duplicate(n) {
  10332. * return [n, n];
  10333. * }
  10334. *
  10335. * _.flatMap([1, 2], duplicate);
  10336. * // => [1, 1, 2, 2]
  10337. */
  10338. function flatMap(collection, iteratee) {
  10339. return baseFlatten(map(collection, iteratee), 1);
  10340. }
  10341. /**
  10342. * This method is like `_.flatMap` except that it recursively flattens the
  10343. * mapped results.
  10344. *
  10345. * @static
  10346. * @memberOf _
  10347. * @since 4.7.0
  10348. * @category Collection
  10349. * @param {Array|Object} collection The collection to iterate over.
  10350. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10351. * @returns {Array} Returns the new flattened array.
  10352. * @example
  10353. *
  10354. * function duplicate(n) {
  10355. * return [[[n, n]]];
  10356. * }
  10357. *
  10358. * _.flatMapDeep([1, 2], duplicate);
  10359. * // => [1, 1, 2, 2]
  10360. */
  10361. function flatMapDeep(collection, iteratee) {
  10362. return baseFlatten(map(collection, iteratee), INFINITY);
  10363. }
  10364. /**
  10365. * This method is like `_.flatMap` except that it recursively flattens the
  10366. * mapped results up to `depth` times.
  10367. *
  10368. * @static
  10369. * @memberOf _
  10370. * @since 4.7.0
  10371. * @category Collection
  10372. * @param {Array|Object} collection The collection to iterate over.
  10373. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10374. * @param {number} [depth=1] The maximum recursion depth.
  10375. * @returns {Array} Returns the new flattened array.
  10376. * @example
  10377. *
  10378. * function duplicate(n) {
  10379. * return [[[n, n]]];
  10380. * }
  10381. *
  10382. * _.flatMapDepth([1, 2], duplicate, 2);
  10383. * // => [[1, 1], [2, 2]]
  10384. */
  10385. function flatMapDepth(collection, iteratee, depth) {
  10386. depth = depth === undefined ? 1 : toInteger(depth);
  10387. return baseFlatten(map(collection, iteratee), depth);
  10388. }
  10389. /**
  10390. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10391. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10392. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10393. *
  10394. * **Note:** As with other "Collections" methods, objects with a "length"
  10395. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10396. * or `_.forOwn` for object iteration.
  10397. *
  10398. * @static
  10399. * @memberOf _
  10400. * @since 0.1.0
  10401. * @alias each
  10402. * @category Collection
  10403. * @param {Array|Object} collection The collection to iterate over.
  10404. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10405. * @returns {Array|Object} Returns `collection`.
  10406. * @see _.forEachRight
  10407. * @example
  10408. *
  10409. * _.forEach([1, 2], function(value) {
  10410. * console.log(value);
  10411. * });
  10412. * // => Logs `1` then `2`.
  10413. *
  10414. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10415. * console.log(key);
  10416. * });
  10417. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10418. */
  10419. function forEach(collection, iteratee) {
  10420. var func = isArray(collection) ? arrayEach : baseEach;
  10421. return func(collection, getIteratee(iteratee, 3));
  10422. }
  10423. /**
  10424. * This method is like `_.forEach` except that it iterates over elements of
  10425. * `collection` from right to left.
  10426. *
  10427. * @static
  10428. * @memberOf _
  10429. * @since 2.0.0
  10430. * @alias eachRight
  10431. * @category Collection
  10432. * @param {Array|Object} collection The collection to iterate over.
  10433. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10434. * @returns {Array|Object} Returns `collection`.
  10435. * @see _.forEach
  10436. * @example
  10437. *
  10438. * _.forEachRight([1, 2], function(value) {
  10439. * console.log(value);
  10440. * });
  10441. * // => Logs `2` then `1`.
  10442. */
  10443. function forEachRight(collection, iteratee) {
  10444. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10445. return func(collection, getIteratee(iteratee, 3));
  10446. }
  10447. /**
  10448. * Creates an object composed of keys generated from the results of running
  10449. * each element of `collection` thru `iteratee`. The order of grouped values
  10450. * is determined by the order they occur in `collection`. The corresponding
  10451. * value of each key is an array of elements responsible for generating the
  10452. * key. The iteratee is invoked with one argument: (value).
  10453. *
  10454. * @static
  10455. * @memberOf _
  10456. * @since 0.1.0
  10457. * @category Collection
  10458. * @param {Array|Object} collection The collection to iterate over.
  10459. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10460. * @returns {Object} Returns the composed aggregate object.
  10461. * @example
  10462. *
  10463. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10464. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10465. *
  10466. * // The `_.property` iteratee shorthand.
  10467. * _.groupBy(['one', 'two', 'three'], 'length');
  10468. * // => { '3': ['one', 'two'], '5': ['three'] }
  10469. */
  10470. var groupBy = createAggregator(function(result, value, key) {
  10471. if (hasOwnProperty.call(result, key)) {
  10472. result[key].push(value);
  10473. } else {
  10474. baseAssignValue(result, key, [value]);
  10475. }
  10476. });
  10477. /**
  10478. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10479. * checked for a substring of `value`, otherwise
  10480. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10481. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10482. * the offset from the end of `collection`.
  10483. *
  10484. * @static
  10485. * @memberOf _
  10486. * @since 0.1.0
  10487. * @category Collection
  10488. * @param {Array|Object|string} collection The collection to inspect.
  10489. * @param {*} value The value to search for.
  10490. * @param {number} [fromIndex=0] The index to search from.
  10491. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10492. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10493. * @example
  10494. *
  10495. * _.includes([1, 2, 3], 1);
  10496. * // => true
  10497. *
  10498. * _.includes([1, 2, 3], 1, 2);
  10499. * // => false
  10500. *
  10501. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10502. * // => true
  10503. *
  10504. * _.includes('abcd', 'bc');
  10505. * // => true
  10506. */
  10507. function includes(collection, value, fromIndex, guard) {
  10508. collection = isArrayLike(collection) ? collection : values(collection);
  10509. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10510. var length = collection.length;
  10511. if (fromIndex < 0) {
  10512. fromIndex = nativeMax(length + fromIndex, 0);
  10513. }
  10514. return isString(collection)
  10515. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10516. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10517. }
  10518. /**
  10519. * Invokes the method at `path` of each element in `collection`, returning
  10520. * an array of the results of each invoked method. Any additional arguments
  10521. * are provided to each invoked method. If `path` is a function, it's invoked
  10522. * for, and `this` bound to, each element in `collection`.
  10523. *
  10524. * @static
  10525. * @memberOf _
  10526. * @since 4.0.0
  10527. * @category Collection
  10528. * @param {Array|Object} collection The collection to iterate over.
  10529. * @param {Array|Function|string} path The path of the method to invoke or
  10530. * the function invoked per iteration.
  10531. * @param {...*} [args] The arguments to invoke each method with.
  10532. * @returns {Array} Returns the array of results.
  10533. * @example
  10534. *
  10535. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10536. * // => [[1, 5, 7], [1, 2, 3]]
  10537. *
  10538. * _.invokeMap([123, 456], String.prototype.split, '');
  10539. * // => [['1', '2', '3'], ['4', '5', '6']]
  10540. */
  10541. var invokeMap = baseRest(function(collection, path, args) {
  10542. var index = -1,
  10543. isFunc = typeof path == 'function',
  10544. result = isArrayLike(collection) ? Array(collection.length) : [];
  10545. baseEach(collection, function(value) {
  10546. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10547. });
  10548. return result;
  10549. });
  10550. /**
  10551. * Creates an object composed of keys generated from the results of running
  10552. * each element of `collection` thru `iteratee`. The corresponding value of
  10553. * each key is the last element responsible for generating the key. The
  10554. * iteratee is invoked with one argument: (value).
  10555. *
  10556. * @static
  10557. * @memberOf _
  10558. * @since 4.0.0
  10559. * @category Collection
  10560. * @param {Array|Object} collection The collection to iterate over.
  10561. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10562. * @returns {Object} Returns the composed aggregate object.
  10563. * @example
  10564. *
  10565. * var array = [
  10566. * { 'dir': 'left', 'code': 97 },
  10567. * { 'dir': 'right', 'code': 100 }
  10568. * ];
  10569. *
  10570. * _.keyBy(array, function(o) {
  10571. * return String.fromCharCode(o.code);
  10572. * });
  10573. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10574. *
  10575. * _.keyBy(array, 'dir');
  10576. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10577. */
  10578. var keyBy = createAggregator(function(result, value, key) {
  10579. baseAssignValue(result, key, value);
  10580. });
  10581. /**
  10582. * Creates an array of values by running each element in `collection` thru
  10583. * `iteratee`. The iteratee is invoked with three arguments:
  10584. * (value, index|key, collection).
  10585. *
  10586. * Many lodash methods are guarded to work as iteratees for methods like
  10587. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10588. *
  10589. * The guarded methods are:
  10590. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10591. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10592. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10593. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10594. *
  10595. * @static
  10596. * @memberOf _
  10597. * @since 0.1.0
  10598. * @category Collection
  10599. * @param {Array|Object} collection The collection to iterate over.
  10600. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10601. * @returns {Array} Returns the new mapped array.
  10602. * @example
  10603. *
  10604. * function square(n) {
  10605. * return n * n;
  10606. * }
  10607. *
  10608. * _.map([4, 8], square);
  10609. * // => [16, 64]
  10610. *
  10611. * _.map({ 'a': 4, 'b': 8 }, square);
  10612. * // => [16, 64] (iteration order is not guaranteed)
  10613. *
  10614. * var users = [
  10615. * { 'user': 'barney' },
  10616. * { 'user': 'fred' }
  10617. * ];
  10618. *
  10619. * // The `_.property` iteratee shorthand.
  10620. * _.map(users, 'user');
  10621. * // => ['barney', 'fred']
  10622. */
  10623. function map(collection, iteratee) {
  10624. var func = isArray(collection) ? arrayMap : baseMap;
  10625. return func(collection, getIteratee(iteratee, 3));
  10626. }
  10627. /**
  10628. * This method is like `_.sortBy` except that it allows specifying the sort
  10629. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10630. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10631. * descending or "asc" for ascending sort order of corresponding values.
  10632. *
  10633. * @static
  10634. * @memberOf _
  10635. * @since 4.0.0
  10636. * @category Collection
  10637. * @param {Array|Object} collection The collection to iterate over.
  10638. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10639. * The iteratees to sort by.
  10640. * @param {string[]} [orders] The sort orders of `iteratees`.
  10641. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10642. * @returns {Array} Returns the new sorted array.
  10643. * @example
  10644. *
  10645. * var users = [
  10646. * { 'user': 'fred', 'age': 48 },
  10647. * { 'user': 'barney', 'age': 34 },
  10648. * { 'user': 'fred', 'age': 40 },
  10649. * { 'user': 'barney', 'age': 36 }
  10650. * ];
  10651. *
  10652. * // Sort by `user` in ascending order and by `age` in descending order.
  10653. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10654. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10655. */
  10656. function orderBy(collection, iteratees, orders, guard) {
  10657. if (collection == null) {
  10658. return [];
  10659. }
  10660. if (!isArray(iteratees)) {
  10661. iteratees = iteratees == null ? [] : [iteratees];
  10662. }
  10663. orders = guard ? undefined : orders;
  10664. if (!isArray(orders)) {
  10665. orders = orders == null ? [] : [orders];
  10666. }
  10667. return baseOrderBy(collection, iteratees, orders);
  10668. }
  10669. /**
  10670. * Creates an array of elements split into two groups, the first of which
  10671. * contains elements `predicate` returns truthy for, the second of which
  10672. * contains elements `predicate` returns falsey for. The predicate is
  10673. * invoked with one argument: (value).
  10674. *
  10675. * @static
  10676. * @memberOf _
  10677. * @since 3.0.0
  10678. * @category Collection
  10679. * @param {Array|Object} collection The collection to iterate over.
  10680. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10681. * @returns {Array} Returns the array of grouped elements.
  10682. * @example
  10683. *
  10684. * var users = [
  10685. * { 'user': 'barney', 'age': 36, 'active': false },
  10686. * { 'user': 'fred', 'age': 40, 'active': true },
  10687. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10688. * ];
  10689. *
  10690. * _.partition(users, function(o) { return o.active; });
  10691. * // => objects for [['fred'], ['barney', 'pebbles']]
  10692. *
  10693. * // The `_.matches` iteratee shorthand.
  10694. * _.partition(users, { 'age': 1, 'active': false });
  10695. * // => objects for [['pebbles'], ['barney', 'fred']]
  10696. *
  10697. * // The `_.matchesProperty` iteratee shorthand.
  10698. * _.partition(users, ['active', false]);
  10699. * // => objects for [['barney', 'pebbles'], ['fred']]
  10700. *
  10701. * // The `_.property` iteratee shorthand.
  10702. * _.partition(users, 'active');
  10703. * // => objects for [['fred'], ['barney', 'pebbles']]
  10704. */
  10705. var partition = createAggregator(function(result, value, key) {
  10706. result[key ? 0 : 1].push(value);
  10707. }, function() { return [[], []]; });
  10708. /**
  10709. * Reduces `collection` to a value which is the accumulated result of running
  10710. * each element in `collection` thru `iteratee`, where each successive
  10711. * invocation is supplied the return value of the previous. If `accumulator`
  10712. * is not given, the first element of `collection` is used as the initial
  10713. * value. The iteratee is invoked with four arguments:
  10714. * (accumulator, value, index|key, collection).
  10715. *
  10716. * Many lodash methods are guarded to work as iteratees for methods like
  10717. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10718. *
  10719. * The guarded methods are:
  10720. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10721. * and `sortBy`
  10722. *
  10723. * @static
  10724. * @memberOf _
  10725. * @since 0.1.0
  10726. * @category Collection
  10727. * @param {Array|Object} collection The collection to iterate over.
  10728. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10729. * @param {*} [accumulator] The initial value.
  10730. * @returns {*} Returns the accumulated value.
  10731. * @see _.reduceRight
  10732. * @example
  10733. *
  10734. * _.reduce([1, 2], function(sum, n) {
  10735. * return sum + n;
  10736. * }, 0);
  10737. * // => 3
  10738. *
  10739. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10740. * (result[value] || (result[value] = [])).push(key);
  10741. * return result;
  10742. * }, {});
  10743. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10744. */
  10745. function reduce(collection, iteratee, accumulator) {
  10746. var func = isArray(collection) ? arrayReduce : baseReduce,
  10747. initAccum = arguments.length < 3;
  10748. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10749. }
  10750. /**
  10751. * This method is like `_.reduce` except that it iterates over elements of
  10752. * `collection` from right to left.
  10753. *
  10754. * @static
  10755. * @memberOf _
  10756. * @since 0.1.0
  10757. * @category Collection
  10758. * @param {Array|Object} collection The collection to iterate over.
  10759. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10760. * @param {*} [accumulator] The initial value.
  10761. * @returns {*} Returns the accumulated value.
  10762. * @see _.reduce
  10763. * @example
  10764. *
  10765. * var array = [[0, 1], [2, 3], [4, 5]];
  10766. *
  10767. * _.reduceRight(array, function(flattened, other) {
  10768. * return flattened.concat(other);
  10769. * }, []);
  10770. * // => [4, 5, 2, 3, 0, 1]
  10771. */
  10772. function reduceRight(collection, iteratee, accumulator) {
  10773. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10774. initAccum = arguments.length < 3;
  10775. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10776. }
  10777. /**
  10778. * The opposite of `_.filter`; this method returns the elements of `collection`
  10779. * that `predicate` does **not** return truthy for.
  10780. *
  10781. * @static
  10782. * @memberOf _
  10783. * @since 0.1.0
  10784. * @category Collection
  10785. * @param {Array|Object} collection The collection to iterate over.
  10786. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10787. * @returns {Array} Returns the new filtered array.
  10788. * @see _.filter
  10789. * @example
  10790. *
  10791. * var users = [
  10792. * { 'user': 'barney', 'age': 36, 'active': false },
  10793. * { 'user': 'fred', 'age': 40, 'active': true }
  10794. * ];
  10795. *
  10796. * _.reject(users, function(o) { return !o.active; });
  10797. * // => objects for ['fred']
  10798. *
  10799. * // The `_.matches` iteratee shorthand.
  10800. * _.reject(users, { 'age': 40, 'active': true });
  10801. * // => objects for ['barney']
  10802. *
  10803. * // The `_.matchesProperty` iteratee shorthand.
  10804. * _.reject(users, ['active', false]);
  10805. * // => objects for ['fred']
  10806. *
  10807. * // The `_.property` iteratee shorthand.
  10808. * _.reject(users, 'active');
  10809. * // => objects for ['barney']
  10810. */
  10811. function reject(collection, predicate) {
  10812. var func = isArray(collection) ? arrayFilter : baseFilter;
  10813. return func(collection, negate(getIteratee(predicate, 3)));
  10814. }
  10815. /**
  10816. * Gets a random element from `collection`.
  10817. *
  10818. * @static
  10819. * @memberOf _
  10820. * @since 2.0.0
  10821. * @category Collection
  10822. * @param {Array|Object} collection The collection to sample.
  10823. * @returns {*} Returns the random element.
  10824. * @example
  10825. *
  10826. * _.sample([1, 2, 3, 4]);
  10827. * // => 2
  10828. */
  10829. function sample(collection) {
  10830. var func = isArray(collection) ? arraySample : baseSample;
  10831. return func(collection);
  10832. }
  10833. /**
  10834. * Gets `n` random elements at unique keys from `collection` up to the
  10835. * size of `collection`.
  10836. *
  10837. * @static
  10838. * @memberOf _
  10839. * @since 4.0.0
  10840. * @category Collection
  10841. * @param {Array|Object} collection The collection to sample.
  10842. * @param {number} [n=1] The number of elements to sample.
  10843. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10844. * @returns {Array} Returns the random elements.
  10845. * @example
  10846. *
  10847. * _.sampleSize([1, 2, 3], 2);
  10848. * // => [3, 1]
  10849. *
  10850. * _.sampleSize([1, 2, 3], 4);
  10851. * // => [2, 3, 1]
  10852. */
  10853. function sampleSize(collection, n, guard) {
  10854. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10855. n = 1;
  10856. } else {
  10857. n = toInteger(n);
  10858. }
  10859. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10860. return func(collection, n);
  10861. }
  10862. /**
  10863. * Creates an array of shuffled values, using a version of the
  10864. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10865. *
  10866. * @static
  10867. * @memberOf _
  10868. * @since 0.1.0
  10869. * @category Collection
  10870. * @param {Array|Object} collection The collection to shuffle.
  10871. * @returns {Array} Returns the new shuffled array.
  10872. * @example
  10873. *
  10874. * _.shuffle([1, 2, 3, 4]);
  10875. * // => [4, 1, 3, 2]
  10876. */
  10877. function shuffle(collection) {
  10878. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10879. return func(collection);
  10880. }
  10881. /**
  10882. * Gets the size of `collection` by returning its length for array-like
  10883. * values or the number of own enumerable string keyed properties for objects.
  10884. *
  10885. * @static
  10886. * @memberOf _
  10887. * @since 0.1.0
  10888. * @category Collection
  10889. * @param {Array|Object|string} collection The collection to inspect.
  10890. * @returns {number} Returns the collection size.
  10891. * @example
  10892. *
  10893. * _.size([1, 2, 3]);
  10894. * // => 3
  10895. *
  10896. * _.size({ 'a': 1, 'b': 2 });
  10897. * // => 2
  10898. *
  10899. * _.size('pebbles');
  10900. * // => 7
  10901. */
  10902. function size(collection) {
  10903. if (collection == null) {
  10904. return 0;
  10905. }
  10906. if (isArrayLike(collection)) {
  10907. return isString(collection) ? stringSize(collection) : collection.length;
  10908. }
  10909. var tag = getTag(collection);
  10910. if (tag == mapTag || tag == setTag) {
  10911. return collection.size;
  10912. }
  10913. return baseKeys(collection).length;
  10914. }
  10915. /**
  10916. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10917. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10918. * invoked with three arguments: (value, index|key, collection).
  10919. *
  10920. * @static
  10921. * @memberOf _
  10922. * @since 0.1.0
  10923. * @category Collection
  10924. * @param {Array|Object} collection The collection to iterate over.
  10925. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10926. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10927. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10928. * else `false`.
  10929. * @example
  10930. *
  10931. * _.some([null, 0, 'yes', false], Boolean);
  10932. * // => true
  10933. *
  10934. * var users = [
  10935. * { 'user': 'barney', 'active': true },
  10936. * { 'user': 'fred', 'active': false }
  10937. * ];
  10938. *
  10939. * // The `_.matches` iteratee shorthand.
  10940. * _.some(users, { 'user': 'barney', 'active': false });
  10941. * // => false
  10942. *
  10943. * // The `_.matchesProperty` iteratee shorthand.
  10944. * _.some(users, ['active', false]);
  10945. * // => true
  10946. *
  10947. * // The `_.property` iteratee shorthand.
  10948. * _.some(users, 'active');
  10949. * // => true
  10950. */
  10951. function some(collection, predicate, guard) {
  10952. var func = isArray(collection) ? arraySome : baseSome;
  10953. if (guard && isIterateeCall(collection, predicate, guard)) {
  10954. predicate = undefined;
  10955. }
  10956. return func(collection, getIteratee(predicate, 3));
  10957. }
  10958. /**
  10959. * Creates an array of elements, sorted in ascending order by the results of
  10960. * running each element in a collection thru each iteratee. This method
  10961. * performs a stable sort, that is, it preserves the original sort order of
  10962. * equal elements. The iteratees are invoked with one argument: (value).
  10963. *
  10964. * @static
  10965. * @memberOf _
  10966. * @since 0.1.0
  10967. * @category Collection
  10968. * @param {Array|Object} collection The collection to iterate over.
  10969. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10970. * The iteratees to sort by.
  10971. * @returns {Array} Returns the new sorted array.
  10972. * @example
  10973. *
  10974. * var users = [
  10975. * { 'user': 'fred', 'age': 48 },
  10976. * { 'user': 'barney', 'age': 36 },
  10977. * { 'user': 'fred', 'age': 30 },
  10978. * { 'user': 'barney', 'age': 34 }
  10979. * ];
  10980. *
  10981. * _.sortBy(users, [function(o) { return o.user; }]);
  10982. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10983. *
  10984. * _.sortBy(users, ['user', 'age']);
  10985. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10986. */
  10987. var sortBy = baseRest(function(collection, iteratees) {
  10988. if (collection == null) {
  10989. return [];
  10990. }
  10991. var length = iteratees.length;
  10992. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10993. iteratees = [];
  10994. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10995. iteratees = [iteratees[0]];
  10996. }
  10997. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10998. });
  10999. /*------------------------------------------------------------------------*/
  11000. /**
  11001. * Gets the timestamp of the number of milliseconds that have elapsed since
  11002. * the Unix epoch (1 January 1970 00:00:00 UTC).
  11003. *
  11004. * @static
  11005. * @memberOf _
  11006. * @since 2.4.0
  11007. * @category Date
  11008. * @returns {number} Returns the timestamp.
  11009. * @example
  11010. *
  11011. * _.defer(function(stamp) {
  11012. * console.log(_.now() - stamp);
  11013. * }, _.now());
  11014. * // => Logs the number of milliseconds it took for the deferred invocation.
  11015. */
  11016. var now = ctxNow || function() {
  11017. return root.Date.now();
  11018. };
  11019. /*------------------------------------------------------------------------*/
  11020. /**
  11021. * The opposite of `_.before`; this method creates a function that invokes
  11022. * `func` once it's called `n` or more times.
  11023. *
  11024. * @static
  11025. * @memberOf _
  11026. * @since 0.1.0
  11027. * @category Function
  11028. * @param {number} n The number of calls before `func` is invoked.
  11029. * @param {Function} func The function to restrict.
  11030. * @returns {Function} Returns the new restricted function.
  11031. * @example
  11032. *
  11033. * var saves = ['profile', 'settings'];
  11034. *
  11035. * var done = _.after(saves.length, function() {
  11036. * console.log('done saving!');
  11037. * });
  11038. *
  11039. * _.forEach(saves, function(type) {
  11040. * asyncSave({ 'type': type, 'complete': done });
  11041. * });
  11042. * // => Logs 'done saving!' after the two async saves have completed.
  11043. */
  11044. function after(n, func) {
  11045. if (typeof func != 'function') {
  11046. throw new TypeError(FUNC_ERROR_TEXT);
  11047. }
  11048. n = toInteger(n);
  11049. return function() {
  11050. if (--n < 1) {
  11051. return func.apply(this, arguments);
  11052. }
  11053. };
  11054. }
  11055. /**
  11056. * Creates a function that invokes `func`, with up to `n` arguments,
  11057. * ignoring any additional arguments.
  11058. *
  11059. * @static
  11060. * @memberOf _
  11061. * @since 3.0.0
  11062. * @category Function
  11063. * @param {Function} func The function to cap arguments for.
  11064. * @param {number} [n=func.length] The arity cap.
  11065. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11066. * @returns {Function} Returns the new capped function.
  11067. * @example
  11068. *
  11069. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  11070. * // => [6, 8, 10]
  11071. */
  11072. function ary(func, n, guard) {
  11073. n = guard ? undefined : n;
  11074. n = (func && n == null) ? func.length : n;
  11075. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  11076. }
  11077. /**
  11078. * Creates a function that invokes `func`, with the `this` binding and arguments
  11079. * of the created function, while it's called less than `n` times. Subsequent
  11080. * calls to the created function return the result of the last `func` invocation.
  11081. *
  11082. * @static
  11083. * @memberOf _
  11084. * @since 3.0.0
  11085. * @category Function
  11086. * @param {number} n The number of calls at which `func` is no longer invoked.
  11087. * @param {Function} func The function to restrict.
  11088. * @returns {Function} Returns the new restricted function.
  11089. * @example
  11090. *
  11091. * jQuery(element).on('click', _.before(5, addContactToList));
  11092. * // => Allows adding up to 4 contacts to the list.
  11093. */
  11094. function before(n, func) {
  11095. var result;
  11096. if (typeof func != 'function') {
  11097. throw new TypeError(FUNC_ERROR_TEXT);
  11098. }
  11099. n = toInteger(n);
  11100. return function() {
  11101. if (--n > 0) {
  11102. result = func.apply(this, arguments);
  11103. }
  11104. if (n <= 1) {
  11105. func = undefined;
  11106. }
  11107. return result;
  11108. };
  11109. }
  11110. /**
  11111. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  11112. * and `partials` prepended to the arguments it receives.
  11113. *
  11114. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  11115. * may be used as a placeholder for partially applied arguments.
  11116. *
  11117. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  11118. * property of bound functions.
  11119. *
  11120. * @static
  11121. * @memberOf _
  11122. * @since 0.1.0
  11123. * @category Function
  11124. * @param {Function} func The function to bind.
  11125. * @param {*} thisArg The `this` binding of `func`.
  11126. * @param {...*} [partials] The arguments to be partially applied.
  11127. * @returns {Function} Returns the new bound function.
  11128. * @example
  11129. *
  11130. * function greet(greeting, punctuation) {
  11131. * return greeting + ' ' + this.user + punctuation;
  11132. * }
  11133. *
  11134. * var object = { 'user': 'fred' };
  11135. *
  11136. * var bound = _.bind(greet, object, 'hi');
  11137. * bound('!');
  11138. * // => 'hi fred!'
  11139. *
  11140. * // Bound with placeholders.
  11141. * var bound = _.bind(greet, object, _, '!');
  11142. * bound('hi');
  11143. * // => 'hi fred!'
  11144. */
  11145. var bind = baseRest(function(func, thisArg, partials) {
  11146. var bitmask = WRAP_BIND_FLAG;
  11147. if (partials.length) {
  11148. var holders = replaceHolders(partials, getHolder(bind));
  11149. bitmask |= WRAP_PARTIAL_FLAG;
  11150. }
  11151. return createWrap(func, bitmask, thisArg, partials, holders);
  11152. });
  11153. /**
  11154. * Creates a function that invokes the method at `object[key]` with `partials`
  11155. * prepended to the arguments it receives.
  11156. *
  11157. * This method differs from `_.bind` by allowing bound functions to reference
  11158. * methods that may be redefined or don't yet exist. See
  11159. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  11160. * for more details.
  11161. *
  11162. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  11163. * builds, may be used as a placeholder for partially applied arguments.
  11164. *
  11165. * @static
  11166. * @memberOf _
  11167. * @since 0.10.0
  11168. * @category Function
  11169. * @param {Object} object The object to invoke the method on.
  11170. * @param {string} key The key of the method.
  11171. * @param {...*} [partials] The arguments to be partially applied.
  11172. * @returns {Function} Returns the new bound function.
  11173. * @example
  11174. *
  11175. * var object = {
  11176. * 'user': 'fred',
  11177. * 'greet': function(greeting, punctuation) {
  11178. * return greeting + ' ' + this.user + punctuation;
  11179. * }
  11180. * };
  11181. *
  11182. * var bound = _.bindKey(object, 'greet', 'hi');
  11183. * bound('!');
  11184. * // => 'hi fred!'
  11185. *
  11186. * object.greet = function(greeting, punctuation) {
  11187. * return greeting + 'ya ' + this.user + punctuation;
  11188. * };
  11189. *
  11190. * bound('!');
  11191. * // => 'hiya fred!'
  11192. *
  11193. * // Bound with placeholders.
  11194. * var bound = _.bindKey(object, 'greet', _, '!');
  11195. * bound('hi');
  11196. * // => 'hiya fred!'
  11197. */
  11198. var bindKey = baseRest(function(object, key, partials) {
  11199. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  11200. if (partials.length) {
  11201. var holders = replaceHolders(partials, getHolder(bindKey));
  11202. bitmask |= WRAP_PARTIAL_FLAG;
  11203. }
  11204. return createWrap(key, bitmask, object, partials, holders);
  11205. });
  11206. /**
  11207. * Creates a function that accepts arguments of `func` and either invokes
  11208. * `func` returning its result, if at least `arity` number of arguments have
  11209. * been provided, or returns a function that accepts the remaining `func`
  11210. * arguments, and so on. The arity of `func` may be specified if `func.length`
  11211. * is not sufficient.
  11212. *
  11213. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  11214. * may be used as a placeholder for provided arguments.
  11215. *
  11216. * **Note:** This method doesn't set the "length" property of curried functions.
  11217. *
  11218. * @static
  11219. * @memberOf _
  11220. * @since 2.0.0
  11221. * @category Function
  11222. * @param {Function} func The function to curry.
  11223. * @param {number} [arity=func.length] The arity of `func`.
  11224. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11225. * @returns {Function} Returns the new curried function.
  11226. * @example
  11227. *
  11228. * var abc = function(a, b, c) {
  11229. * return [a, b, c];
  11230. * };
  11231. *
  11232. * var curried = _.curry(abc);
  11233. *
  11234. * curried(1)(2)(3);
  11235. * // => [1, 2, 3]
  11236. *
  11237. * curried(1, 2)(3);
  11238. * // => [1, 2, 3]
  11239. *
  11240. * curried(1, 2, 3);
  11241. * // => [1, 2, 3]
  11242. *
  11243. * // Curried with placeholders.
  11244. * curried(1)(_, 3)(2);
  11245. * // => [1, 2, 3]
  11246. */
  11247. function curry(func, arity, guard) {
  11248. arity = guard ? undefined : arity;
  11249. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11250. result.placeholder = curry.placeholder;
  11251. return result;
  11252. }
  11253. /**
  11254. * This method is like `_.curry` except that arguments are applied to `func`
  11255. * in the manner of `_.partialRight` instead of `_.partial`.
  11256. *
  11257. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  11258. * builds, may be used as a placeholder for provided arguments.
  11259. *
  11260. * **Note:** This method doesn't set the "length" property of curried functions.
  11261. *
  11262. * @static
  11263. * @memberOf _
  11264. * @since 3.0.0
  11265. * @category Function
  11266. * @param {Function} func The function to curry.
  11267. * @param {number} [arity=func.length] The arity of `func`.
  11268. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11269. * @returns {Function} Returns the new curried function.
  11270. * @example
  11271. *
  11272. * var abc = function(a, b, c) {
  11273. * return [a, b, c];
  11274. * };
  11275. *
  11276. * var curried = _.curryRight(abc);
  11277. *
  11278. * curried(3)(2)(1);
  11279. * // => [1, 2, 3]
  11280. *
  11281. * curried(2, 3)(1);
  11282. * // => [1, 2, 3]
  11283. *
  11284. * curried(1, 2, 3);
  11285. * // => [1, 2, 3]
  11286. *
  11287. * // Curried with placeholders.
  11288. * curried(3)(1, _)(2);
  11289. * // => [1, 2, 3]
  11290. */
  11291. function curryRight(func, arity, guard) {
  11292. arity = guard ? undefined : arity;
  11293. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11294. result.placeholder = curryRight.placeholder;
  11295. return result;
  11296. }
  11297. /**
  11298. * Creates a debounced function that delays invoking `func` until after `wait`
  11299. * milliseconds have elapsed since the last time the debounced function was
  11300. * invoked. The debounced function comes with a `cancel` method to cancel
  11301. * delayed `func` invocations and a `flush` method to immediately invoke them.
  11302. * Provide `options` to indicate whether `func` should be invoked on the
  11303. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  11304. * with the last arguments provided to the debounced function. Subsequent
  11305. * calls to the debounced function return the result of the last `func`
  11306. * invocation.
  11307. *
  11308. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11309. * invoked on the trailing edge of the timeout only if the debounced function
  11310. * is invoked more than once during the `wait` timeout.
  11311. *
  11312. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11313. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11314. *
  11315. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11316. * for details over the differences between `_.debounce` and `_.throttle`.
  11317. *
  11318. * @static
  11319. * @memberOf _
  11320. * @since 0.1.0
  11321. * @category Function
  11322. * @param {Function} func The function to debounce.
  11323. * @param {number} [wait=0] The number of milliseconds to delay.
  11324. * @param {Object} [options={}] The options object.
  11325. * @param {boolean} [options.leading=false]
  11326. * Specify invoking on the leading edge of the timeout.
  11327. * @param {number} [options.maxWait]
  11328. * The maximum time `func` is allowed to be delayed before it's invoked.
  11329. * @param {boolean} [options.trailing=true]
  11330. * Specify invoking on the trailing edge of the timeout.
  11331. * @returns {Function} Returns the new debounced function.
  11332. * @example
  11333. *
  11334. * // Avoid costly calculations while the window size is in flux.
  11335. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  11336. *
  11337. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  11338. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  11339. * 'leading': true,
  11340. * 'trailing': false
  11341. * }));
  11342. *
  11343. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  11344. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  11345. * var source = new EventSource('/stream');
  11346. * jQuery(source).on('message', debounced);
  11347. *
  11348. * // Cancel the trailing debounced invocation.
  11349. * jQuery(window).on('popstate', debounced.cancel);
  11350. */
  11351. function debounce(func, wait, options) {
  11352. var lastArgs,
  11353. lastThis,
  11354. maxWait,
  11355. result,
  11356. timerId,
  11357. lastCallTime,
  11358. lastInvokeTime = 0,
  11359. leading = false,
  11360. maxing = false,
  11361. trailing = true;
  11362. if (typeof func != 'function') {
  11363. throw new TypeError(FUNC_ERROR_TEXT);
  11364. }
  11365. wait = toNumber(wait) || 0;
  11366. if (isObject(options)) {
  11367. leading = !!options.leading;
  11368. maxing = 'maxWait' in options;
  11369. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  11370. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11371. }
  11372. function invokeFunc(time) {
  11373. var args = lastArgs,
  11374. thisArg = lastThis;
  11375. lastArgs = lastThis = undefined;
  11376. lastInvokeTime = time;
  11377. result = func.apply(thisArg, args);
  11378. return result;
  11379. }
  11380. function leadingEdge(time) {
  11381. // Reset any `maxWait` timer.
  11382. lastInvokeTime = time;
  11383. // Start the timer for the trailing edge.
  11384. timerId = setTimeout(timerExpired, wait);
  11385. // Invoke the leading edge.
  11386. return leading ? invokeFunc(time) : result;
  11387. }
  11388. function remainingWait(time) {
  11389. var timeSinceLastCall = time - lastCallTime,
  11390. timeSinceLastInvoke = time - lastInvokeTime,
  11391. timeWaiting = wait - timeSinceLastCall;
  11392. return maxing
  11393. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11394. : timeWaiting;
  11395. }
  11396. function shouldInvoke(time) {
  11397. var timeSinceLastCall = time - lastCallTime,
  11398. timeSinceLastInvoke = time - lastInvokeTime;
  11399. // Either this is the first call, activity has stopped and we're at the
  11400. // trailing edge, the system time has gone backwards and we're treating
  11401. // it as the trailing edge, or we've hit the `maxWait` limit.
  11402. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11403. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11404. }
  11405. function timerExpired() {
  11406. var time = now();
  11407. if (shouldInvoke(time)) {
  11408. return trailingEdge(time);
  11409. }
  11410. // Restart the timer.
  11411. timerId = setTimeout(timerExpired, remainingWait(time));
  11412. }
  11413. function trailingEdge(time) {
  11414. timerId = undefined;
  11415. // Only invoke if we have `lastArgs` which means `func` has been
  11416. // debounced at least once.
  11417. if (trailing && lastArgs) {
  11418. return invokeFunc(time);
  11419. }
  11420. lastArgs = lastThis = undefined;
  11421. return result;
  11422. }
  11423. function cancel() {
  11424. if (timerId !== undefined) {
  11425. clearTimeout(timerId);
  11426. }
  11427. lastInvokeTime = 0;
  11428. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11429. }
  11430. function flush() {
  11431. return timerId === undefined ? result : trailingEdge(now());
  11432. }
  11433. function debounced() {
  11434. var time = now(),
  11435. isInvoking = shouldInvoke(time);
  11436. lastArgs = arguments;
  11437. lastThis = this;
  11438. lastCallTime = time;
  11439. if (isInvoking) {
  11440. if (timerId === undefined) {
  11441. return leadingEdge(lastCallTime);
  11442. }
  11443. if (maxing) {
  11444. // Handle invocations in a tight loop.
  11445. clearTimeout(timerId);
  11446. timerId = setTimeout(timerExpired, wait);
  11447. return invokeFunc(lastCallTime);
  11448. }
  11449. }
  11450. if (timerId === undefined) {
  11451. timerId = setTimeout(timerExpired, wait);
  11452. }
  11453. return result;
  11454. }
  11455. debounced.cancel = cancel;
  11456. debounced.flush = flush;
  11457. return debounced;
  11458. }
  11459. /**
  11460. * Defers invoking the `func` until the current call stack has cleared. Any
  11461. * additional arguments are provided to `func` when it's invoked.
  11462. *
  11463. * @static
  11464. * @memberOf _
  11465. * @since 0.1.0
  11466. * @category Function
  11467. * @param {Function} func The function to defer.
  11468. * @param {...*} [args] The arguments to invoke `func` with.
  11469. * @returns {number} Returns the timer id.
  11470. * @example
  11471. *
  11472. * _.defer(function(text) {
  11473. * console.log(text);
  11474. * }, 'deferred');
  11475. * // => Logs 'deferred' after one millisecond.
  11476. */
  11477. var defer = baseRest(function(func, args) {
  11478. return baseDelay(func, 1, args);
  11479. });
  11480. /**
  11481. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11482. * provided to `func` when it's invoked.
  11483. *
  11484. * @static
  11485. * @memberOf _
  11486. * @since 0.1.0
  11487. * @category Function
  11488. * @param {Function} func The function to delay.
  11489. * @param {number} wait The number of milliseconds to delay invocation.
  11490. * @param {...*} [args] The arguments to invoke `func` with.
  11491. * @returns {number} Returns the timer id.
  11492. * @example
  11493. *
  11494. * _.delay(function(text) {
  11495. * console.log(text);
  11496. * }, 1000, 'later');
  11497. * // => Logs 'later' after one second.
  11498. */
  11499. var delay = baseRest(function(func, wait, args) {
  11500. return baseDelay(func, toNumber(wait) || 0, args);
  11501. });
  11502. /**
  11503. * Creates a function that invokes `func` with arguments reversed.
  11504. *
  11505. * @static
  11506. * @memberOf _
  11507. * @since 4.0.0
  11508. * @category Function
  11509. * @param {Function} func The function to flip arguments for.
  11510. * @returns {Function} Returns the new flipped function.
  11511. * @example
  11512. *
  11513. * var flipped = _.flip(function() {
  11514. * return _.toArray(arguments);
  11515. * });
  11516. *
  11517. * flipped('a', 'b', 'c', 'd');
  11518. * // => ['d', 'c', 'b', 'a']
  11519. */
  11520. function flip(func) {
  11521. return createWrap(func, WRAP_FLIP_FLAG);
  11522. }
  11523. /**
  11524. * Creates a function that memoizes the result of `func`. If `resolver` is
  11525. * provided, it determines the cache key for storing the result based on the
  11526. * arguments provided to the memoized function. By default, the first argument
  11527. * provided to the memoized function is used as the map cache key. The `func`
  11528. * is invoked with the `this` binding of the memoized function.
  11529. *
  11530. * **Note:** The cache is exposed as the `cache` property on the memoized
  11531. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11532. * constructor with one whose instances implement the
  11533. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11534. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11535. *
  11536. * @static
  11537. * @memberOf _
  11538. * @since 0.1.0
  11539. * @category Function
  11540. * @param {Function} func The function to have its output memoized.
  11541. * @param {Function} [resolver] The function to resolve the cache key.
  11542. * @returns {Function} Returns the new memoized function.
  11543. * @example
  11544. *
  11545. * var object = { 'a': 1, 'b': 2 };
  11546. * var other = { 'c': 3, 'd': 4 };
  11547. *
  11548. * var values = _.memoize(_.values);
  11549. * values(object);
  11550. * // => [1, 2]
  11551. *
  11552. * values(other);
  11553. * // => [3, 4]
  11554. *
  11555. * object.a = 2;
  11556. * values(object);
  11557. * // => [1, 2]
  11558. *
  11559. * // Modify the result cache.
  11560. * values.cache.set(object, ['a', 'b']);
  11561. * values(object);
  11562. * // => ['a', 'b']
  11563. *
  11564. * // Replace `_.memoize.Cache`.
  11565. * _.memoize.Cache = WeakMap;
  11566. */
  11567. function memoize(func, resolver) {
  11568. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11569. throw new TypeError(FUNC_ERROR_TEXT);
  11570. }
  11571. var memoized = function() {
  11572. var args = arguments,
  11573. key = resolver ? resolver.apply(this, args) : args[0],
  11574. cache = memoized.cache;
  11575. if (cache.has(key)) {
  11576. return cache.get(key);
  11577. }
  11578. var result = func.apply(this, args);
  11579. memoized.cache = cache.set(key, result) || cache;
  11580. return result;
  11581. };
  11582. memoized.cache = new (memoize.Cache || MapCache);
  11583. return memoized;
  11584. }
  11585. // Expose `MapCache`.
  11586. memoize.Cache = MapCache;
  11587. /**
  11588. * Creates a function that negates the result of the predicate `func`. The
  11589. * `func` predicate is invoked with the `this` binding and arguments of the
  11590. * created function.
  11591. *
  11592. * @static
  11593. * @memberOf _
  11594. * @since 3.0.0
  11595. * @category Function
  11596. * @param {Function} predicate The predicate to negate.
  11597. * @returns {Function} Returns the new negated function.
  11598. * @example
  11599. *
  11600. * function isEven(n) {
  11601. * return n % 2 == 0;
  11602. * }
  11603. *
  11604. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11605. * // => [1, 3, 5]
  11606. */
  11607. function negate(predicate) {
  11608. if (typeof predicate != 'function') {
  11609. throw new TypeError(FUNC_ERROR_TEXT);
  11610. }
  11611. return function() {
  11612. var args = arguments;
  11613. switch (args.length) {
  11614. case 0: return !predicate.call(this);
  11615. case 1: return !predicate.call(this, args[0]);
  11616. case 2: return !predicate.call(this, args[0], args[1]);
  11617. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11618. }
  11619. return !predicate.apply(this, args);
  11620. };
  11621. }
  11622. /**
  11623. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11624. * to the function return the value of the first invocation. The `func` is
  11625. * invoked with the `this` binding and arguments of the created function.
  11626. *
  11627. * @static
  11628. * @memberOf _
  11629. * @since 0.1.0
  11630. * @category Function
  11631. * @param {Function} func The function to restrict.
  11632. * @returns {Function} Returns the new restricted function.
  11633. * @example
  11634. *
  11635. * var initialize = _.once(createApplication);
  11636. * initialize();
  11637. * initialize();
  11638. * // => `createApplication` is invoked once
  11639. */
  11640. function once(func) {
  11641. return before(2, func);
  11642. }
  11643. /**
  11644. * Creates a function that invokes `func` with its arguments transformed.
  11645. *
  11646. * @static
  11647. * @since 4.0.0
  11648. * @memberOf _
  11649. * @category Function
  11650. * @param {Function} func The function to wrap.
  11651. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11652. * The argument transforms.
  11653. * @returns {Function} Returns the new function.
  11654. * @example
  11655. *
  11656. * function doubled(n) {
  11657. * return n * 2;
  11658. * }
  11659. *
  11660. * function square(n) {
  11661. * return n * n;
  11662. * }
  11663. *
  11664. * var func = _.overArgs(function(x, y) {
  11665. * return [x, y];
  11666. * }, [square, doubled]);
  11667. *
  11668. * func(9, 3);
  11669. * // => [81, 6]
  11670. *
  11671. * func(10, 5);
  11672. * // => [100, 10]
  11673. */
  11674. var overArgs = castRest(function(func, transforms) {
  11675. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11676. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11677. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11678. var funcsLength = transforms.length;
  11679. return baseRest(function(args) {
  11680. var index = -1,
  11681. length = nativeMin(args.length, funcsLength);
  11682. while (++index < length) {
  11683. args[index] = transforms[index].call(this, args[index]);
  11684. }
  11685. return apply(func, this, args);
  11686. });
  11687. });
  11688. /**
  11689. * Creates a function that invokes `func` with `partials` prepended to the
  11690. * arguments it receives. This method is like `_.bind` except it does **not**
  11691. * alter the `this` binding.
  11692. *
  11693. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11694. * builds, may be used as a placeholder for partially applied arguments.
  11695. *
  11696. * **Note:** This method doesn't set the "length" property of partially
  11697. * applied functions.
  11698. *
  11699. * @static
  11700. * @memberOf _
  11701. * @since 0.2.0
  11702. * @category Function
  11703. * @param {Function} func The function to partially apply arguments to.
  11704. * @param {...*} [partials] The arguments to be partially applied.
  11705. * @returns {Function} Returns the new partially applied function.
  11706. * @example
  11707. *
  11708. * function greet(greeting, name) {
  11709. * return greeting + ' ' + name;
  11710. * }
  11711. *
  11712. * var sayHelloTo = _.partial(greet, 'hello');
  11713. * sayHelloTo('fred');
  11714. * // => 'hello fred'
  11715. *
  11716. * // Partially applied with placeholders.
  11717. * var greetFred = _.partial(greet, _, 'fred');
  11718. * greetFred('hi');
  11719. * // => 'hi fred'
  11720. */
  11721. var partial = baseRest(function(func, partials) {
  11722. var holders = replaceHolders(partials, getHolder(partial));
  11723. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11724. });
  11725. /**
  11726. * This method is like `_.partial` except that partially applied arguments
  11727. * are appended to the arguments it receives.
  11728. *
  11729. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11730. * builds, may be used as a placeholder for partially applied arguments.
  11731. *
  11732. * **Note:** This method doesn't set the "length" property of partially
  11733. * applied functions.
  11734. *
  11735. * @static
  11736. * @memberOf _
  11737. * @since 1.0.0
  11738. * @category Function
  11739. * @param {Function} func The function to partially apply arguments to.
  11740. * @param {...*} [partials] The arguments to be partially applied.
  11741. * @returns {Function} Returns the new partially applied function.
  11742. * @example
  11743. *
  11744. * function greet(greeting, name) {
  11745. * return greeting + ' ' + name;
  11746. * }
  11747. *
  11748. * var greetFred = _.partialRight(greet, 'fred');
  11749. * greetFred('hi');
  11750. * // => 'hi fred'
  11751. *
  11752. * // Partially applied with placeholders.
  11753. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11754. * sayHelloTo('fred');
  11755. * // => 'hello fred'
  11756. */
  11757. var partialRight = baseRest(function(func, partials) {
  11758. var holders = replaceHolders(partials, getHolder(partialRight));
  11759. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11760. });
  11761. /**
  11762. * Creates a function that invokes `func` with arguments arranged according
  11763. * to the specified `indexes` where the argument value at the first index is
  11764. * provided as the first argument, the argument value at the second index is
  11765. * provided as the second argument, and so on.
  11766. *
  11767. * @static
  11768. * @memberOf _
  11769. * @since 3.0.0
  11770. * @category Function
  11771. * @param {Function} func The function to rearrange arguments for.
  11772. * @param {...(number|number[])} indexes The arranged argument indexes.
  11773. * @returns {Function} Returns the new function.
  11774. * @example
  11775. *
  11776. * var rearged = _.rearg(function(a, b, c) {
  11777. * return [a, b, c];
  11778. * }, [2, 0, 1]);
  11779. *
  11780. * rearged('b', 'c', 'a')
  11781. * // => ['a', 'b', 'c']
  11782. */
  11783. var rearg = flatRest(function(func, indexes) {
  11784. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11785. });
  11786. /**
  11787. * Creates a function that invokes `func` with the `this` binding of the
  11788. * created function and arguments from `start` and beyond provided as
  11789. * an array.
  11790. *
  11791. * **Note:** This method is based on the
  11792. * [rest parameter](https://mdn.io/rest_parameters).
  11793. *
  11794. * @static
  11795. * @memberOf _
  11796. * @since 4.0.0
  11797. * @category Function
  11798. * @param {Function} func The function to apply a rest parameter to.
  11799. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11800. * @returns {Function} Returns the new function.
  11801. * @example
  11802. *
  11803. * var say = _.rest(function(what, names) {
  11804. * return what + ' ' + _.initial(names).join(', ') +
  11805. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11806. * });
  11807. *
  11808. * say('hello', 'fred', 'barney', 'pebbles');
  11809. * // => 'hello fred, barney, & pebbles'
  11810. */
  11811. function rest(func, start) {
  11812. if (typeof func != 'function') {
  11813. throw new TypeError(FUNC_ERROR_TEXT);
  11814. }
  11815. start = start === undefined ? start : toInteger(start);
  11816. return baseRest(func, start);
  11817. }
  11818. /**
  11819. * Creates a function that invokes `func` with the `this` binding of the
  11820. * create function and an array of arguments much like
  11821. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11822. *
  11823. * **Note:** This method is based on the
  11824. * [spread operator](https://mdn.io/spread_operator).
  11825. *
  11826. * @static
  11827. * @memberOf _
  11828. * @since 3.2.0
  11829. * @category Function
  11830. * @param {Function} func The function to spread arguments over.
  11831. * @param {number} [start=0] The start position of the spread.
  11832. * @returns {Function} Returns the new function.
  11833. * @example
  11834. *
  11835. * var say = _.spread(function(who, what) {
  11836. * return who + ' says ' + what;
  11837. * });
  11838. *
  11839. * say(['fred', 'hello']);
  11840. * // => 'fred says hello'
  11841. *
  11842. * var numbers = Promise.all([
  11843. * Promise.resolve(40),
  11844. * Promise.resolve(36)
  11845. * ]);
  11846. *
  11847. * numbers.then(_.spread(function(x, y) {
  11848. * return x + y;
  11849. * }));
  11850. * // => a Promise of 76
  11851. */
  11852. function spread(func, start) {
  11853. if (typeof func != 'function') {
  11854. throw new TypeError(FUNC_ERROR_TEXT);
  11855. }
  11856. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11857. return baseRest(function(args) {
  11858. var array = args[start],
  11859. otherArgs = castSlice(args, 0, start);
  11860. if (array) {
  11861. arrayPush(otherArgs, array);
  11862. }
  11863. return apply(func, this, otherArgs);
  11864. });
  11865. }
  11866. /**
  11867. * Creates a throttled function that only invokes `func` at most once per
  11868. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11869. * method to cancel delayed `func` invocations and a `flush` method to
  11870. * immediately invoke them. Provide `options` to indicate whether `func`
  11871. * should be invoked on the leading and/or trailing edge of the `wait`
  11872. * timeout. The `func` is invoked with the last arguments provided to the
  11873. * throttled function. Subsequent calls to the throttled function return the
  11874. * result of the last `func` invocation.
  11875. *
  11876. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11877. * invoked on the trailing edge of the timeout only if the throttled function
  11878. * is invoked more than once during the `wait` timeout.
  11879. *
  11880. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11881. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11882. *
  11883. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11884. * for details over the differences between `_.throttle` and `_.debounce`.
  11885. *
  11886. * @static
  11887. * @memberOf _
  11888. * @since 0.1.0
  11889. * @category Function
  11890. * @param {Function} func The function to throttle.
  11891. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11892. * @param {Object} [options={}] The options object.
  11893. * @param {boolean} [options.leading=true]
  11894. * Specify invoking on the leading edge of the timeout.
  11895. * @param {boolean} [options.trailing=true]
  11896. * Specify invoking on the trailing edge of the timeout.
  11897. * @returns {Function} Returns the new throttled function.
  11898. * @example
  11899. *
  11900. * // Avoid excessively updating the position while scrolling.
  11901. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11902. *
  11903. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11904. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11905. * jQuery(element).on('click', throttled);
  11906. *
  11907. * // Cancel the trailing throttled invocation.
  11908. * jQuery(window).on('popstate', throttled.cancel);
  11909. */
  11910. function throttle(func, wait, options) {
  11911. var leading = true,
  11912. trailing = true;
  11913. if (typeof func != 'function') {
  11914. throw new TypeError(FUNC_ERROR_TEXT);
  11915. }
  11916. if (isObject(options)) {
  11917. leading = 'leading' in options ? !!options.leading : leading;
  11918. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11919. }
  11920. return debounce(func, wait, {
  11921. 'leading': leading,
  11922. 'maxWait': wait,
  11923. 'trailing': trailing
  11924. });
  11925. }
  11926. /**
  11927. * Creates a function that accepts up to one argument, ignoring any
  11928. * additional arguments.
  11929. *
  11930. * @static
  11931. * @memberOf _
  11932. * @since 4.0.0
  11933. * @category Function
  11934. * @param {Function} func The function to cap arguments for.
  11935. * @returns {Function} Returns the new capped function.
  11936. * @example
  11937. *
  11938. * _.map(['6', '8', '10'], _.unary(parseInt));
  11939. * // => [6, 8, 10]
  11940. */
  11941. function unary(func) {
  11942. return ary(func, 1);
  11943. }
  11944. /**
  11945. * Creates a function that provides `value` to `wrapper` as its first
  11946. * argument. Any additional arguments provided to the function are appended
  11947. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11948. * binding of the created function.
  11949. *
  11950. * @static
  11951. * @memberOf _
  11952. * @since 0.1.0
  11953. * @category Function
  11954. * @param {*} value The value to wrap.
  11955. * @param {Function} [wrapper=identity] The wrapper function.
  11956. * @returns {Function} Returns the new function.
  11957. * @example
  11958. *
  11959. * var p = _.wrap(_.escape, function(func, text) {
  11960. * return '<p>' + func(text) + '</p>';
  11961. * });
  11962. *
  11963. * p('fred, barney, & pebbles');
  11964. * // => '<p>fred, barney, &amp; pebbles</p>'
  11965. */
  11966. function wrap(value, wrapper) {
  11967. return partial(castFunction(wrapper), value);
  11968. }
  11969. /*------------------------------------------------------------------------*/
  11970. /**
  11971. * Casts `value` as an array if it's not one.
  11972. *
  11973. * @static
  11974. * @memberOf _
  11975. * @since 4.4.0
  11976. * @category Lang
  11977. * @param {*} value The value to inspect.
  11978. * @returns {Array} Returns the cast array.
  11979. * @example
  11980. *
  11981. * _.castArray(1);
  11982. * // => [1]
  11983. *
  11984. * _.castArray({ 'a': 1 });
  11985. * // => [{ 'a': 1 }]
  11986. *
  11987. * _.castArray('abc');
  11988. * // => ['abc']
  11989. *
  11990. * _.castArray(null);
  11991. * // => [null]
  11992. *
  11993. * _.castArray(undefined);
  11994. * // => [undefined]
  11995. *
  11996. * _.castArray();
  11997. * // => []
  11998. *
  11999. * var array = [1, 2, 3];
  12000. * console.log(_.castArray(array) === array);
  12001. * // => true
  12002. */
  12003. function castArray() {
  12004. if (!arguments.length) {
  12005. return [];
  12006. }
  12007. var value = arguments[0];
  12008. return isArray(value) ? value : [value];
  12009. }
  12010. /**
  12011. * Creates a shallow clone of `value`.
  12012. *
  12013. * **Note:** This method is loosely based on the
  12014. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  12015. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  12016. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  12017. * arrays. The own enumerable properties of `arguments` objects are cloned
  12018. * as plain objects. An empty object is returned for uncloneable values such
  12019. * as error objects, functions, DOM nodes, and WeakMaps.
  12020. *
  12021. * @static
  12022. * @memberOf _
  12023. * @since 0.1.0
  12024. * @category Lang
  12025. * @param {*} value The value to clone.
  12026. * @returns {*} Returns the cloned value.
  12027. * @see _.cloneDeep
  12028. * @example
  12029. *
  12030. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12031. *
  12032. * var shallow = _.clone(objects);
  12033. * console.log(shallow[0] === objects[0]);
  12034. * // => true
  12035. */
  12036. function clone(value) {
  12037. return baseClone(value, CLONE_SYMBOLS_FLAG);
  12038. }
  12039. /**
  12040. * This method is like `_.clone` except that it accepts `customizer` which
  12041. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  12042. * cloning is handled by the method instead. The `customizer` is invoked with
  12043. * up to four arguments; (value [, index|key, object, stack]).
  12044. *
  12045. * @static
  12046. * @memberOf _
  12047. * @since 4.0.0
  12048. * @category Lang
  12049. * @param {*} value The value to clone.
  12050. * @param {Function} [customizer] The function to customize cloning.
  12051. * @returns {*} Returns the cloned value.
  12052. * @see _.cloneDeepWith
  12053. * @example
  12054. *
  12055. * function customizer(value) {
  12056. * if (_.isElement(value)) {
  12057. * return value.cloneNode(false);
  12058. * }
  12059. * }
  12060. *
  12061. * var el = _.cloneWith(document.body, customizer);
  12062. *
  12063. * console.log(el === document.body);
  12064. * // => false
  12065. * console.log(el.nodeName);
  12066. * // => 'BODY'
  12067. * console.log(el.childNodes.length);
  12068. * // => 0
  12069. */
  12070. function cloneWith(value, customizer) {
  12071. customizer = typeof customizer == 'function' ? customizer : undefined;
  12072. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  12073. }
  12074. /**
  12075. * This method is like `_.clone` except that it recursively clones `value`.
  12076. *
  12077. * @static
  12078. * @memberOf _
  12079. * @since 1.0.0
  12080. * @category Lang
  12081. * @param {*} value The value to recursively clone.
  12082. * @returns {*} Returns the deep cloned value.
  12083. * @see _.clone
  12084. * @example
  12085. *
  12086. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12087. *
  12088. * var deep = _.cloneDeep(objects);
  12089. * console.log(deep[0] === objects[0]);
  12090. * // => false
  12091. */
  12092. function cloneDeep(value) {
  12093. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  12094. }
  12095. /**
  12096. * This method is like `_.cloneWith` except that it recursively clones `value`.
  12097. *
  12098. * @static
  12099. * @memberOf _
  12100. * @since 4.0.0
  12101. * @category Lang
  12102. * @param {*} value The value to recursively clone.
  12103. * @param {Function} [customizer] The function to customize cloning.
  12104. * @returns {*} Returns the deep cloned value.
  12105. * @see _.cloneWith
  12106. * @example
  12107. *
  12108. * function customizer(value) {
  12109. * if (_.isElement(value)) {
  12110. * return value.cloneNode(true);
  12111. * }
  12112. * }
  12113. *
  12114. * var el = _.cloneDeepWith(document.body, customizer);
  12115. *
  12116. * console.log(el === document.body);
  12117. * // => false
  12118. * console.log(el.nodeName);
  12119. * // => 'BODY'
  12120. * console.log(el.childNodes.length);
  12121. * // => 20
  12122. */
  12123. function cloneDeepWith(value, customizer) {
  12124. customizer = typeof customizer == 'function' ? customizer : undefined;
  12125. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  12126. }
  12127. /**
  12128. * Checks if `object` conforms to `source` by invoking the predicate
  12129. * properties of `source` with the corresponding property values of `object`.
  12130. *
  12131. * **Note:** This method is equivalent to `_.conforms` when `source` is
  12132. * partially applied.
  12133. *
  12134. * @static
  12135. * @memberOf _
  12136. * @since 4.14.0
  12137. * @category Lang
  12138. * @param {Object} object The object to inspect.
  12139. * @param {Object} source The object of property predicates to conform to.
  12140. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  12141. * @example
  12142. *
  12143. * var object = { 'a': 1, 'b': 2 };
  12144. *
  12145. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  12146. * // => true
  12147. *
  12148. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  12149. * // => false
  12150. */
  12151. function conformsTo(object, source) {
  12152. return source == null || baseConformsTo(object, source, keys(source));
  12153. }
  12154. /**
  12155. * Performs a
  12156. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12157. * comparison between two values to determine if they are equivalent.
  12158. *
  12159. * @static
  12160. * @memberOf _
  12161. * @since 4.0.0
  12162. * @category Lang
  12163. * @param {*} value The value to compare.
  12164. * @param {*} other The other value to compare.
  12165. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12166. * @example
  12167. *
  12168. * var object = { 'a': 1 };
  12169. * var other = { 'a': 1 };
  12170. *
  12171. * _.eq(object, object);
  12172. * // => true
  12173. *
  12174. * _.eq(object, other);
  12175. * // => false
  12176. *
  12177. * _.eq('a', 'a');
  12178. * // => true
  12179. *
  12180. * _.eq('a', Object('a'));
  12181. * // => false
  12182. *
  12183. * _.eq(NaN, NaN);
  12184. * // => true
  12185. */
  12186. function eq(value, other) {
  12187. return value === other || (value !== value && other !== other);
  12188. }
  12189. /**
  12190. * Checks if `value` is greater than `other`.
  12191. *
  12192. * @static
  12193. * @memberOf _
  12194. * @since 3.9.0
  12195. * @category Lang
  12196. * @param {*} value The value to compare.
  12197. * @param {*} other The other value to compare.
  12198. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  12199. * else `false`.
  12200. * @see _.lt
  12201. * @example
  12202. *
  12203. * _.gt(3, 1);
  12204. * // => true
  12205. *
  12206. * _.gt(3, 3);
  12207. * // => false
  12208. *
  12209. * _.gt(1, 3);
  12210. * // => false
  12211. */
  12212. var gt = createRelationalOperation(baseGt);
  12213. /**
  12214. * Checks if `value` is greater than or equal to `other`.
  12215. *
  12216. * @static
  12217. * @memberOf _
  12218. * @since 3.9.0
  12219. * @category Lang
  12220. * @param {*} value The value to compare.
  12221. * @param {*} other The other value to compare.
  12222. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  12223. * `other`, else `false`.
  12224. * @see _.lte
  12225. * @example
  12226. *
  12227. * _.gte(3, 1);
  12228. * // => true
  12229. *
  12230. * _.gte(3, 3);
  12231. * // => true
  12232. *
  12233. * _.gte(1, 3);
  12234. * // => false
  12235. */
  12236. var gte = createRelationalOperation(function(value, other) {
  12237. return value >= other;
  12238. });
  12239. /**
  12240. * Checks if `value` is likely an `arguments` object.
  12241. *
  12242. * @static
  12243. * @memberOf _
  12244. * @since 0.1.0
  12245. * @category Lang
  12246. * @param {*} value The value to check.
  12247. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  12248. * else `false`.
  12249. * @example
  12250. *
  12251. * _.isArguments(function() { return arguments; }());
  12252. * // => true
  12253. *
  12254. * _.isArguments([1, 2, 3]);
  12255. * // => false
  12256. */
  12257. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  12258. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  12259. !propertyIsEnumerable.call(value, 'callee');
  12260. };
  12261. /**
  12262. * Checks if `value` is classified as an `Array` object.
  12263. *
  12264. * @static
  12265. * @memberOf _
  12266. * @since 0.1.0
  12267. * @category Lang
  12268. * @param {*} value The value to check.
  12269. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12270. * @example
  12271. *
  12272. * _.isArray([1, 2, 3]);
  12273. * // => true
  12274. *
  12275. * _.isArray(document.body.children);
  12276. * // => false
  12277. *
  12278. * _.isArray('abc');
  12279. * // => false
  12280. *
  12281. * _.isArray(_.noop);
  12282. * // => false
  12283. */
  12284. var isArray = Array.isArray;
  12285. /**
  12286. * Checks if `value` is classified as an `ArrayBuffer` object.
  12287. *
  12288. * @static
  12289. * @memberOf _
  12290. * @since 4.3.0
  12291. * @category Lang
  12292. * @param {*} value The value to check.
  12293. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  12294. * @example
  12295. *
  12296. * _.isArrayBuffer(new ArrayBuffer(2));
  12297. * // => true
  12298. *
  12299. * _.isArrayBuffer(new Array(2));
  12300. * // => false
  12301. */
  12302. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  12303. /**
  12304. * Checks if `value` is array-like. A value is considered array-like if it's
  12305. * not a function and has a `value.length` that's an integer greater than or
  12306. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  12307. *
  12308. * @static
  12309. * @memberOf _
  12310. * @since 4.0.0
  12311. * @category Lang
  12312. * @param {*} value The value to check.
  12313. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  12314. * @example
  12315. *
  12316. * _.isArrayLike([1, 2, 3]);
  12317. * // => true
  12318. *
  12319. * _.isArrayLike(document.body.children);
  12320. * // => true
  12321. *
  12322. * _.isArrayLike('abc');
  12323. * // => true
  12324. *
  12325. * _.isArrayLike(_.noop);
  12326. * // => false
  12327. */
  12328. function isArrayLike(value) {
  12329. return value != null && isLength(value.length) && !isFunction(value);
  12330. }
  12331. /**
  12332. * This method is like `_.isArrayLike` except that it also checks if `value`
  12333. * is an object.
  12334. *
  12335. * @static
  12336. * @memberOf _
  12337. * @since 4.0.0
  12338. * @category Lang
  12339. * @param {*} value The value to check.
  12340. * @returns {boolean} Returns `true` if `value` is an array-like object,
  12341. * else `false`.
  12342. * @example
  12343. *
  12344. * _.isArrayLikeObject([1, 2, 3]);
  12345. * // => true
  12346. *
  12347. * _.isArrayLikeObject(document.body.children);
  12348. * // => true
  12349. *
  12350. * _.isArrayLikeObject('abc');
  12351. * // => false
  12352. *
  12353. * _.isArrayLikeObject(_.noop);
  12354. * // => false
  12355. */
  12356. function isArrayLikeObject(value) {
  12357. return isObjectLike(value) && isArrayLike(value);
  12358. }
  12359. /**
  12360. * Checks if `value` is classified as a boolean primitive or object.
  12361. *
  12362. * @static
  12363. * @memberOf _
  12364. * @since 0.1.0
  12365. * @category Lang
  12366. * @param {*} value The value to check.
  12367. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  12368. * @example
  12369. *
  12370. * _.isBoolean(false);
  12371. * // => true
  12372. *
  12373. * _.isBoolean(null);
  12374. * // => false
  12375. */
  12376. function isBoolean(value) {
  12377. return value === true || value === false ||
  12378. (isObjectLike(value) && baseGetTag(value) == boolTag);
  12379. }
  12380. /**
  12381. * Checks if `value` is a buffer.
  12382. *
  12383. * @static
  12384. * @memberOf _
  12385. * @since 4.3.0
  12386. * @category Lang
  12387. * @param {*} value The value to check.
  12388. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12389. * @example
  12390. *
  12391. * _.isBuffer(new Buffer(2));
  12392. * // => true
  12393. *
  12394. * _.isBuffer(new Uint8Array(2));
  12395. * // => false
  12396. */
  12397. var isBuffer = nativeIsBuffer || stubFalse;
  12398. /**
  12399. * Checks if `value` is classified as a `Date` object.
  12400. *
  12401. * @static
  12402. * @memberOf _
  12403. * @since 0.1.0
  12404. * @category Lang
  12405. * @param {*} value The value to check.
  12406. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12407. * @example
  12408. *
  12409. * _.isDate(new Date);
  12410. * // => true
  12411. *
  12412. * _.isDate('Mon April 23 2012');
  12413. * // => false
  12414. */
  12415. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12416. /**
  12417. * Checks if `value` is likely a DOM element.
  12418. *
  12419. * @static
  12420. * @memberOf _
  12421. * @since 0.1.0
  12422. * @category Lang
  12423. * @param {*} value The value to check.
  12424. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12425. * @example
  12426. *
  12427. * _.isElement(document.body);
  12428. * // => true
  12429. *
  12430. * _.isElement('<body>');
  12431. * // => false
  12432. */
  12433. function isElement(value) {
  12434. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12435. }
  12436. /**
  12437. * Checks if `value` is an empty object, collection, map, or set.
  12438. *
  12439. * Objects are considered empty if they have no own enumerable string keyed
  12440. * properties.
  12441. *
  12442. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12443. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12444. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12445. *
  12446. * @static
  12447. * @memberOf _
  12448. * @since 0.1.0
  12449. * @category Lang
  12450. * @param {*} value The value to check.
  12451. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12452. * @example
  12453. *
  12454. * _.isEmpty(null);
  12455. * // => true
  12456. *
  12457. * _.isEmpty(true);
  12458. * // => true
  12459. *
  12460. * _.isEmpty(1);
  12461. * // => true
  12462. *
  12463. * _.isEmpty([1, 2, 3]);
  12464. * // => false
  12465. *
  12466. * _.isEmpty({ 'a': 1 });
  12467. * // => false
  12468. */
  12469. function isEmpty(value) {
  12470. if (value == null) {
  12471. return true;
  12472. }
  12473. if (isArrayLike(value) &&
  12474. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12475. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12476. return !value.length;
  12477. }
  12478. var tag = getTag(value);
  12479. if (tag == mapTag || tag == setTag) {
  12480. return !value.size;
  12481. }
  12482. if (isPrototype(value)) {
  12483. return !baseKeys(value).length;
  12484. }
  12485. for (var key in value) {
  12486. if (hasOwnProperty.call(value, key)) {
  12487. return false;
  12488. }
  12489. }
  12490. return true;
  12491. }
  12492. /**
  12493. * Performs a deep comparison between two values to determine if they are
  12494. * equivalent.
  12495. *
  12496. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12497. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12498. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12499. * by their own, not inherited, enumerable properties. Functions and DOM
  12500. * nodes are compared by strict equality, i.e. `===`.
  12501. *
  12502. * @static
  12503. * @memberOf _
  12504. * @since 0.1.0
  12505. * @category Lang
  12506. * @param {*} value The value to compare.
  12507. * @param {*} other The other value to compare.
  12508. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12509. * @example
  12510. *
  12511. * var object = { 'a': 1 };
  12512. * var other = { 'a': 1 };
  12513. *
  12514. * _.isEqual(object, other);
  12515. * // => true
  12516. *
  12517. * object === other;
  12518. * // => false
  12519. */
  12520. function isEqual(value, other) {
  12521. return baseIsEqual(value, other);
  12522. }
  12523. /**
  12524. * This method is like `_.isEqual` except that it accepts `customizer` which
  12525. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12526. * are handled by the method instead. The `customizer` is invoked with up to
  12527. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12528. *
  12529. * @static
  12530. * @memberOf _
  12531. * @since 4.0.0
  12532. * @category Lang
  12533. * @param {*} value The value to compare.
  12534. * @param {*} other The other value to compare.
  12535. * @param {Function} [customizer] The function to customize comparisons.
  12536. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12537. * @example
  12538. *
  12539. * function isGreeting(value) {
  12540. * return /^h(?:i|ello)$/.test(value);
  12541. * }
  12542. *
  12543. * function customizer(objValue, othValue) {
  12544. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12545. * return true;
  12546. * }
  12547. * }
  12548. *
  12549. * var array = ['hello', 'goodbye'];
  12550. * var other = ['hi', 'goodbye'];
  12551. *
  12552. * _.isEqualWith(array, other, customizer);
  12553. * // => true
  12554. */
  12555. function isEqualWith(value, other, customizer) {
  12556. customizer = typeof customizer == 'function' ? customizer : undefined;
  12557. var result = customizer ? customizer(value, other) : undefined;
  12558. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12559. }
  12560. /**
  12561. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12562. * `SyntaxError`, `TypeError`, or `URIError` object.
  12563. *
  12564. * @static
  12565. * @memberOf _
  12566. * @since 3.0.0
  12567. * @category Lang
  12568. * @param {*} value The value to check.
  12569. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12570. * @example
  12571. *
  12572. * _.isError(new Error);
  12573. * // => true
  12574. *
  12575. * _.isError(Error);
  12576. * // => false
  12577. */
  12578. function isError(value) {
  12579. if (!isObjectLike(value)) {
  12580. return false;
  12581. }
  12582. var tag = baseGetTag(value);
  12583. return tag == errorTag || tag == domExcTag ||
  12584. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12585. }
  12586. /**
  12587. * Checks if `value` is a finite primitive number.
  12588. *
  12589. * **Note:** This method is based on
  12590. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12591. *
  12592. * @static
  12593. * @memberOf _
  12594. * @since 0.1.0
  12595. * @category Lang
  12596. * @param {*} value The value to check.
  12597. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12598. * @example
  12599. *
  12600. * _.isFinite(3);
  12601. * // => true
  12602. *
  12603. * _.isFinite(Number.MIN_VALUE);
  12604. * // => true
  12605. *
  12606. * _.isFinite(Infinity);
  12607. * // => false
  12608. *
  12609. * _.isFinite('3');
  12610. * // => false
  12611. */
  12612. function isFinite(value) {
  12613. return typeof value == 'number' && nativeIsFinite(value);
  12614. }
  12615. /**
  12616. * Checks if `value` is classified as a `Function` object.
  12617. *
  12618. * @static
  12619. * @memberOf _
  12620. * @since 0.1.0
  12621. * @category Lang
  12622. * @param {*} value The value to check.
  12623. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12624. * @example
  12625. *
  12626. * _.isFunction(_);
  12627. * // => true
  12628. *
  12629. * _.isFunction(/abc/);
  12630. * // => false
  12631. */
  12632. function isFunction(value) {
  12633. if (!isObject(value)) {
  12634. return false;
  12635. }
  12636. // The use of `Object#toString` avoids issues with the `typeof` operator
  12637. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12638. var tag = baseGetTag(value);
  12639. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12640. }
  12641. /**
  12642. * Checks if `value` is an integer.
  12643. *
  12644. * **Note:** This method is based on
  12645. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12646. *
  12647. * @static
  12648. * @memberOf _
  12649. * @since 4.0.0
  12650. * @category Lang
  12651. * @param {*} value The value to check.
  12652. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12653. * @example
  12654. *
  12655. * _.isInteger(3);
  12656. * // => true
  12657. *
  12658. * _.isInteger(Number.MIN_VALUE);
  12659. * // => false
  12660. *
  12661. * _.isInteger(Infinity);
  12662. * // => false
  12663. *
  12664. * _.isInteger('3');
  12665. * // => false
  12666. */
  12667. function isInteger(value) {
  12668. return typeof value == 'number' && value == toInteger(value);
  12669. }
  12670. /**
  12671. * Checks if `value` is a valid array-like length.
  12672. *
  12673. * **Note:** This method is loosely based on
  12674. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12675. *
  12676. * @static
  12677. * @memberOf _
  12678. * @since 4.0.0
  12679. * @category Lang
  12680. * @param {*} value The value to check.
  12681. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12682. * @example
  12683. *
  12684. * _.isLength(3);
  12685. * // => true
  12686. *
  12687. * _.isLength(Number.MIN_VALUE);
  12688. * // => false
  12689. *
  12690. * _.isLength(Infinity);
  12691. * // => false
  12692. *
  12693. * _.isLength('3');
  12694. * // => false
  12695. */
  12696. function isLength(value) {
  12697. return typeof value == 'number' &&
  12698. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12699. }
  12700. /**
  12701. * Checks if `value` is the
  12702. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12703. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12704. *
  12705. * @static
  12706. * @memberOf _
  12707. * @since 0.1.0
  12708. * @category Lang
  12709. * @param {*} value The value to check.
  12710. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12711. * @example
  12712. *
  12713. * _.isObject({});
  12714. * // => true
  12715. *
  12716. * _.isObject([1, 2, 3]);
  12717. * // => true
  12718. *
  12719. * _.isObject(_.noop);
  12720. * // => true
  12721. *
  12722. * _.isObject(null);
  12723. * // => false
  12724. */
  12725. function isObject(value) {
  12726. var type = typeof value;
  12727. return value != null && (type == 'object' || type == 'function');
  12728. }
  12729. /**
  12730. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12731. * and has a `typeof` result of "object".
  12732. *
  12733. * @static
  12734. * @memberOf _
  12735. * @since 4.0.0
  12736. * @category Lang
  12737. * @param {*} value The value to check.
  12738. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12739. * @example
  12740. *
  12741. * _.isObjectLike({});
  12742. * // => true
  12743. *
  12744. * _.isObjectLike([1, 2, 3]);
  12745. * // => true
  12746. *
  12747. * _.isObjectLike(_.noop);
  12748. * // => false
  12749. *
  12750. * _.isObjectLike(null);
  12751. * // => false
  12752. */
  12753. function isObjectLike(value) {
  12754. return value != null && typeof value == 'object';
  12755. }
  12756. /**
  12757. * Checks if `value` is classified as a `Map` object.
  12758. *
  12759. * @static
  12760. * @memberOf _
  12761. * @since 4.3.0
  12762. * @category Lang
  12763. * @param {*} value The value to check.
  12764. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12765. * @example
  12766. *
  12767. * _.isMap(new Map);
  12768. * // => true
  12769. *
  12770. * _.isMap(new WeakMap);
  12771. * // => false
  12772. */
  12773. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12774. /**
  12775. * Performs a partial deep comparison between `object` and `source` to
  12776. * determine if `object` contains equivalent property values.
  12777. *
  12778. * **Note:** This method is equivalent to `_.matches` when `source` is
  12779. * partially applied.
  12780. *
  12781. * Partial comparisons will match empty array and empty object `source`
  12782. * values against any array or object value, respectively. See `_.isEqual`
  12783. * for a list of supported value comparisons.
  12784. *
  12785. * @static
  12786. * @memberOf _
  12787. * @since 3.0.0
  12788. * @category Lang
  12789. * @param {Object} object The object to inspect.
  12790. * @param {Object} source The object of property values to match.
  12791. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12792. * @example
  12793. *
  12794. * var object = { 'a': 1, 'b': 2 };
  12795. *
  12796. * _.isMatch(object, { 'b': 2 });
  12797. * // => true
  12798. *
  12799. * _.isMatch(object, { 'b': 1 });
  12800. * // => false
  12801. */
  12802. function isMatch(object, source) {
  12803. return object === source || baseIsMatch(object, source, getMatchData(source));
  12804. }
  12805. /**
  12806. * This method is like `_.isMatch` except that it accepts `customizer` which
  12807. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12808. * are handled by the method instead. The `customizer` is invoked with five
  12809. * arguments: (objValue, srcValue, index|key, object, source).
  12810. *
  12811. * @static
  12812. * @memberOf _
  12813. * @since 4.0.0
  12814. * @category Lang
  12815. * @param {Object} object The object to inspect.
  12816. * @param {Object} source The object of property values to match.
  12817. * @param {Function} [customizer] The function to customize comparisons.
  12818. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12819. * @example
  12820. *
  12821. * function isGreeting(value) {
  12822. * return /^h(?:i|ello)$/.test(value);
  12823. * }
  12824. *
  12825. * function customizer(objValue, srcValue) {
  12826. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12827. * return true;
  12828. * }
  12829. * }
  12830. *
  12831. * var object = { 'greeting': 'hello' };
  12832. * var source = { 'greeting': 'hi' };
  12833. *
  12834. * _.isMatchWith(object, source, customizer);
  12835. * // => true
  12836. */
  12837. function isMatchWith(object, source, customizer) {
  12838. customizer = typeof customizer == 'function' ? customizer : undefined;
  12839. return baseIsMatch(object, source, getMatchData(source), customizer);
  12840. }
  12841. /**
  12842. * Checks if `value` is `NaN`.
  12843. *
  12844. * **Note:** This method is based on
  12845. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12846. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12847. * `undefined` and other non-number values.
  12848. *
  12849. * @static
  12850. * @memberOf _
  12851. * @since 0.1.0
  12852. * @category Lang
  12853. * @param {*} value The value to check.
  12854. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12855. * @example
  12856. *
  12857. * _.isNaN(NaN);
  12858. * // => true
  12859. *
  12860. * _.isNaN(new Number(NaN));
  12861. * // => true
  12862. *
  12863. * isNaN(undefined);
  12864. * // => true
  12865. *
  12866. * _.isNaN(undefined);
  12867. * // => false
  12868. */
  12869. function isNaN(value) {
  12870. // An `NaN` primitive is the only value that is not equal to itself.
  12871. // Perform the `toStringTag` check first to avoid errors with some
  12872. // ActiveX objects in IE.
  12873. return isNumber(value) && value != +value;
  12874. }
  12875. /**
  12876. * Checks if `value` is a pristine native function.
  12877. *
  12878. * **Note:** This method can't reliably detect native functions in the presence
  12879. * of the core-js package because core-js circumvents this kind of detection.
  12880. * Despite multiple requests, the core-js maintainer has made it clear: any
  12881. * attempt to fix the detection will be obstructed. As a result, we're left
  12882. * with little choice but to throw an error. Unfortunately, this also affects
  12883. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12884. * which rely on core-js.
  12885. *
  12886. * @static
  12887. * @memberOf _
  12888. * @since 3.0.0
  12889. * @category Lang
  12890. * @param {*} value The value to check.
  12891. * @returns {boolean} Returns `true` if `value` is a native function,
  12892. * else `false`.
  12893. * @example
  12894. *
  12895. * _.isNative(Array.prototype.push);
  12896. * // => true
  12897. *
  12898. * _.isNative(_);
  12899. * // => false
  12900. */
  12901. function isNative(value) {
  12902. if (isMaskable(value)) {
  12903. throw new Error(CORE_ERROR_TEXT);
  12904. }
  12905. return baseIsNative(value);
  12906. }
  12907. /**
  12908. * Checks if `value` is `null`.
  12909. *
  12910. * @static
  12911. * @memberOf _
  12912. * @since 0.1.0
  12913. * @category Lang
  12914. * @param {*} value The value to check.
  12915. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12916. * @example
  12917. *
  12918. * _.isNull(null);
  12919. * // => true
  12920. *
  12921. * _.isNull(void 0);
  12922. * // => false
  12923. */
  12924. function isNull(value) {
  12925. return value === null;
  12926. }
  12927. /**
  12928. * Checks if `value` is `null` or `undefined`.
  12929. *
  12930. * @static
  12931. * @memberOf _
  12932. * @since 4.0.0
  12933. * @category Lang
  12934. * @param {*} value The value to check.
  12935. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12936. * @example
  12937. *
  12938. * _.isNil(null);
  12939. * // => true
  12940. *
  12941. * _.isNil(void 0);
  12942. * // => true
  12943. *
  12944. * _.isNil(NaN);
  12945. * // => false
  12946. */
  12947. function isNil(value) {
  12948. return value == null;
  12949. }
  12950. /**
  12951. * Checks if `value` is classified as a `Number` primitive or object.
  12952. *
  12953. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12954. * classified as numbers, use the `_.isFinite` method.
  12955. *
  12956. * @static
  12957. * @memberOf _
  12958. * @since 0.1.0
  12959. * @category Lang
  12960. * @param {*} value The value to check.
  12961. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12962. * @example
  12963. *
  12964. * _.isNumber(3);
  12965. * // => true
  12966. *
  12967. * _.isNumber(Number.MIN_VALUE);
  12968. * // => true
  12969. *
  12970. * _.isNumber(Infinity);
  12971. * // => true
  12972. *
  12973. * _.isNumber('3');
  12974. * // => false
  12975. */
  12976. function isNumber(value) {
  12977. return typeof value == 'number' ||
  12978. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12979. }
  12980. /**
  12981. * Checks if `value` is a plain object, that is, an object created by the
  12982. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12983. *
  12984. * @static
  12985. * @memberOf _
  12986. * @since 0.8.0
  12987. * @category Lang
  12988. * @param {*} value The value to check.
  12989. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12990. * @example
  12991. *
  12992. * function Foo() {
  12993. * this.a = 1;
  12994. * }
  12995. *
  12996. * _.isPlainObject(new Foo);
  12997. * // => false
  12998. *
  12999. * _.isPlainObject([1, 2, 3]);
  13000. * // => false
  13001. *
  13002. * _.isPlainObject({ 'x': 0, 'y': 0 });
  13003. * // => true
  13004. *
  13005. * _.isPlainObject(Object.create(null));
  13006. * // => true
  13007. */
  13008. function isPlainObject(value) {
  13009. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  13010. return false;
  13011. }
  13012. var proto = getPrototype(value);
  13013. if (proto === null) {
  13014. return true;
  13015. }
  13016. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  13017. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  13018. funcToString.call(Ctor) == objectCtorString;
  13019. }
  13020. /**
  13021. * Checks if `value` is classified as a `RegExp` object.
  13022. *
  13023. * @static
  13024. * @memberOf _
  13025. * @since 0.1.0
  13026. * @category Lang
  13027. * @param {*} value The value to check.
  13028. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  13029. * @example
  13030. *
  13031. * _.isRegExp(/abc/);
  13032. * // => true
  13033. *
  13034. * _.isRegExp('/abc/');
  13035. * // => false
  13036. */
  13037. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  13038. /**
  13039. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  13040. * double precision number which isn't the result of a rounded unsafe integer.
  13041. *
  13042. * **Note:** This method is based on
  13043. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  13044. *
  13045. * @static
  13046. * @memberOf _
  13047. * @since 4.0.0
  13048. * @category Lang
  13049. * @param {*} value The value to check.
  13050. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  13051. * @example
  13052. *
  13053. * _.isSafeInteger(3);
  13054. * // => true
  13055. *
  13056. * _.isSafeInteger(Number.MIN_VALUE);
  13057. * // => false
  13058. *
  13059. * _.isSafeInteger(Infinity);
  13060. * // => false
  13061. *
  13062. * _.isSafeInteger('3');
  13063. * // => false
  13064. */
  13065. function isSafeInteger(value) {
  13066. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  13067. }
  13068. /**
  13069. * Checks if `value` is classified as a `Set` object.
  13070. *
  13071. * @static
  13072. * @memberOf _
  13073. * @since 4.3.0
  13074. * @category Lang
  13075. * @param {*} value The value to check.
  13076. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  13077. * @example
  13078. *
  13079. * _.isSet(new Set);
  13080. * // => true
  13081. *
  13082. * _.isSet(new WeakSet);
  13083. * // => false
  13084. */
  13085. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  13086. /**
  13087. * Checks if `value` is classified as a `String` primitive or object.
  13088. *
  13089. * @static
  13090. * @since 0.1.0
  13091. * @memberOf _
  13092. * @category Lang
  13093. * @param {*} value The value to check.
  13094. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  13095. * @example
  13096. *
  13097. * _.isString('abc');
  13098. * // => true
  13099. *
  13100. * _.isString(1);
  13101. * // => false
  13102. */
  13103. function isString(value) {
  13104. return typeof value == 'string' ||
  13105. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  13106. }
  13107. /**
  13108. * Checks if `value` is classified as a `Symbol` primitive or object.
  13109. *
  13110. * @static
  13111. * @memberOf _
  13112. * @since 4.0.0
  13113. * @category Lang
  13114. * @param {*} value The value to check.
  13115. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13116. * @example
  13117. *
  13118. * _.isSymbol(Symbol.iterator);
  13119. * // => true
  13120. *
  13121. * _.isSymbol('abc');
  13122. * // => false
  13123. */
  13124. function isSymbol(value) {
  13125. return typeof value == 'symbol' ||
  13126. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  13127. }
  13128. /**
  13129. * Checks if `value` is classified as a typed array.
  13130. *
  13131. * @static
  13132. * @memberOf _
  13133. * @since 3.0.0
  13134. * @category Lang
  13135. * @param {*} value The value to check.
  13136. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  13137. * @example
  13138. *
  13139. * _.isTypedArray(new Uint8Array);
  13140. * // => true
  13141. *
  13142. * _.isTypedArray([]);
  13143. * // => false
  13144. */
  13145. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  13146. /**
  13147. * Checks if `value` is `undefined`.
  13148. *
  13149. * @static
  13150. * @since 0.1.0
  13151. * @memberOf _
  13152. * @category Lang
  13153. * @param {*} value The value to check.
  13154. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  13155. * @example
  13156. *
  13157. * _.isUndefined(void 0);
  13158. * // => true
  13159. *
  13160. * _.isUndefined(null);
  13161. * // => false
  13162. */
  13163. function isUndefined(value) {
  13164. return value === undefined;
  13165. }
  13166. /**
  13167. * Checks if `value` is classified as a `WeakMap` object.
  13168. *
  13169. * @static
  13170. * @memberOf _
  13171. * @since 4.3.0
  13172. * @category Lang
  13173. * @param {*} value The value to check.
  13174. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  13175. * @example
  13176. *
  13177. * _.isWeakMap(new WeakMap);
  13178. * // => true
  13179. *
  13180. * _.isWeakMap(new Map);
  13181. * // => false
  13182. */
  13183. function isWeakMap(value) {
  13184. return isObjectLike(value) && getTag(value) == weakMapTag;
  13185. }
  13186. /**
  13187. * Checks if `value` is classified as a `WeakSet` object.
  13188. *
  13189. * @static
  13190. * @memberOf _
  13191. * @since 4.3.0
  13192. * @category Lang
  13193. * @param {*} value The value to check.
  13194. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  13195. * @example
  13196. *
  13197. * _.isWeakSet(new WeakSet);
  13198. * // => true
  13199. *
  13200. * _.isWeakSet(new Set);
  13201. * // => false
  13202. */
  13203. function isWeakSet(value) {
  13204. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  13205. }
  13206. /**
  13207. * Checks if `value` is less than `other`.
  13208. *
  13209. * @static
  13210. * @memberOf _
  13211. * @since 3.9.0
  13212. * @category Lang
  13213. * @param {*} value The value to compare.
  13214. * @param {*} other The other value to compare.
  13215. * @returns {boolean} Returns `true` if `value` is less than `other`,
  13216. * else `false`.
  13217. * @see _.gt
  13218. * @example
  13219. *
  13220. * _.lt(1, 3);
  13221. * // => true
  13222. *
  13223. * _.lt(3, 3);
  13224. * // => false
  13225. *
  13226. * _.lt(3, 1);
  13227. * // => false
  13228. */
  13229. var lt = createRelationalOperation(baseLt);
  13230. /**
  13231. * Checks if `value` is less than or equal to `other`.
  13232. *
  13233. * @static
  13234. * @memberOf _
  13235. * @since 3.9.0
  13236. * @category Lang
  13237. * @param {*} value The value to compare.
  13238. * @param {*} other The other value to compare.
  13239. * @returns {boolean} Returns `true` if `value` is less than or equal to
  13240. * `other`, else `false`.
  13241. * @see _.gte
  13242. * @example
  13243. *
  13244. * _.lte(1, 3);
  13245. * // => true
  13246. *
  13247. * _.lte(3, 3);
  13248. * // => true
  13249. *
  13250. * _.lte(3, 1);
  13251. * // => false
  13252. */
  13253. var lte = createRelationalOperation(function(value, other) {
  13254. return value <= other;
  13255. });
  13256. /**
  13257. * Converts `value` to an array.
  13258. *
  13259. * @static
  13260. * @since 0.1.0
  13261. * @memberOf _
  13262. * @category Lang
  13263. * @param {*} value The value to convert.
  13264. * @returns {Array} Returns the converted array.
  13265. * @example
  13266. *
  13267. * _.toArray({ 'a': 1, 'b': 2 });
  13268. * // => [1, 2]
  13269. *
  13270. * _.toArray('abc');
  13271. * // => ['a', 'b', 'c']
  13272. *
  13273. * _.toArray(1);
  13274. * // => []
  13275. *
  13276. * _.toArray(null);
  13277. * // => []
  13278. */
  13279. function toArray(value) {
  13280. if (!value) {
  13281. return [];
  13282. }
  13283. if (isArrayLike(value)) {
  13284. return isString(value) ? stringToArray(value) : copyArray(value);
  13285. }
  13286. if (symIterator && value[symIterator]) {
  13287. return iteratorToArray(value[symIterator]());
  13288. }
  13289. var tag = getTag(value),
  13290. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  13291. return func(value);
  13292. }
  13293. /**
  13294. * Converts `value` to a finite number.
  13295. *
  13296. * @static
  13297. * @memberOf _
  13298. * @since 4.12.0
  13299. * @category Lang
  13300. * @param {*} value The value to convert.
  13301. * @returns {number} Returns the converted number.
  13302. * @example
  13303. *
  13304. * _.toFinite(3.2);
  13305. * // => 3.2
  13306. *
  13307. * _.toFinite(Number.MIN_VALUE);
  13308. * // => 5e-324
  13309. *
  13310. * _.toFinite(Infinity);
  13311. * // => 1.7976931348623157e+308
  13312. *
  13313. * _.toFinite('3.2');
  13314. * // => 3.2
  13315. */
  13316. function toFinite(value) {
  13317. if (!value) {
  13318. return value === 0 ? value : 0;
  13319. }
  13320. value = toNumber(value);
  13321. if (value === INFINITY || value === -INFINITY) {
  13322. var sign = (value < 0 ? -1 : 1);
  13323. return sign * MAX_INTEGER;
  13324. }
  13325. return value === value ? value : 0;
  13326. }
  13327. /**
  13328. * Converts `value` to an integer.
  13329. *
  13330. * **Note:** This method is loosely based on
  13331. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  13332. *
  13333. * @static
  13334. * @memberOf _
  13335. * @since 4.0.0
  13336. * @category Lang
  13337. * @param {*} value The value to convert.
  13338. * @returns {number} Returns the converted integer.
  13339. * @example
  13340. *
  13341. * _.toInteger(3.2);
  13342. * // => 3
  13343. *
  13344. * _.toInteger(Number.MIN_VALUE);
  13345. * // => 0
  13346. *
  13347. * _.toInteger(Infinity);
  13348. * // => 1.7976931348623157e+308
  13349. *
  13350. * _.toInteger('3.2');
  13351. * // => 3
  13352. */
  13353. function toInteger(value) {
  13354. var result = toFinite(value),
  13355. remainder = result % 1;
  13356. return result === result ? (remainder ? result - remainder : result) : 0;
  13357. }
  13358. /**
  13359. * Converts `value` to an integer suitable for use as the length of an
  13360. * array-like object.
  13361. *
  13362. * **Note:** This method is based on
  13363. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  13364. *
  13365. * @static
  13366. * @memberOf _
  13367. * @since 4.0.0
  13368. * @category Lang
  13369. * @param {*} value The value to convert.
  13370. * @returns {number} Returns the converted integer.
  13371. * @example
  13372. *
  13373. * _.toLength(3.2);
  13374. * // => 3
  13375. *
  13376. * _.toLength(Number.MIN_VALUE);
  13377. * // => 0
  13378. *
  13379. * _.toLength(Infinity);
  13380. * // => 4294967295
  13381. *
  13382. * _.toLength('3.2');
  13383. * // => 3
  13384. */
  13385. function toLength(value) {
  13386. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13387. }
  13388. /**
  13389. * Converts `value` to a number.
  13390. *
  13391. * @static
  13392. * @memberOf _
  13393. * @since 4.0.0
  13394. * @category Lang
  13395. * @param {*} value The value to process.
  13396. * @returns {number} Returns the number.
  13397. * @example
  13398. *
  13399. * _.toNumber(3.2);
  13400. * // => 3.2
  13401. *
  13402. * _.toNumber(Number.MIN_VALUE);
  13403. * // => 5e-324
  13404. *
  13405. * _.toNumber(Infinity);
  13406. * // => Infinity
  13407. *
  13408. * _.toNumber('3.2');
  13409. * // => 3.2
  13410. */
  13411. function toNumber(value) {
  13412. if (typeof value == 'number') {
  13413. return value;
  13414. }
  13415. if (isSymbol(value)) {
  13416. return NAN;
  13417. }
  13418. if (isObject(value)) {
  13419. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13420. value = isObject(other) ? (other + '') : other;
  13421. }
  13422. if (typeof value != 'string') {
  13423. return value === 0 ? value : +value;
  13424. }
  13425. value = baseTrim(value);
  13426. var isBinary = reIsBinary.test(value);
  13427. return (isBinary || reIsOctal.test(value))
  13428. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13429. : (reIsBadHex.test(value) ? NAN : +value);
  13430. }
  13431. /**
  13432. * Converts `value` to a plain object flattening inherited enumerable string
  13433. * keyed properties of `value` to own properties of the plain object.
  13434. *
  13435. * @static
  13436. * @memberOf _
  13437. * @since 3.0.0
  13438. * @category Lang
  13439. * @param {*} value The value to convert.
  13440. * @returns {Object} Returns the converted plain object.
  13441. * @example
  13442. *
  13443. * function Foo() {
  13444. * this.b = 2;
  13445. * }
  13446. *
  13447. * Foo.prototype.c = 3;
  13448. *
  13449. * _.assign({ 'a': 1 }, new Foo);
  13450. * // => { 'a': 1, 'b': 2 }
  13451. *
  13452. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13453. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13454. */
  13455. function toPlainObject(value) {
  13456. return copyObject(value, keysIn(value));
  13457. }
  13458. /**
  13459. * Converts `value` to a safe integer. A safe integer can be compared and
  13460. * represented correctly.
  13461. *
  13462. * @static
  13463. * @memberOf _
  13464. * @since 4.0.0
  13465. * @category Lang
  13466. * @param {*} value The value to convert.
  13467. * @returns {number} Returns the converted integer.
  13468. * @example
  13469. *
  13470. * _.toSafeInteger(3.2);
  13471. * // => 3
  13472. *
  13473. * _.toSafeInteger(Number.MIN_VALUE);
  13474. * // => 0
  13475. *
  13476. * _.toSafeInteger(Infinity);
  13477. * // => 9007199254740991
  13478. *
  13479. * _.toSafeInteger('3.2');
  13480. * // => 3
  13481. */
  13482. function toSafeInteger(value) {
  13483. return value
  13484. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13485. : (value === 0 ? value : 0);
  13486. }
  13487. /**
  13488. * Converts `value` to a string. An empty string is returned for `null`
  13489. * and `undefined` values. The sign of `-0` is preserved.
  13490. *
  13491. * @static
  13492. * @memberOf _
  13493. * @since 4.0.0
  13494. * @category Lang
  13495. * @param {*} value The value to convert.
  13496. * @returns {string} Returns the converted string.
  13497. * @example
  13498. *
  13499. * _.toString(null);
  13500. * // => ''
  13501. *
  13502. * _.toString(-0);
  13503. * // => '-0'
  13504. *
  13505. * _.toString([1, 2, 3]);
  13506. * // => '1,2,3'
  13507. */
  13508. function toString(value) {
  13509. return value == null ? '' : baseToString(value);
  13510. }
  13511. /*------------------------------------------------------------------------*/
  13512. /**
  13513. * Assigns own enumerable string keyed properties of source objects to the
  13514. * destination object. Source objects are applied from left to right.
  13515. * Subsequent sources overwrite property assignments of previous sources.
  13516. *
  13517. * **Note:** This method mutates `object` and is loosely based on
  13518. * [`Object.assign`](https://mdn.io/Object/assign).
  13519. *
  13520. * @static
  13521. * @memberOf _
  13522. * @since 0.10.0
  13523. * @category Object
  13524. * @param {Object} object The destination object.
  13525. * @param {...Object} [sources] The source objects.
  13526. * @returns {Object} Returns `object`.
  13527. * @see _.assignIn
  13528. * @example
  13529. *
  13530. * function Foo() {
  13531. * this.a = 1;
  13532. * }
  13533. *
  13534. * function Bar() {
  13535. * this.c = 3;
  13536. * }
  13537. *
  13538. * Foo.prototype.b = 2;
  13539. * Bar.prototype.d = 4;
  13540. *
  13541. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13542. * // => { 'a': 1, 'c': 3 }
  13543. */
  13544. var assign = createAssigner(function(object, source) {
  13545. if (isPrototype(source) || isArrayLike(source)) {
  13546. copyObject(source, keys(source), object);
  13547. return;
  13548. }
  13549. for (var key in source) {
  13550. if (hasOwnProperty.call(source, key)) {
  13551. assignValue(object, key, source[key]);
  13552. }
  13553. }
  13554. });
  13555. /**
  13556. * This method is like `_.assign` except that it iterates over own and
  13557. * inherited source properties.
  13558. *
  13559. * **Note:** This method mutates `object`.
  13560. *
  13561. * @static
  13562. * @memberOf _
  13563. * @since 4.0.0
  13564. * @alias extend
  13565. * @category Object
  13566. * @param {Object} object The destination object.
  13567. * @param {...Object} [sources] The source objects.
  13568. * @returns {Object} Returns `object`.
  13569. * @see _.assign
  13570. * @example
  13571. *
  13572. * function Foo() {
  13573. * this.a = 1;
  13574. * }
  13575. *
  13576. * function Bar() {
  13577. * this.c = 3;
  13578. * }
  13579. *
  13580. * Foo.prototype.b = 2;
  13581. * Bar.prototype.d = 4;
  13582. *
  13583. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13584. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13585. */
  13586. var assignIn = createAssigner(function(object, source) {
  13587. copyObject(source, keysIn(source), object);
  13588. });
  13589. /**
  13590. * This method is like `_.assignIn` except that it accepts `customizer`
  13591. * which is invoked to produce the assigned values. If `customizer` returns
  13592. * `undefined`, assignment is handled by the method instead. The `customizer`
  13593. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13594. *
  13595. * **Note:** This method mutates `object`.
  13596. *
  13597. * @static
  13598. * @memberOf _
  13599. * @since 4.0.0
  13600. * @alias extendWith
  13601. * @category Object
  13602. * @param {Object} object The destination object.
  13603. * @param {...Object} sources The source objects.
  13604. * @param {Function} [customizer] The function to customize assigned values.
  13605. * @returns {Object} Returns `object`.
  13606. * @see _.assignWith
  13607. * @example
  13608. *
  13609. * function customizer(objValue, srcValue) {
  13610. * return _.isUndefined(objValue) ? srcValue : objValue;
  13611. * }
  13612. *
  13613. * var defaults = _.partialRight(_.assignInWith, customizer);
  13614. *
  13615. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13616. * // => { 'a': 1, 'b': 2 }
  13617. */
  13618. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13619. copyObject(source, keysIn(source), object, customizer);
  13620. });
  13621. /**
  13622. * This method is like `_.assign` except that it accepts `customizer`
  13623. * which is invoked to produce the assigned values. If `customizer` returns
  13624. * `undefined`, assignment is handled by the method instead. The `customizer`
  13625. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13626. *
  13627. * **Note:** This method mutates `object`.
  13628. *
  13629. * @static
  13630. * @memberOf _
  13631. * @since 4.0.0
  13632. * @category Object
  13633. * @param {Object} object The destination object.
  13634. * @param {...Object} sources The source objects.
  13635. * @param {Function} [customizer] The function to customize assigned values.
  13636. * @returns {Object} Returns `object`.
  13637. * @see _.assignInWith
  13638. * @example
  13639. *
  13640. * function customizer(objValue, srcValue) {
  13641. * return _.isUndefined(objValue) ? srcValue : objValue;
  13642. * }
  13643. *
  13644. * var defaults = _.partialRight(_.assignWith, customizer);
  13645. *
  13646. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13647. * // => { 'a': 1, 'b': 2 }
  13648. */
  13649. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13650. copyObject(source, keys(source), object, customizer);
  13651. });
  13652. /**
  13653. * Creates an array of values corresponding to `paths` of `object`.
  13654. *
  13655. * @static
  13656. * @memberOf _
  13657. * @since 1.0.0
  13658. * @category Object
  13659. * @param {Object} object The object to iterate over.
  13660. * @param {...(string|string[])} [paths] The property paths to pick.
  13661. * @returns {Array} Returns the picked values.
  13662. * @example
  13663. *
  13664. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13665. *
  13666. * _.at(object, ['a[0].b.c', 'a[1]']);
  13667. * // => [3, 4]
  13668. */
  13669. var at = flatRest(baseAt);
  13670. /**
  13671. * Creates an object that inherits from the `prototype` object. If a
  13672. * `properties` object is given, its own enumerable string keyed properties
  13673. * are assigned to the created object.
  13674. *
  13675. * @static
  13676. * @memberOf _
  13677. * @since 2.3.0
  13678. * @category Object
  13679. * @param {Object} prototype The object to inherit from.
  13680. * @param {Object} [properties] The properties to assign to the object.
  13681. * @returns {Object} Returns the new object.
  13682. * @example
  13683. *
  13684. * function Shape() {
  13685. * this.x = 0;
  13686. * this.y = 0;
  13687. * }
  13688. *
  13689. * function Circle() {
  13690. * Shape.call(this);
  13691. * }
  13692. *
  13693. * Circle.prototype = _.create(Shape.prototype, {
  13694. * 'constructor': Circle
  13695. * });
  13696. *
  13697. * var circle = new Circle;
  13698. * circle instanceof Circle;
  13699. * // => true
  13700. *
  13701. * circle instanceof Shape;
  13702. * // => true
  13703. */
  13704. function create(prototype, properties) {
  13705. var result = baseCreate(prototype);
  13706. return properties == null ? result : baseAssign(result, properties);
  13707. }
  13708. /**
  13709. * Assigns own and inherited enumerable string keyed properties of source
  13710. * objects to the destination object for all destination properties that
  13711. * resolve to `undefined`. Source objects are applied from left to right.
  13712. * Once a property is set, additional values of the same property are ignored.
  13713. *
  13714. * **Note:** This method mutates `object`.
  13715. *
  13716. * @static
  13717. * @since 0.1.0
  13718. * @memberOf _
  13719. * @category Object
  13720. * @param {Object} object The destination object.
  13721. * @param {...Object} [sources] The source objects.
  13722. * @returns {Object} Returns `object`.
  13723. * @see _.defaultsDeep
  13724. * @example
  13725. *
  13726. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13727. * // => { 'a': 1, 'b': 2 }
  13728. */
  13729. var defaults = baseRest(function(object, sources) {
  13730. object = Object(object);
  13731. var index = -1;
  13732. var length = sources.length;
  13733. var guard = length > 2 ? sources[2] : undefined;
  13734. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13735. length = 1;
  13736. }
  13737. while (++index < length) {
  13738. var source = sources[index];
  13739. var props = keysIn(source);
  13740. var propsIndex = -1;
  13741. var propsLength = props.length;
  13742. while (++propsIndex < propsLength) {
  13743. var key = props[propsIndex];
  13744. var value = object[key];
  13745. if (value === undefined ||
  13746. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13747. object[key] = source[key];
  13748. }
  13749. }
  13750. }
  13751. return object;
  13752. });
  13753. /**
  13754. * This method is like `_.defaults` except that it recursively assigns
  13755. * default properties.
  13756. *
  13757. * **Note:** This method mutates `object`.
  13758. *
  13759. * @static
  13760. * @memberOf _
  13761. * @since 3.10.0
  13762. * @category Object
  13763. * @param {Object} object The destination object.
  13764. * @param {...Object} [sources] The source objects.
  13765. * @returns {Object} Returns `object`.
  13766. * @see _.defaults
  13767. * @example
  13768. *
  13769. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13770. * // => { 'a': { 'b': 2, 'c': 3 } }
  13771. */
  13772. var defaultsDeep = baseRest(function(args) {
  13773. args.push(undefined, customDefaultsMerge);
  13774. return apply(mergeWith, undefined, args);
  13775. });
  13776. /**
  13777. * This method is like `_.find` except that it returns the key of the first
  13778. * element `predicate` returns truthy for instead of the element itself.
  13779. *
  13780. * @static
  13781. * @memberOf _
  13782. * @since 1.1.0
  13783. * @category Object
  13784. * @param {Object} object The object to inspect.
  13785. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13786. * @returns {string|undefined} Returns the key of the matched element,
  13787. * else `undefined`.
  13788. * @example
  13789. *
  13790. * var users = {
  13791. * 'barney': { 'age': 36, 'active': true },
  13792. * 'fred': { 'age': 40, 'active': false },
  13793. * 'pebbles': { 'age': 1, 'active': true }
  13794. * };
  13795. *
  13796. * _.findKey(users, function(o) { return o.age < 40; });
  13797. * // => 'barney' (iteration order is not guaranteed)
  13798. *
  13799. * // The `_.matches` iteratee shorthand.
  13800. * _.findKey(users, { 'age': 1, 'active': true });
  13801. * // => 'pebbles'
  13802. *
  13803. * // The `_.matchesProperty` iteratee shorthand.
  13804. * _.findKey(users, ['active', false]);
  13805. * // => 'fred'
  13806. *
  13807. * // The `_.property` iteratee shorthand.
  13808. * _.findKey(users, 'active');
  13809. * // => 'barney'
  13810. */
  13811. function findKey(object, predicate) {
  13812. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13813. }
  13814. /**
  13815. * This method is like `_.findKey` except that it iterates over elements of
  13816. * a collection in the opposite order.
  13817. *
  13818. * @static
  13819. * @memberOf _
  13820. * @since 2.0.0
  13821. * @category Object
  13822. * @param {Object} object The object to inspect.
  13823. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13824. * @returns {string|undefined} Returns the key of the matched element,
  13825. * else `undefined`.
  13826. * @example
  13827. *
  13828. * var users = {
  13829. * 'barney': { 'age': 36, 'active': true },
  13830. * 'fred': { 'age': 40, 'active': false },
  13831. * 'pebbles': { 'age': 1, 'active': true }
  13832. * };
  13833. *
  13834. * _.findLastKey(users, function(o) { return o.age < 40; });
  13835. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13836. *
  13837. * // The `_.matches` iteratee shorthand.
  13838. * _.findLastKey(users, { 'age': 36, 'active': true });
  13839. * // => 'barney'
  13840. *
  13841. * // The `_.matchesProperty` iteratee shorthand.
  13842. * _.findLastKey(users, ['active', false]);
  13843. * // => 'fred'
  13844. *
  13845. * // The `_.property` iteratee shorthand.
  13846. * _.findLastKey(users, 'active');
  13847. * // => 'pebbles'
  13848. */
  13849. function findLastKey(object, predicate) {
  13850. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13851. }
  13852. /**
  13853. * Iterates over own and inherited enumerable string keyed properties of an
  13854. * object and invokes `iteratee` for each property. The iteratee is invoked
  13855. * with three arguments: (value, key, object). Iteratee functions may exit
  13856. * iteration early by explicitly returning `false`.
  13857. *
  13858. * @static
  13859. * @memberOf _
  13860. * @since 0.3.0
  13861. * @category Object
  13862. * @param {Object} object The object to iterate over.
  13863. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13864. * @returns {Object} Returns `object`.
  13865. * @see _.forInRight
  13866. * @example
  13867. *
  13868. * function Foo() {
  13869. * this.a = 1;
  13870. * this.b = 2;
  13871. * }
  13872. *
  13873. * Foo.prototype.c = 3;
  13874. *
  13875. * _.forIn(new Foo, function(value, key) {
  13876. * console.log(key);
  13877. * });
  13878. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13879. */
  13880. function forIn(object, iteratee) {
  13881. return object == null
  13882. ? object
  13883. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13884. }
  13885. /**
  13886. * This method is like `_.forIn` except that it iterates over properties of
  13887. * `object` in the opposite order.
  13888. *
  13889. * @static
  13890. * @memberOf _
  13891. * @since 2.0.0
  13892. * @category Object
  13893. * @param {Object} object The object to iterate over.
  13894. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13895. * @returns {Object} Returns `object`.
  13896. * @see _.forIn
  13897. * @example
  13898. *
  13899. * function Foo() {
  13900. * this.a = 1;
  13901. * this.b = 2;
  13902. * }
  13903. *
  13904. * Foo.prototype.c = 3;
  13905. *
  13906. * _.forInRight(new Foo, function(value, key) {
  13907. * console.log(key);
  13908. * });
  13909. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13910. */
  13911. function forInRight(object, iteratee) {
  13912. return object == null
  13913. ? object
  13914. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13915. }
  13916. /**
  13917. * Iterates over own enumerable string keyed properties of an object and
  13918. * invokes `iteratee` for each property. The iteratee is invoked with three
  13919. * arguments: (value, key, object). Iteratee functions may exit iteration
  13920. * early by explicitly returning `false`.
  13921. *
  13922. * @static
  13923. * @memberOf _
  13924. * @since 0.3.0
  13925. * @category Object
  13926. * @param {Object} object The object to iterate over.
  13927. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13928. * @returns {Object} Returns `object`.
  13929. * @see _.forOwnRight
  13930. * @example
  13931. *
  13932. * function Foo() {
  13933. * this.a = 1;
  13934. * this.b = 2;
  13935. * }
  13936. *
  13937. * Foo.prototype.c = 3;
  13938. *
  13939. * _.forOwn(new Foo, function(value, key) {
  13940. * console.log(key);
  13941. * });
  13942. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13943. */
  13944. function forOwn(object, iteratee) {
  13945. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13946. }
  13947. /**
  13948. * This method is like `_.forOwn` except that it iterates over properties of
  13949. * `object` in the opposite order.
  13950. *
  13951. * @static
  13952. * @memberOf _
  13953. * @since 2.0.0
  13954. * @category Object
  13955. * @param {Object} object The object to iterate over.
  13956. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13957. * @returns {Object} Returns `object`.
  13958. * @see _.forOwn
  13959. * @example
  13960. *
  13961. * function Foo() {
  13962. * this.a = 1;
  13963. * this.b = 2;
  13964. * }
  13965. *
  13966. * Foo.prototype.c = 3;
  13967. *
  13968. * _.forOwnRight(new Foo, function(value, key) {
  13969. * console.log(key);
  13970. * });
  13971. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13972. */
  13973. function forOwnRight(object, iteratee) {
  13974. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13975. }
  13976. /**
  13977. * Creates an array of function property names from own enumerable properties
  13978. * of `object`.
  13979. *
  13980. * @static
  13981. * @since 0.1.0
  13982. * @memberOf _
  13983. * @category Object
  13984. * @param {Object} object The object to inspect.
  13985. * @returns {Array} Returns the function names.
  13986. * @see _.functionsIn
  13987. * @example
  13988. *
  13989. * function Foo() {
  13990. * this.a = _.constant('a');
  13991. * this.b = _.constant('b');
  13992. * }
  13993. *
  13994. * Foo.prototype.c = _.constant('c');
  13995. *
  13996. * _.functions(new Foo);
  13997. * // => ['a', 'b']
  13998. */
  13999. function functions(object) {
  14000. return object == null ? [] : baseFunctions(object, keys(object));
  14001. }
  14002. /**
  14003. * Creates an array of function property names from own and inherited
  14004. * enumerable properties of `object`.
  14005. *
  14006. * @static
  14007. * @memberOf _
  14008. * @since 4.0.0
  14009. * @category Object
  14010. * @param {Object} object The object to inspect.
  14011. * @returns {Array} Returns the function names.
  14012. * @see _.functions
  14013. * @example
  14014. *
  14015. * function Foo() {
  14016. * this.a = _.constant('a');
  14017. * this.b = _.constant('b');
  14018. * }
  14019. *
  14020. * Foo.prototype.c = _.constant('c');
  14021. *
  14022. * _.functionsIn(new Foo);
  14023. * // => ['a', 'b', 'c']
  14024. */
  14025. function functionsIn(object) {
  14026. return object == null ? [] : baseFunctions(object, keysIn(object));
  14027. }
  14028. /**
  14029. * Gets the value at `path` of `object`. If the resolved value is
  14030. * `undefined`, the `defaultValue` is returned in its place.
  14031. *
  14032. * @static
  14033. * @memberOf _
  14034. * @since 3.7.0
  14035. * @category Object
  14036. * @param {Object} object The object to query.
  14037. * @param {Array|string} path The path of the property to get.
  14038. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14039. * @returns {*} Returns the resolved value.
  14040. * @example
  14041. *
  14042. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14043. *
  14044. * _.get(object, 'a[0].b.c');
  14045. * // => 3
  14046. *
  14047. * _.get(object, ['a', '0', 'b', 'c']);
  14048. * // => 3
  14049. *
  14050. * _.get(object, 'a.b.c', 'default');
  14051. * // => 'default'
  14052. */
  14053. function get(object, path, defaultValue) {
  14054. var result = object == null ? undefined : baseGet(object, path);
  14055. return result === undefined ? defaultValue : result;
  14056. }
  14057. /**
  14058. * Checks if `path` is a direct property of `object`.
  14059. *
  14060. * @static
  14061. * @since 0.1.0
  14062. * @memberOf _
  14063. * @category Object
  14064. * @param {Object} object The object to query.
  14065. * @param {Array|string} path The path to check.
  14066. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14067. * @example
  14068. *
  14069. * var object = { 'a': { 'b': 2 } };
  14070. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  14071. *
  14072. * _.has(object, 'a');
  14073. * // => true
  14074. *
  14075. * _.has(object, 'a.b');
  14076. * // => true
  14077. *
  14078. * _.has(object, ['a', 'b']);
  14079. * // => true
  14080. *
  14081. * _.has(other, 'a');
  14082. * // => false
  14083. */
  14084. function has(object, path) {
  14085. return object != null && hasPath(object, path, baseHas);
  14086. }
  14087. /**
  14088. * Checks if `path` is a direct or inherited property of `object`.
  14089. *
  14090. * @static
  14091. * @memberOf _
  14092. * @since 4.0.0
  14093. * @category Object
  14094. * @param {Object} object The object to query.
  14095. * @param {Array|string} path The path to check.
  14096. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14097. * @example
  14098. *
  14099. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  14100. *
  14101. * _.hasIn(object, 'a');
  14102. * // => true
  14103. *
  14104. * _.hasIn(object, 'a.b');
  14105. * // => true
  14106. *
  14107. * _.hasIn(object, ['a', 'b']);
  14108. * // => true
  14109. *
  14110. * _.hasIn(object, 'b');
  14111. * // => false
  14112. */
  14113. function hasIn(object, path) {
  14114. return object != null && hasPath(object, path, baseHasIn);
  14115. }
  14116. /**
  14117. * Creates an object composed of the inverted keys and values of `object`.
  14118. * If `object` contains duplicate values, subsequent values overwrite
  14119. * property assignments of previous values.
  14120. *
  14121. * @static
  14122. * @memberOf _
  14123. * @since 0.7.0
  14124. * @category Object
  14125. * @param {Object} object The object to invert.
  14126. * @returns {Object} Returns the new inverted object.
  14127. * @example
  14128. *
  14129. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14130. *
  14131. * _.invert(object);
  14132. * // => { '1': 'c', '2': 'b' }
  14133. */
  14134. var invert = createInverter(function(result, value, key) {
  14135. if (value != null &&
  14136. typeof value.toString != 'function') {
  14137. value = nativeObjectToString.call(value);
  14138. }
  14139. result[value] = key;
  14140. }, constant(identity));
  14141. /**
  14142. * This method is like `_.invert` except that the inverted object is generated
  14143. * from the results of running each element of `object` thru `iteratee`. The
  14144. * corresponding inverted value of each inverted key is an array of keys
  14145. * responsible for generating the inverted value. The iteratee is invoked
  14146. * with one argument: (value).
  14147. *
  14148. * @static
  14149. * @memberOf _
  14150. * @since 4.1.0
  14151. * @category Object
  14152. * @param {Object} object The object to invert.
  14153. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14154. * @returns {Object} Returns the new inverted object.
  14155. * @example
  14156. *
  14157. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14158. *
  14159. * _.invertBy(object);
  14160. * // => { '1': ['a', 'c'], '2': ['b'] }
  14161. *
  14162. * _.invertBy(object, function(value) {
  14163. * return 'group' + value;
  14164. * });
  14165. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  14166. */
  14167. var invertBy = createInverter(function(result, value, key) {
  14168. if (value != null &&
  14169. typeof value.toString != 'function') {
  14170. value = nativeObjectToString.call(value);
  14171. }
  14172. if (hasOwnProperty.call(result, value)) {
  14173. result[value].push(key);
  14174. } else {
  14175. result[value] = [key];
  14176. }
  14177. }, getIteratee);
  14178. /**
  14179. * Invokes the method at `path` of `object`.
  14180. *
  14181. * @static
  14182. * @memberOf _
  14183. * @since 4.0.0
  14184. * @category Object
  14185. * @param {Object} object The object to query.
  14186. * @param {Array|string} path The path of the method to invoke.
  14187. * @param {...*} [args] The arguments to invoke the method with.
  14188. * @returns {*} Returns the result of the invoked method.
  14189. * @example
  14190. *
  14191. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  14192. *
  14193. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  14194. * // => [2, 3]
  14195. */
  14196. var invoke = baseRest(baseInvoke);
  14197. /**
  14198. * Creates an array of the own enumerable property names of `object`.
  14199. *
  14200. * **Note:** Non-object values are coerced to objects. See the
  14201. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  14202. * for more details.
  14203. *
  14204. * @static
  14205. * @since 0.1.0
  14206. * @memberOf _
  14207. * @category Object
  14208. * @param {Object} object The object to query.
  14209. * @returns {Array} Returns the array of property names.
  14210. * @example
  14211. *
  14212. * function Foo() {
  14213. * this.a = 1;
  14214. * this.b = 2;
  14215. * }
  14216. *
  14217. * Foo.prototype.c = 3;
  14218. *
  14219. * _.keys(new Foo);
  14220. * // => ['a', 'b'] (iteration order is not guaranteed)
  14221. *
  14222. * _.keys('hi');
  14223. * // => ['0', '1']
  14224. */
  14225. function keys(object) {
  14226. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14227. }
  14228. /**
  14229. * Creates an array of the own and inherited enumerable property names of `object`.
  14230. *
  14231. * **Note:** Non-object values are coerced to objects.
  14232. *
  14233. * @static
  14234. * @memberOf _
  14235. * @since 3.0.0
  14236. * @category Object
  14237. * @param {Object} object The object to query.
  14238. * @returns {Array} Returns the array of property names.
  14239. * @example
  14240. *
  14241. * function Foo() {
  14242. * this.a = 1;
  14243. * this.b = 2;
  14244. * }
  14245. *
  14246. * Foo.prototype.c = 3;
  14247. *
  14248. * _.keysIn(new Foo);
  14249. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  14250. */
  14251. function keysIn(object) {
  14252. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  14253. }
  14254. /**
  14255. * The opposite of `_.mapValues`; this method creates an object with the
  14256. * same values as `object` and keys generated by running each own enumerable
  14257. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  14258. * with three arguments: (value, key, object).
  14259. *
  14260. * @static
  14261. * @memberOf _
  14262. * @since 3.8.0
  14263. * @category Object
  14264. * @param {Object} object The object to iterate over.
  14265. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14266. * @returns {Object} Returns the new mapped object.
  14267. * @see _.mapValues
  14268. * @example
  14269. *
  14270. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  14271. * return key + value;
  14272. * });
  14273. * // => { 'a1': 1, 'b2': 2 }
  14274. */
  14275. function mapKeys(object, iteratee) {
  14276. var result = {};
  14277. iteratee = getIteratee(iteratee, 3);
  14278. baseForOwn(object, function(value, key, object) {
  14279. baseAssignValue(result, iteratee(value, key, object), value);
  14280. });
  14281. return result;
  14282. }
  14283. /**
  14284. * Creates an object with the same keys as `object` and values generated
  14285. * by running each own enumerable string keyed property of `object` thru
  14286. * `iteratee`. The iteratee is invoked with three arguments:
  14287. * (value, key, object).
  14288. *
  14289. * @static
  14290. * @memberOf _
  14291. * @since 2.4.0
  14292. * @category Object
  14293. * @param {Object} object The object to iterate over.
  14294. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14295. * @returns {Object} Returns the new mapped object.
  14296. * @see _.mapKeys
  14297. * @example
  14298. *
  14299. * var users = {
  14300. * 'fred': { 'user': 'fred', 'age': 40 },
  14301. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  14302. * };
  14303. *
  14304. * _.mapValues(users, function(o) { return o.age; });
  14305. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14306. *
  14307. * // The `_.property` iteratee shorthand.
  14308. * _.mapValues(users, 'age');
  14309. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14310. */
  14311. function mapValues(object, iteratee) {
  14312. var result = {};
  14313. iteratee = getIteratee(iteratee, 3);
  14314. baseForOwn(object, function(value, key, object) {
  14315. baseAssignValue(result, key, iteratee(value, key, object));
  14316. });
  14317. return result;
  14318. }
  14319. /**
  14320. * This method is like `_.assign` except that it recursively merges own and
  14321. * inherited enumerable string keyed properties of source objects into the
  14322. * destination object. Source properties that resolve to `undefined` are
  14323. * skipped if a destination value exists. Array and plain object properties
  14324. * are merged recursively. Other objects and value types are overridden by
  14325. * assignment. Source objects are applied from left to right. Subsequent
  14326. * sources overwrite property assignments of previous sources.
  14327. *
  14328. * **Note:** This method mutates `object`.
  14329. *
  14330. * @static
  14331. * @memberOf _
  14332. * @since 0.5.0
  14333. * @category Object
  14334. * @param {Object} object The destination object.
  14335. * @param {...Object} [sources] The source objects.
  14336. * @returns {Object} Returns `object`.
  14337. * @example
  14338. *
  14339. * var object = {
  14340. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  14341. * };
  14342. *
  14343. * var other = {
  14344. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  14345. * };
  14346. *
  14347. * _.merge(object, other);
  14348. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  14349. */
  14350. var merge = createAssigner(function(object, source, srcIndex) {
  14351. baseMerge(object, source, srcIndex);
  14352. });
  14353. /**
  14354. * This method is like `_.merge` except that it accepts `customizer` which
  14355. * is invoked to produce the merged values of the destination and source
  14356. * properties. If `customizer` returns `undefined`, merging is handled by the
  14357. * method instead. The `customizer` is invoked with six arguments:
  14358. * (objValue, srcValue, key, object, source, stack).
  14359. *
  14360. * **Note:** This method mutates `object`.
  14361. *
  14362. * @static
  14363. * @memberOf _
  14364. * @since 4.0.0
  14365. * @category Object
  14366. * @param {Object} object The destination object.
  14367. * @param {...Object} sources The source objects.
  14368. * @param {Function} customizer The function to customize assigned values.
  14369. * @returns {Object} Returns `object`.
  14370. * @example
  14371. *
  14372. * function customizer(objValue, srcValue) {
  14373. * if (_.isArray(objValue)) {
  14374. * return objValue.concat(srcValue);
  14375. * }
  14376. * }
  14377. *
  14378. * var object = { 'a': [1], 'b': [2] };
  14379. * var other = { 'a': [3], 'b': [4] };
  14380. *
  14381. * _.mergeWith(object, other, customizer);
  14382. * // => { 'a': [1, 3], 'b': [2, 4] }
  14383. */
  14384. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14385. baseMerge(object, source, srcIndex, customizer);
  14386. });
  14387. /**
  14388. * The opposite of `_.pick`; this method creates an object composed of the
  14389. * own and inherited enumerable property paths of `object` that are not omitted.
  14390. *
  14391. * **Note:** This method is considerably slower than `_.pick`.
  14392. *
  14393. * @static
  14394. * @since 0.1.0
  14395. * @memberOf _
  14396. * @category Object
  14397. * @param {Object} object The source object.
  14398. * @param {...(string|string[])} [paths] The property paths to omit.
  14399. * @returns {Object} Returns the new object.
  14400. * @example
  14401. *
  14402. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14403. *
  14404. * _.omit(object, ['a', 'c']);
  14405. * // => { 'b': '2' }
  14406. */
  14407. var omit = flatRest(function(object, paths) {
  14408. var result = {};
  14409. if (object == null) {
  14410. return result;
  14411. }
  14412. var isDeep = false;
  14413. paths = arrayMap(paths, function(path) {
  14414. path = castPath(path, object);
  14415. isDeep || (isDeep = path.length > 1);
  14416. return path;
  14417. });
  14418. copyObject(object, getAllKeysIn(object), result);
  14419. if (isDeep) {
  14420. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14421. }
  14422. var length = paths.length;
  14423. while (length--) {
  14424. baseUnset(result, paths[length]);
  14425. }
  14426. return result;
  14427. });
  14428. /**
  14429. * The opposite of `_.pickBy`; this method creates an object composed of
  14430. * the own and inherited enumerable string keyed properties of `object` that
  14431. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14432. * arguments: (value, key).
  14433. *
  14434. * @static
  14435. * @memberOf _
  14436. * @since 4.0.0
  14437. * @category Object
  14438. * @param {Object} object The source object.
  14439. * @param {Function} [predicate=_.identity] The function invoked per property.
  14440. * @returns {Object} Returns the new object.
  14441. * @example
  14442. *
  14443. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14444. *
  14445. * _.omitBy(object, _.isNumber);
  14446. * // => { 'b': '2' }
  14447. */
  14448. function omitBy(object, predicate) {
  14449. return pickBy(object, negate(getIteratee(predicate)));
  14450. }
  14451. /**
  14452. * Creates an object composed of the picked `object` properties.
  14453. *
  14454. * @static
  14455. * @since 0.1.0
  14456. * @memberOf _
  14457. * @category Object
  14458. * @param {Object} object The source object.
  14459. * @param {...(string|string[])} [paths] The property paths to pick.
  14460. * @returns {Object} Returns the new object.
  14461. * @example
  14462. *
  14463. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14464. *
  14465. * _.pick(object, ['a', 'c']);
  14466. * // => { 'a': 1, 'c': 3 }
  14467. */
  14468. var pick = flatRest(function(object, paths) {
  14469. return object == null ? {} : basePick(object, paths);
  14470. });
  14471. /**
  14472. * Creates an object composed of the `object` properties `predicate` returns
  14473. * truthy for. The predicate is invoked with two arguments: (value, key).
  14474. *
  14475. * @static
  14476. * @memberOf _
  14477. * @since 4.0.0
  14478. * @category Object
  14479. * @param {Object} object The source object.
  14480. * @param {Function} [predicate=_.identity] The function invoked per property.
  14481. * @returns {Object} Returns the new object.
  14482. * @example
  14483. *
  14484. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14485. *
  14486. * _.pickBy(object, _.isNumber);
  14487. * // => { 'a': 1, 'c': 3 }
  14488. */
  14489. function pickBy(object, predicate) {
  14490. if (object == null) {
  14491. return {};
  14492. }
  14493. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14494. return [prop];
  14495. });
  14496. predicate = getIteratee(predicate);
  14497. return basePickBy(object, props, function(value, path) {
  14498. return predicate(value, path[0]);
  14499. });
  14500. }
  14501. /**
  14502. * This method is like `_.get` except that if the resolved value is a
  14503. * function it's invoked with the `this` binding of its parent object and
  14504. * its result is returned.
  14505. *
  14506. * @static
  14507. * @since 0.1.0
  14508. * @memberOf _
  14509. * @category Object
  14510. * @param {Object} object The object to query.
  14511. * @param {Array|string} path The path of the property to resolve.
  14512. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14513. * @returns {*} Returns the resolved value.
  14514. * @example
  14515. *
  14516. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14517. *
  14518. * _.result(object, 'a[0].b.c1');
  14519. * // => 3
  14520. *
  14521. * _.result(object, 'a[0].b.c2');
  14522. * // => 4
  14523. *
  14524. * _.result(object, 'a[0].b.c3', 'default');
  14525. * // => 'default'
  14526. *
  14527. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14528. * // => 'default'
  14529. */
  14530. function result(object, path, defaultValue) {
  14531. path = castPath(path, object);
  14532. var index = -1,
  14533. length = path.length;
  14534. // Ensure the loop is entered when path is empty.
  14535. if (!length) {
  14536. length = 1;
  14537. object = undefined;
  14538. }
  14539. while (++index < length) {
  14540. var value = object == null ? undefined : object[toKey(path[index])];
  14541. if (value === undefined) {
  14542. index = length;
  14543. value = defaultValue;
  14544. }
  14545. object = isFunction(value) ? value.call(object) : value;
  14546. }
  14547. return object;
  14548. }
  14549. /**
  14550. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14551. * it's created. Arrays are created for missing index properties while objects
  14552. * are created for all other missing properties. Use `_.setWith` to customize
  14553. * `path` creation.
  14554. *
  14555. * **Note:** This method mutates `object`.
  14556. *
  14557. * @static
  14558. * @memberOf _
  14559. * @since 3.7.0
  14560. * @category Object
  14561. * @param {Object} object The object to modify.
  14562. * @param {Array|string} path The path of the property to set.
  14563. * @param {*} value The value to set.
  14564. * @returns {Object} Returns `object`.
  14565. * @example
  14566. *
  14567. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14568. *
  14569. * _.set(object, 'a[0].b.c', 4);
  14570. * console.log(object.a[0].b.c);
  14571. * // => 4
  14572. *
  14573. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14574. * console.log(object.x[0].y.z);
  14575. * // => 5
  14576. */
  14577. function set(object, path, value) {
  14578. return object == null ? object : baseSet(object, path, value);
  14579. }
  14580. /**
  14581. * This method is like `_.set` except that it accepts `customizer` which is
  14582. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14583. * path creation is handled by the method instead. The `customizer` is invoked
  14584. * with three arguments: (nsValue, key, nsObject).
  14585. *
  14586. * **Note:** This method mutates `object`.
  14587. *
  14588. * @static
  14589. * @memberOf _
  14590. * @since 4.0.0
  14591. * @category Object
  14592. * @param {Object} object The object to modify.
  14593. * @param {Array|string} path The path of the property to set.
  14594. * @param {*} value The value to set.
  14595. * @param {Function} [customizer] The function to customize assigned values.
  14596. * @returns {Object} Returns `object`.
  14597. * @example
  14598. *
  14599. * var object = {};
  14600. *
  14601. * _.setWith(object, '[0][1]', 'a', Object);
  14602. * // => { '0': { '1': 'a' } }
  14603. */
  14604. function setWith(object, path, value, customizer) {
  14605. customizer = typeof customizer == 'function' ? customizer : undefined;
  14606. return object == null ? object : baseSet(object, path, value, customizer);
  14607. }
  14608. /**
  14609. * Creates an array of own enumerable string keyed-value pairs for `object`
  14610. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14611. * entries are returned.
  14612. *
  14613. * @static
  14614. * @memberOf _
  14615. * @since 4.0.0
  14616. * @alias entries
  14617. * @category Object
  14618. * @param {Object} object The object to query.
  14619. * @returns {Array} Returns the key-value pairs.
  14620. * @example
  14621. *
  14622. * function Foo() {
  14623. * this.a = 1;
  14624. * this.b = 2;
  14625. * }
  14626. *
  14627. * Foo.prototype.c = 3;
  14628. *
  14629. * _.toPairs(new Foo);
  14630. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14631. */
  14632. var toPairs = createToPairs(keys);
  14633. /**
  14634. * Creates an array of own and inherited enumerable string keyed-value pairs
  14635. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14636. * or set, its entries are returned.
  14637. *
  14638. * @static
  14639. * @memberOf _
  14640. * @since 4.0.0
  14641. * @alias entriesIn
  14642. * @category Object
  14643. * @param {Object} object The object to query.
  14644. * @returns {Array} Returns the key-value pairs.
  14645. * @example
  14646. *
  14647. * function Foo() {
  14648. * this.a = 1;
  14649. * this.b = 2;
  14650. * }
  14651. *
  14652. * Foo.prototype.c = 3;
  14653. *
  14654. * _.toPairsIn(new Foo);
  14655. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14656. */
  14657. var toPairsIn = createToPairs(keysIn);
  14658. /**
  14659. * An alternative to `_.reduce`; this method transforms `object` to a new
  14660. * `accumulator` object which is the result of running each of its own
  14661. * enumerable string keyed properties thru `iteratee`, with each invocation
  14662. * potentially mutating the `accumulator` object. If `accumulator` is not
  14663. * provided, a new object with the same `[[Prototype]]` will be used. The
  14664. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14665. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14666. *
  14667. * @static
  14668. * @memberOf _
  14669. * @since 1.3.0
  14670. * @category Object
  14671. * @param {Object} object The object to iterate over.
  14672. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14673. * @param {*} [accumulator] The custom accumulator value.
  14674. * @returns {*} Returns the accumulated value.
  14675. * @example
  14676. *
  14677. * _.transform([2, 3, 4], function(result, n) {
  14678. * result.push(n *= n);
  14679. * return n % 2 == 0;
  14680. * }, []);
  14681. * // => [4, 9]
  14682. *
  14683. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14684. * (result[value] || (result[value] = [])).push(key);
  14685. * }, {});
  14686. * // => { '1': ['a', 'c'], '2': ['b'] }
  14687. */
  14688. function transform(object, iteratee, accumulator) {
  14689. var isArr = isArray(object),
  14690. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14691. iteratee = getIteratee(iteratee, 4);
  14692. if (accumulator == null) {
  14693. var Ctor = object && object.constructor;
  14694. if (isArrLike) {
  14695. accumulator = isArr ? new Ctor : [];
  14696. }
  14697. else if (isObject(object)) {
  14698. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14699. }
  14700. else {
  14701. accumulator = {};
  14702. }
  14703. }
  14704. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14705. return iteratee(accumulator, value, index, object);
  14706. });
  14707. return accumulator;
  14708. }
  14709. /**
  14710. * Removes the property at `path` of `object`.
  14711. *
  14712. * **Note:** This method mutates `object`.
  14713. *
  14714. * @static
  14715. * @memberOf _
  14716. * @since 4.0.0
  14717. * @category Object
  14718. * @param {Object} object The object to modify.
  14719. * @param {Array|string} path The path of the property to unset.
  14720. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14721. * @example
  14722. *
  14723. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14724. * _.unset(object, 'a[0].b.c');
  14725. * // => true
  14726. *
  14727. * console.log(object);
  14728. * // => { 'a': [{ 'b': {} }] };
  14729. *
  14730. * _.unset(object, ['a', '0', 'b', 'c']);
  14731. * // => true
  14732. *
  14733. * console.log(object);
  14734. * // => { 'a': [{ 'b': {} }] };
  14735. */
  14736. function unset(object, path) {
  14737. return object == null ? true : baseUnset(object, path);
  14738. }
  14739. /**
  14740. * This method is like `_.set` except that accepts `updater` to produce the
  14741. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14742. * is invoked with one argument: (value).
  14743. *
  14744. * **Note:** This method mutates `object`.
  14745. *
  14746. * @static
  14747. * @memberOf _
  14748. * @since 4.6.0
  14749. * @category Object
  14750. * @param {Object} object The object to modify.
  14751. * @param {Array|string} path The path of the property to set.
  14752. * @param {Function} updater The function to produce the updated value.
  14753. * @returns {Object} Returns `object`.
  14754. * @example
  14755. *
  14756. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14757. *
  14758. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14759. * console.log(object.a[0].b.c);
  14760. * // => 9
  14761. *
  14762. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14763. * console.log(object.x[0].y.z);
  14764. * // => 0
  14765. */
  14766. function update(object, path, updater) {
  14767. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14768. }
  14769. /**
  14770. * This method is like `_.update` except that it accepts `customizer` which is
  14771. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14772. * path creation is handled by the method instead. The `customizer` is invoked
  14773. * with three arguments: (nsValue, key, nsObject).
  14774. *
  14775. * **Note:** This method mutates `object`.
  14776. *
  14777. * @static
  14778. * @memberOf _
  14779. * @since 4.6.0
  14780. * @category Object
  14781. * @param {Object} object The object to modify.
  14782. * @param {Array|string} path The path of the property to set.
  14783. * @param {Function} updater The function to produce the updated value.
  14784. * @param {Function} [customizer] The function to customize assigned values.
  14785. * @returns {Object} Returns `object`.
  14786. * @example
  14787. *
  14788. * var object = {};
  14789. *
  14790. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14791. * // => { '0': { '1': 'a' } }
  14792. */
  14793. function updateWith(object, path, updater, customizer) {
  14794. customizer = typeof customizer == 'function' ? customizer : undefined;
  14795. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14796. }
  14797. /**
  14798. * Creates an array of the own enumerable string keyed property values of `object`.
  14799. *
  14800. * **Note:** Non-object values are coerced to objects.
  14801. *
  14802. * @static
  14803. * @since 0.1.0
  14804. * @memberOf _
  14805. * @category Object
  14806. * @param {Object} object The object to query.
  14807. * @returns {Array} Returns the array of property values.
  14808. * @example
  14809. *
  14810. * function Foo() {
  14811. * this.a = 1;
  14812. * this.b = 2;
  14813. * }
  14814. *
  14815. * Foo.prototype.c = 3;
  14816. *
  14817. * _.values(new Foo);
  14818. * // => [1, 2] (iteration order is not guaranteed)
  14819. *
  14820. * _.values('hi');
  14821. * // => ['h', 'i']
  14822. */
  14823. function values(object) {
  14824. return object == null ? [] : baseValues(object, keys(object));
  14825. }
  14826. /**
  14827. * Creates an array of the own and inherited enumerable string keyed property
  14828. * values of `object`.
  14829. *
  14830. * **Note:** Non-object values are coerced to objects.
  14831. *
  14832. * @static
  14833. * @memberOf _
  14834. * @since 3.0.0
  14835. * @category Object
  14836. * @param {Object} object The object to query.
  14837. * @returns {Array} Returns the array of property values.
  14838. * @example
  14839. *
  14840. * function Foo() {
  14841. * this.a = 1;
  14842. * this.b = 2;
  14843. * }
  14844. *
  14845. * Foo.prototype.c = 3;
  14846. *
  14847. * _.valuesIn(new Foo);
  14848. * // => [1, 2, 3] (iteration order is not guaranteed)
  14849. */
  14850. function valuesIn(object) {
  14851. return object == null ? [] : baseValues(object, keysIn(object));
  14852. }
  14853. /*------------------------------------------------------------------------*/
  14854. /**
  14855. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14856. *
  14857. * @static
  14858. * @memberOf _
  14859. * @since 4.0.0
  14860. * @category Number
  14861. * @param {number} number The number to clamp.
  14862. * @param {number} [lower] The lower bound.
  14863. * @param {number} upper The upper bound.
  14864. * @returns {number} Returns the clamped number.
  14865. * @example
  14866. *
  14867. * _.clamp(-10, -5, 5);
  14868. * // => -5
  14869. *
  14870. * _.clamp(10, -5, 5);
  14871. * // => 5
  14872. */
  14873. function clamp(number, lower, upper) {
  14874. if (upper === undefined) {
  14875. upper = lower;
  14876. lower = undefined;
  14877. }
  14878. if (upper !== undefined) {
  14879. upper = toNumber(upper);
  14880. upper = upper === upper ? upper : 0;
  14881. }
  14882. if (lower !== undefined) {
  14883. lower = toNumber(lower);
  14884. lower = lower === lower ? lower : 0;
  14885. }
  14886. return baseClamp(toNumber(number), lower, upper);
  14887. }
  14888. /**
  14889. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14890. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14891. * If `start` is greater than `end` the params are swapped to support
  14892. * negative ranges.
  14893. *
  14894. * @static
  14895. * @memberOf _
  14896. * @since 3.3.0
  14897. * @category Number
  14898. * @param {number} number The number to check.
  14899. * @param {number} [start=0] The start of the range.
  14900. * @param {number} end The end of the range.
  14901. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14902. * @see _.range, _.rangeRight
  14903. * @example
  14904. *
  14905. * _.inRange(3, 2, 4);
  14906. * // => true
  14907. *
  14908. * _.inRange(4, 8);
  14909. * // => true
  14910. *
  14911. * _.inRange(4, 2);
  14912. * // => false
  14913. *
  14914. * _.inRange(2, 2);
  14915. * // => false
  14916. *
  14917. * _.inRange(1.2, 2);
  14918. * // => true
  14919. *
  14920. * _.inRange(5.2, 4);
  14921. * // => false
  14922. *
  14923. * _.inRange(-3, -2, -6);
  14924. * // => true
  14925. */
  14926. function inRange(number, start, end) {
  14927. start = toFinite(start);
  14928. if (end === undefined) {
  14929. end = start;
  14930. start = 0;
  14931. } else {
  14932. end = toFinite(end);
  14933. }
  14934. number = toNumber(number);
  14935. return baseInRange(number, start, end);
  14936. }
  14937. /**
  14938. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14939. * If only one argument is provided a number between `0` and the given number
  14940. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14941. * floats, a floating-point number is returned instead of an integer.
  14942. *
  14943. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14944. * floating-point values which can produce unexpected results.
  14945. *
  14946. * @static
  14947. * @memberOf _
  14948. * @since 0.7.0
  14949. * @category Number
  14950. * @param {number} [lower=0] The lower bound.
  14951. * @param {number} [upper=1] The upper bound.
  14952. * @param {boolean} [floating] Specify returning a floating-point number.
  14953. * @returns {number} Returns the random number.
  14954. * @example
  14955. *
  14956. * _.random(0, 5);
  14957. * // => an integer between 0 and 5
  14958. *
  14959. * _.random(5);
  14960. * // => also an integer between 0 and 5
  14961. *
  14962. * _.random(5, true);
  14963. * // => a floating-point number between 0 and 5
  14964. *
  14965. * _.random(1.2, 5.2);
  14966. * // => a floating-point number between 1.2 and 5.2
  14967. */
  14968. function random(lower, upper, floating) {
  14969. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14970. upper = floating = undefined;
  14971. }
  14972. if (floating === undefined) {
  14973. if (typeof upper == 'boolean') {
  14974. floating = upper;
  14975. upper = undefined;
  14976. }
  14977. else if (typeof lower == 'boolean') {
  14978. floating = lower;
  14979. lower = undefined;
  14980. }
  14981. }
  14982. if (lower === undefined && upper === undefined) {
  14983. lower = 0;
  14984. upper = 1;
  14985. }
  14986. else {
  14987. lower = toFinite(lower);
  14988. if (upper === undefined) {
  14989. upper = lower;
  14990. lower = 0;
  14991. } else {
  14992. upper = toFinite(upper);
  14993. }
  14994. }
  14995. if (lower > upper) {
  14996. var temp = lower;
  14997. lower = upper;
  14998. upper = temp;
  14999. }
  15000. if (floating || lower % 1 || upper % 1) {
  15001. var rand = nativeRandom();
  15002. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  15003. }
  15004. return baseRandom(lower, upper);
  15005. }
  15006. /*------------------------------------------------------------------------*/
  15007. /**
  15008. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  15009. *
  15010. * @static
  15011. * @memberOf _
  15012. * @since 3.0.0
  15013. * @category String
  15014. * @param {string} [string=''] The string to convert.
  15015. * @returns {string} Returns the camel cased string.
  15016. * @example
  15017. *
  15018. * _.camelCase('Foo Bar');
  15019. * // => 'fooBar'
  15020. *
  15021. * _.camelCase('--foo-bar--');
  15022. * // => 'fooBar'
  15023. *
  15024. * _.camelCase('__FOO_BAR__');
  15025. * // => 'fooBar'
  15026. */
  15027. var camelCase = createCompounder(function(result, word, index) {
  15028. word = word.toLowerCase();
  15029. return result + (index ? capitalize(word) : word);
  15030. });
  15031. /**
  15032. * Converts the first character of `string` to upper case and the remaining
  15033. * to lower case.
  15034. *
  15035. * @static
  15036. * @memberOf _
  15037. * @since 3.0.0
  15038. * @category String
  15039. * @param {string} [string=''] The string to capitalize.
  15040. * @returns {string} Returns the capitalized string.
  15041. * @example
  15042. *
  15043. * _.capitalize('FRED');
  15044. * // => 'Fred'
  15045. */
  15046. function capitalize(string) {
  15047. return upperFirst(toString(string).toLowerCase());
  15048. }
  15049. /**
  15050. * Deburrs `string` by converting
  15051. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  15052. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  15053. * letters to basic Latin letters and removing
  15054. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  15055. *
  15056. * @static
  15057. * @memberOf _
  15058. * @since 3.0.0
  15059. * @category String
  15060. * @param {string} [string=''] The string to deburr.
  15061. * @returns {string} Returns the deburred string.
  15062. * @example
  15063. *
  15064. * _.deburr('déjà vu');
  15065. * // => 'deja vu'
  15066. */
  15067. function deburr(string) {
  15068. string = toString(string);
  15069. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  15070. }
  15071. /**
  15072. * Checks if `string` ends with the given target string.
  15073. *
  15074. * @static
  15075. * @memberOf _
  15076. * @since 3.0.0
  15077. * @category String
  15078. * @param {string} [string=''] The string to inspect.
  15079. * @param {string} [target] The string to search for.
  15080. * @param {number} [position=string.length] The position to search up to.
  15081. * @returns {boolean} Returns `true` if `string` ends with `target`,
  15082. * else `false`.
  15083. * @example
  15084. *
  15085. * _.endsWith('abc', 'c');
  15086. * // => true
  15087. *
  15088. * _.endsWith('abc', 'b');
  15089. * // => false
  15090. *
  15091. * _.endsWith('abc', 'b', 2);
  15092. * // => true
  15093. */
  15094. function endsWith(string, target, position) {
  15095. string = toString(string);
  15096. target = baseToString(target);
  15097. var length = string.length;
  15098. position = position === undefined
  15099. ? length
  15100. : baseClamp(toInteger(position), 0, length);
  15101. var end = position;
  15102. position -= target.length;
  15103. return position >= 0 && string.slice(position, end) == target;
  15104. }
  15105. /**
  15106. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  15107. * corresponding HTML entities.
  15108. *
  15109. * **Note:** No other characters are escaped. To escape additional
  15110. * characters use a third-party library like [_he_](https://mths.be/he).
  15111. *
  15112. * Though the ">" character is escaped for symmetry, characters like
  15113. * ">" and "/" don't need escaping in HTML and have no special meaning
  15114. * unless they're part of a tag or unquoted attribute value. See
  15115. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  15116. * (under "semi-related fun fact") for more details.
  15117. *
  15118. * When working with HTML you should always
  15119. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  15120. * XSS vectors.
  15121. *
  15122. * @static
  15123. * @since 0.1.0
  15124. * @memberOf _
  15125. * @category String
  15126. * @param {string} [string=''] The string to escape.
  15127. * @returns {string} Returns the escaped string.
  15128. * @example
  15129. *
  15130. * _.escape('fred, barney, & pebbles');
  15131. * // => 'fred, barney, &amp; pebbles'
  15132. */
  15133. function escape(string) {
  15134. string = toString(string);
  15135. return (string && reHasUnescapedHtml.test(string))
  15136. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  15137. : string;
  15138. }
  15139. /**
  15140. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  15141. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  15142. *
  15143. * @static
  15144. * @memberOf _
  15145. * @since 3.0.0
  15146. * @category String
  15147. * @param {string} [string=''] The string to escape.
  15148. * @returns {string} Returns the escaped string.
  15149. * @example
  15150. *
  15151. * _.escapeRegExp('[lodash](https://lodash.com/)');
  15152. * // => '\[lodash\]\(https://lodash\.com/\)'
  15153. */
  15154. function escapeRegExp(string) {
  15155. string = toString(string);
  15156. return (string && reHasRegExpChar.test(string))
  15157. ? string.replace(reRegExpChar, '\\$&')
  15158. : string;
  15159. }
  15160. /**
  15161. * Converts `string` to
  15162. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  15163. *
  15164. * @static
  15165. * @memberOf _
  15166. * @since 3.0.0
  15167. * @category String
  15168. * @param {string} [string=''] The string to convert.
  15169. * @returns {string} Returns the kebab cased string.
  15170. * @example
  15171. *
  15172. * _.kebabCase('Foo Bar');
  15173. * // => 'foo-bar'
  15174. *
  15175. * _.kebabCase('fooBar');
  15176. * // => 'foo-bar'
  15177. *
  15178. * _.kebabCase('__FOO_BAR__');
  15179. * // => 'foo-bar'
  15180. */
  15181. var kebabCase = createCompounder(function(result, word, index) {
  15182. return result + (index ? '-' : '') + word.toLowerCase();
  15183. });
  15184. /**
  15185. * Converts `string`, as space separated words, to lower case.
  15186. *
  15187. * @static
  15188. * @memberOf _
  15189. * @since 4.0.0
  15190. * @category String
  15191. * @param {string} [string=''] The string to convert.
  15192. * @returns {string} Returns the lower cased string.
  15193. * @example
  15194. *
  15195. * _.lowerCase('--Foo-Bar--');
  15196. * // => 'foo bar'
  15197. *
  15198. * _.lowerCase('fooBar');
  15199. * // => 'foo bar'
  15200. *
  15201. * _.lowerCase('__FOO_BAR__');
  15202. * // => 'foo bar'
  15203. */
  15204. var lowerCase = createCompounder(function(result, word, index) {
  15205. return result + (index ? ' ' : '') + word.toLowerCase();
  15206. });
  15207. /**
  15208. * Converts the first character of `string` to lower case.
  15209. *
  15210. * @static
  15211. * @memberOf _
  15212. * @since 4.0.0
  15213. * @category String
  15214. * @param {string} [string=''] The string to convert.
  15215. * @returns {string} Returns the converted string.
  15216. * @example
  15217. *
  15218. * _.lowerFirst('Fred');
  15219. * // => 'fred'
  15220. *
  15221. * _.lowerFirst('FRED');
  15222. * // => 'fRED'
  15223. */
  15224. var lowerFirst = createCaseFirst('toLowerCase');
  15225. /**
  15226. * Pads `string` on the left and right sides if it's shorter than `length`.
  15227. * Padding characters are truncated if they can't be evenly divided by `length`.
  15228. *
  15229. * @static
  15230. * @memberOf _
  15231. * @since 3.0.0
  15232. * @category String
  15233. * @param {string} [string=''] The string to pad.
  15234. * @param {number} [length=0] The padding length.
  15235. * @param {string} [chars=' '] The string used as padding.
  15236. * @returns {string} Returns the padded string.
  15237. * @example
  15238. *
  15239. * _.pad('abc', 8);
  15240. * // => ' abc '
  15241. *
  15242. * _.pad('abc', 8, '_-');
  15243. * // => '_-abc_-_'
  15244. *
  15245. * _.pad('abc', 3);
  15246. * // => 'abc'
  15247. */
  15248. function pad(string, length, chars) {
  15249. string = toString(string);
  15250. length = toInteger(length);
  15251. var strLength = length ? stringSize(string) : 0;
  15252. if (!length || strLength >= length) {
  15253. return string;
  15254. }
  15255. var mid = (length - strLength) / 2;
  15256. return (
  15257. createPadding(nativeFloor(mid), chars) +
  15258. string +
  15259. createPadding(nativeCeil(mid), chars)
  15260. );
  15261. }
  15262. /**
  15263. * Pads `string` on the right side if it's shorter than `length`. Padding
  15264. * characters are truncated if they exceed `length`.
  15265. *
  15266. * @static
  15267. * @memberOf _
  15268. * @since 4.0.0
  15269. * @category String
  15270. * @param {string} [string=''] The string to pad.
  15271. * @param {number} [length=0] The padding length.
  15272. * @param {string} [chars=' '] The string used as padding.
  15273. * @returns {string} Returns the padded string.
  15274. * @example
  15275. *
  15276. * _.padEnd('abc', 6);
  15277. * // => 'abc '
  15278. *
  15279. * _.padEnd('abc', 6, '_-');
  15280. * // => 'abc_-_'
  15281. *
  15282. * _.padEnd('abc', 3);
  15283. * // => 'abc'
  15284. */
  15285. function padEnd(string, length, chars) {
  15286. string = toString(string);
  15287. length = toInteger(length);
  15288. var strLength = length ? stringSize(string) : 0;
  15289. return (length && strLength < length)
  15290. ? (string + createPadding(length - strLength, chars))
  15291. : string;
  15292. }
  15293. /**
  15294. * Pads `string` on the left side if it's shorter than `length`. Padding
  15295. * characters are truncated if they exceed `length`.
  15296. *
  15297. * @static
  15298. * @memberOf _
  15299. * @since 4.0.0
  15300. * @category String
  15301. * @param {string} [string=''] The string to pad.
  15302. * @param {number} [length=0] The padding length.
  15303. * @param {string} [chars=' '] The string used as padding.
  15304. * @returns {string} Returns the padded string.
  15305. * @example
  15306. *
  15307. * _.padStart('abc', 6);
  15308. * // => ' abc'
  15309. *
  15310. * _.padStart('abc', 6, '_-');
  15311. * // => '_-_abc'
  15312. *
  15313. * _.padStart('abc', 3);
  15314. * // => 'abc'
  15315. */
  15316. function padStart(string, length, chars) {
  15317. string = toString(string);
  15318. length = toInteger(length);
  15319. var strLength = length ? stringSize(string) : 0;
  15320. return (length && strLength < length)
  15321. ? (createPadding(length - strLength, chars) + string)
  15322. : string;
  15323. }
  15324. /**
  15325. * Converts `string` to an integer of the specified radix. If `radix` is
  15326. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  15327. * hexadecimal, in which case a `radix` of `16` is used.
  15328. *
  15329. * **Note:** This method aligns with the
  15330. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  15331. *
  15332. * @static
  15333. * @memberOf _
  15334. * @since 1.1.0
  15335. * @category String
  15336. * @param {string} string The string to convert.
  15337. * @param {number} [radix=10] The radix to interpret `value` by.
  15338. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15339. * @returns {number} Returns the converted integer.
  15340. * @example
  15341. *
  15342. * _.parseInt('08');
  15343. * // => 8
  15344. *
  15345. * _.map(['6', '08', '10'], _.parseInt);
  15346. * // => [6, 8, 10]
  15347. */
  15348. function parseInt(string, radix, guard) {
  15349. if (guard || radix == null) {
  15350. radix = 0;
  15351. } else if (radix) {
  15352. radix = +radix;
  15353. }
  15354. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  15355. }
  15356. /**
  15357. * Repeats the given string `n` times.
  15358. *
  15359. * @static
  15360. * @memberOf _
  15361. * @since 3.0.0
  15362. * @category String
  15363. * @param {string} [string=''] The string to repeat.
  15364. * @param {number} [n=1] The number of times to repeat the string.
  15365. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15366. * @returns {string} Returns the repeated string.
  15367. * @example
  15368. *
  15369. * _.repeat('*', 3);
  15370. * // => '***'
  15371. *
  15372. * _.repeat('abc', 2);
  15373. * // => 'abcabc'
  15374. *
  15375. * _.repeat('abc', 0);
  15376. * // => ''
  15377. */
  15378. function repeat(string, n, guard) {
  15379. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  15380. n = 1;
  15381. } else {
  15382. n = toInteger(n);
  15383. }
  15384. return baseRepeat(toString(string), n);
  15385. }
  15386. /**
  15387. * Replaces matches for `pattern` in `string` with `replacement`.
  15388. *
  15389. * **Note:** This method is based on
  15390. * [`String#replace`](https://mdn.io/String/replace).
  15391. *
  15392. * @static
  15393. * @memberOf _
  15394. * @since 4.0.0
  15395. * @category String
  15396. * @param {string} [string=''] The string to modify.
  15397. * @param {RegExp|string} pattern The pattern to replace.
  15398. * @param {Function|string} replacement The match replacement.
  15399. * @returns {string} Returns the modified string.
  15400. * @example
  15401. *
  15402. * _.replace('Hi Fred', 'Fred', 'Barney');
  15403. * // => 'Hi Barney'
  15404. */
  15405. function replace() {
  15406. var args = arguments,
  15407. string = toString(args[0]);
  15408. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15409. }
  15410. /**
  15411. * Converts `string` to
  15412. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15413. *
  15414. * @static
  15415. * @memberOf _
  15416. * @since 3.0.0
  15417. * @category String
  15418. * @param {string} [string=''] The string to convert.
  15419. * @returns {string} Returns the snake cased string.
  15420. * @example
  15421. *
  15422. * _.snakeCase('Foo Bar');
  15423. * // => 'foo_bar'
  15424. *
  15425. * _.snakeCase('fooBar');
  15426. * // => 'foo_bar'
  15427. *
  15428. * _.snakeCase('--FOO-BAR--');
  15429. * // => 'foo_bar'
  15430. */
  15431. var snakeCase = createCompounder(function(result, word, index) {
  15432. return result + (index ? '_' : '') + word.toLowerCase();
  15433. });
  15434. /**
  15435. * Splits `string` by `separator`.
  15436. *
  15437. * **Note:** This method is based on
  15438. * [`String#split`](https://mdn.io/String/split).
  15439. *
  15440. * @static
  15441. * @memberOf _
  15442. * @since 4.0.0
  15443. * @category String
  15444. * @param {string} [string=''] The string to split.
  15445. * @param {RegExp|string} separator The separator pattern to split by.
  15446. * @param {number} [limit] The length to truncate results to.
  15447. * @returns {Array} Returns the string segments.
  15448. * @example
  15449. *
  15450. * _.split('a-b-c', '-', 2);
  15451. * // => ['a', 'b']
  15452. */
  15453. function split(string, separator, limit) {
  15454. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15455. separator = limit = undefined;
  15456. }
  15457. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15458. if (!limit) {
  15459. return [];
  15460. }
  15461. string = toString(string);
  15462. if (string && (
  15463. typeof separator == 'string' ||
  15464. (separator != null && !isRegExp(separator))
  15465. )) {
  15466. separator = baseToString(separator);
  15467. if (!separator && hasUnicode(string)) {
  15468. return castSlice(stringToArray(string), 0, limit);
  15469. }
  15470. }
  15471. return string.split(separator, limit);
  15472. }
  15473. /**
  15474. * Converts `string` to
  15475. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15476. *
  15477. * @static
  15478. * @memberOf _
  15479. * @since 3.1.0
  15480. * @category String
  15481. * @param {string} [string=''] The string to convert.
  15482. * @returns {string} Returns the start cased string.
  15483. * @example
  15484. *
  15485. * _.startCase('--foo-bar--');
  15486. * // => 'Foo Bar'
  15487. *
  15488. * _.startCase('fooBar');
  15489. * // => 'Foo Bar'
  15490. *
  15491. * _.startCase('__FOO_BAR__');
  15492. * // => 'FOO BAR'
  15493. */
  15494. var startCase = createCompounder(function(result, word, index) {
  15495. return result + (index ? ' ' : '') + upperFirst(word);
  15496. });
  15497. /**
  15498. * Checks if `string` starts with the given target string.
  15499. *
  15500. * @static
  15501. * @memberOf _
  15502. * @since 3.0.0
  15503. * @category String
  15504. * @param {string} [string=''] The string to inspect.
  15505. * @param {string} [target] The string to search for.
  15506. * @param {number} [position=0] The position to search from.
  15507. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15508. * else `false`.
  15509. * @example
  15510. *
  15511. * _.startsWith('abc', 'a');
  15512. * // => true
  15513. *
  15514. * _.startsWith('abc', 'b');
  15515. * // => false
  15516. *
  15517. * _.startsWith('abc', 'b', 1);
  15518. * // => true
  15519. */
  15520. function startsWith(string, target, position) {
  15521. string = toString(string);
  15522. position = position == null
  15523. ? 0
  15524. : baseClamp(toInteger(position), 0, string.length);
  15525. target = baseToString(target);
  15526. return string.slice(position, position + target.length) == target;
  15527. }
  15528. /**
  15529. * Creates a compiled template function that can interpolate data properties
  15530. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15531. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15532. * properties may be accessed as free variables in the template. If a setting
  15533. * object is given, it takes precedence over `_.templateSettings` values.
  15534. *
  15535. * **Note:** In the development build `_.template` utilizes
  15536. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15537. * for easier debugging.
  15538. *
  15539. * For more information on precompiling templates see
  15540. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15541. *
  15542. * For more information on Chrome extension sandboxes see
  15543. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15544. *
  15545. * @static
  15546. * @since 0.1.0
  15547. * @memberOf _
  15548. * @category String
  15549. * @param {string} [string=''] The template string.
  15550. * @param {Object} [options={}] The options object.
  15551. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15552. * The HTML "escape" delimiter.
  15553. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15554. * The "evaluate" delimiter.
  15555. * @param {Object} [options.imports=_.templateSettings.imports]
  15556. * An object to import into the template as free variables.
  15557. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15558. * The "interpolate" delimiter.
  15559. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15560. * The sourceURL of the compiled template.
  15561. * @param {string} [options.variable='obj']
  15562. * The data object variable name.
  15563. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15564. * @returns {Function} Returns the compiled template function.
  15565. * @example
  15566. *
  15567. * // Use the "interpolate" delimiter to create a compiled template.
  15568. * var compiled = _.template('hello <%= user %>!');
  15569. * compiled({ 'user': 'fred' });
  15570. * // => 'hello fred!'
  15571. *
  15572. * // Use the HTML "escape" delimiter to escape data property values.
  15573. * var compiled = _.template('<b><%- value %></b>');
  15574. * compiled({ 'value': '<script>' });
  15575. * // => '<b>&lt;script&gt;</b>'
  15576. *
  15577. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15578. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15579. * compiled({ 'users': ['fred', 'barney'] });
  15580. * // => '<li>fred</li><li>barney</li>'
  15581. *
  15582. * // Use the internal `print` function in "evaluate" delimiters.
  15583. * var compiled = _.template('<% print("hello " + user); %>!');
  15584. * compiled({ 'user': 'barney' });
  15585. * // => 'hello barney!'
  15586. *
  15587. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15588. * // Disable support by replacing the "interpolate" delimiter.
  15589. * var compiled = _.template('hello ${ user }!');
  15590. * compiled({ 'user': 'pebbles' });
  15591. * // => 'hello pebbles!'
  15592. *
  15593. * // Use backslashes to treat delimiters as plain text.
  15594. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15595. * compiled({ 'value': 'ignored' });
  15596. * // => '<%- value %>'
  15597. *
  15598. * // Use the `imports` option to import `jQuery` as `jq`.
  15599. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15600. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15601. * compiled({ 'users': ['fred', 'barney'] });
  15602. * // => '<li>fred</li><li>barney</li>'
  15603. *
  15604. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15605. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15606. * compiled(data);
  15607. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15608. *
  15609. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15610. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15611. * compiled.source;
  15612. * // => function(data) {
  15613. * // var __t, __p = '';
  15614. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15615. * // return __p;
  15616. * // }
  15617. *
  15618. * // Use custom template delimiters.
  15619. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15620. * var compiled = _.template('hello {{ user }}!');
  15621. * compiled({ 'user': 'mustache' });
  15622. * // => 'hello mustache!'
  15623. *
  15624. * // Use the `source` property to inline compiled templates for meaningful
  15625. * // line numbers in error messages and stack traces.
  15626. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15627. * var JST = {\
  15628. * "main": ' + _.template(mainText).source + '\
  15629. * };\
  15630. * ');
  15631. */
  15632. function template(string, options, guard) {
  15633. // Based on John Resig's `tmpl` implementation
  15634. // (http://ejohn.org/blog/javascript-micro-templating/)
  15635. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15636. var settings = lodash.templateSettings;
  15637. if (guard && isIterateeCall(string, options, guard)) {
  15638. options = undefined;
  15639. }
  15640. string = toString(string);
  15641. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15642. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15643. importsKeys = keys(imports),
  15644. importsValues = baseValues(imports, importsKeys);
  15645. var isEscaping,
  15646. isEvaluating,
  15647. index = 0,
  15648. interpolate = options.interpolate || reNoMatch,
  15649. source = "__p += '";
  15650. // Compile the regexp to match each delimiter.
  15651. var reDelimiters = RegExp(
  15652. (options.escape || reNoMatch).source + '|' +
  15653. interpolate.source + '|' +
  15654. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15655. (options.evaluate || reNoMatch).source + '|$'
  15656. , 'g');
  15657. // Use a sourceURL for easier debugging.
  15658. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15659. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15660. // and escape the comment, thus injecting code that gets evaled.
  15661. var sourceURL = '//# sourceURL=' +
  15662. (hasOwnProperty.call(options, 'sourceURL')
  15663. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15664. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15665. ) + '\n';
  15666. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15667. interpolateValue || (interpolateValue = esTemplateValue);
  15668. // Escape characters that can't be included in string literals.
  15669. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15670. // Replace delimiters with snippets.
  15671. if (escapeValue) {
  15672. isEscaping = true;
  15673. source += "' +\n__e(" + escapeValue + ") +\n'";
  15674. }
  15675. if (evaluateValue) {
  15676. isEvaluating = true;
  15677. source += "';\n" + evaluateValue + ";\n__p += '";
  15678. }
  15679. if (interpolateValue) {
  15680. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15681. }
  15682. index = offset + match.length;
  15683. // The JS engine embedded in Adobe products needs `match` returned in
  15684. // order to produce the correct `offset` value.
  15685. return match;
  15686. });
  15687. source += "';\n";
  15688. // If `variable` is not specified wrap a with-statement around the generated
  15689. // code to add the data object to the top of the scope chain.
  15690. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15691. if (!variable) {
  15692. source = 'with (obj) {\n' + source + '\n}\n';
  15693. }
  15694. // Throw an error if a forbidden character was found in `variable`, to prevent
  15695. // potential command injection attacks.
  15696. else if (reForbiddenIdentifierChars.test(variable)) {
  15697. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15698. }
  15699. // Cleanup code by stripping empty strings.
  15700. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15701. .replace(reEmptyStringMiddle, '$1')
  15702. .replace(reEmptyStringTrailing, '$1;');
  15703. // Frame code as the function body.
  15704. source = 'function(' + (variable || 'obj') + ') {\n' +
  15705. (variable
  15706. ? ''
  15707. : 'obj || (obj = {});\n'
  15708. ) +
  15709. "var __t, __p = ''" +
  15710. (isEscaping
  15711. ? ', __e = _.escape'
  15712. : ''
  15713. ) +
  15714. (isEvaluating
  15715. ? ', __j = Array.prototype.join;\n' +
  15716. "function print() { __p += __j.call(arguments, '') }\n"
  15717. : ';\n'
  15718. ) +
  15719. source +
  15720. 'return __p\n}';
  15721. var result = attempt(function() {
  15722. return Function(importsKeys, sourceURL + 'return ' + source)
  15723. .apply(undefined, importsValues);
  15724. });
  15725. // Provide the compiled function's source by its `toString` method or
  15726. // the `source` property as a convenience for inlining compiled templates.
  15727. result.source = source;
  15728. if (isError(result)) {
  15729. throw result;
  15730. }
  15731. return result;
  15732. }
  15733. /**
  15734. * Converts `string`, as a whole, to lower case just like
  15735. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15736. *
  15737. * @static
  15738. * @memberOf _
  15739. * @since 4.0.0
  15740. * @category String
  15741. * @param {string} [string=''] The string to convert.
  15742. * @returns {string} Returns the lower cased string.
  15743. * @example
  15744. *
  15745. * _.toLower('--Foo-Bar--');
  15746. * // => '--foo-bar--'
  15747. *
  15748. * _.toLower('fooBar');
  15749. * // => 'foobar'
  15750. *
  15751. * _.toLower('__FOO_BAR__');
  15752. * // => '__foo_bar__'
  15753. */
  15754. function toLower(value) {
  15755. return toString(value).toLowerCase();
  15756. }
  15757. /**
  15758. * Converts `string`, as a whole, to upper case just like
  15759. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15760. *
  15761. * @static
  15762. * @memberOf _
  15763. * @since 4.0.0
  15764. * @category String
  15765. * @param {string} [string=''] The string to convert.
  15766. * @returns {string} Returns the upper cased string.
  15767. * @example
  15768. *
  15769. * _.toUpper('--foo-bar--');
  15770. * // => '--FOO-BAR--'
  15771. *
  15772. * _.toUpper('fooBar');
  15773. * // => 'FOOBAR'
  15774. *
  15775. * _.toUpper('__foo_bar__');
  15776. * // => '__FOO_BAR__'
  15777. */
  15778. function toUpper(value) {
  15779. return toString(value).toUpperCase();
  15780. }
  15781. /**
  15782. * Removes leading and trailing whitespace or specified characters from `string`.
  15783. *
  15784. * @static
  15785. * @memberOf _
  15786. * @since 3.0.0
  15787. * @category String
  15788. * @param {string} [string=''] The string to trim.
  15789. * @param {string} [chars=whitespace] The characters to trim.
  15790. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15791. * @returns {string} Returns the trimmed string.
  15792. * @example
  15793. *
  15794. * _.trim(' abc ');
  15795. * // => 'abc'
  15796. *
  15797. * _.trim('-_-abc-_-', '_-');
  15798. * // => 'abc'
  15799. *
  15800. * _.map([' foo ', ' bar '], _.trim);
  15801. * // => ['foo', 'bar']
  15802. */
  15803. function trim(string, chars, guard) {
  15804. string = toString(string);
  15805. if (string && (guard || chars === undefined)) {
  15806. return baseTrim(string);
  15807. }
  15808. if (!string || !(chars = baseToString(chars))) {
  15809. return string;
  15810. }
  15811. var strSymbols = stringToArray(string),
  15812. chrSymbols = stringToArray(chars),
  15813. start = charsStartIndex(strSymbols, chrSymbols),
  15814. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15815. return castSlice(strSymbols, start, end).join('');
  15816. }
  15817. /**
  15818. * Removes trailing whitespace or specified characters from `string`.
  15819. *
  15820. * @static
  15821. * @memberOf _
  15822. * @since 4.0.0
  15823. * @category String
  15824. * @param {string} [string=''] The string to trim.
  15825. * @param {string} [chars=whitespace] The characters to trim.
  15826. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15827. * @returns {string} Returns the trimmed string.
  15828. * @example
  15829. *
  15830. * _.trimEnd(' abc ');
  15831. * // => ' abc'
  15832. *
  15833. * _.trimEnd('-_-abc-_-', '_-');
  15834. * // => '-_-abc'
  15835. */
  15836. function trimEnd(string, chars, guard) {
  15837. string = toString(string);
  15838. if (string && (guard || chars === undefined)) {
  15839. return string.slice(0, trimmedEndIndex(string) + 1);
  15840. }
  15841. if (!string || !(chars = baseToString(chars))) {
  15842. return string;
  15843. }
  15844. var strSymbols = stringToArray(string),
  15845. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15846. return castSlice(strSymbols, 0, end).join('');
  15847. }
  15848. /**
  15849. * Removes leading whitespace or specified characters from `string`.
  15850. *
  15851. * @static
  15852. * @memberOf _
  15853. * @since 4.0.0
  15854. * @category String
  15855. * @param {string} [string=''] The string to trim.
  15856. * @param {string} [chars=whitespace] The characters to trim.
  15857. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15858. * @returns {string} Returns the trimmed string.
  15859. * @example
  15860. *
  15861. * _.trimStart(' abc ');
  15862. * // => 'abc '
  15863. *
  15864. * _.trimStart('-_-abc-_-', '_-');
  15865. * // => 'abc-_-'
  15866. */
  15867. function trimStart(string, chars, guard) {
  15868. string = toString(string);
  15869. if (string && (guard || chars === undefined)) {
  15870. return string.replace(reTrimStart, '');
  15871. }
  15872. if (!string || !(chars = baseToString(chars))) {
  15873. return string;
  15874. }
  15875. var strSymbols = stringToArray(string),
  15876. start = charsStartIndex(strSymbols, stringToArray(chars));
  15877. return castSlice(strSymbols, start).join('');
  15878. }
  15879. /**
  15880. * Truncates `string` if it's longer than the given maximum string length.
  15881. * The last characters of the truncated string are replaced with the omission
  15882. * string which defaults to "...".
  15883. *
  15884. * @static
  15885. * @memberOf _
  15886. * @since 4.0.0
  15887. * @category String
  15888. * @param {string} [string=''] The string to truncate.
  15889. * @param {Object} [options={}] The options object.
  15890. * @param {number} [options.length=30] The maximum string length.
  15891. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15892. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15893. * @returns {string} Returns the truncated string.
  15894. * @example
  15895. *
  15896. * _.truncate('hi-diddly-ho there, neighborino');
  15897. * // => 'hi-diddly-ho there, neighbo...'
  15898. *
  15899. * _.truncate('hi-diddly-ho there, neighborino', {
  15900. * 'length': 24,
  15901. * 'separator': ' '
  15902. * });
  15903. * // => 'hi-diddly-ho there,...'
  15904. *
  15905. * _.truncate('hi-diddly-ho there, neighborino', {
  15906. * 'length': 24,
  15907. * 'separator': /,? +/
  15908. * });
  15909. * // => 'hi-diddly-ho there...'
  15910. *
  15911. * _.truncate('hi-diddly-ho there, neighborino', {
  15912. * 'omission': ' [...]'
  15913. * });
  15914. * // => 'hi-diddly-ho there, neig [...]'
  15915. */
  15916. function truncate(string, options) {
  15917. var length = DEFAULT_TRUNC_LENGTH,
  15918. omission = DEFAULT_TRUNC_OMISSION;
  15919. if (isObject(options)) {
  15920. var separator = 'separator' in options ? options.separator : separator;
  15921. length = 'length' in options ? toInteger(options.length) : length;
  15922. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15923. }
  15924. string = toString(string);
  15925. var strLength = string.length;
  15926. if (hasUnicode(string)) {
  15927. var strSymbols = stringToArray(string);
  15928. strLength = strSymbols.length;
  15929. }
  15930. if (length >= strLength) {
  15931. return string;
  15932. }
  15933. var end = length - stringSize(omission);
  15934. if (end < 1) {
  15935. return omission;
  15936. }
  15937. var result = strSymbols
  15938. ? castSlice(strSymbols, 0, end).join('')
  15939. : string.slice(0, end);
  15940. if (separator === undefined) {
  15941. return result + omission;
  15942. }
  15943. if (strSymbols) {
  15944. end += (result.length - end);
  15945. }
  15946. if (isRegExp(separator)) {
  15947. if (string.slice(end).search(separator)) {
  15948. var match,
  15949. substring = result;
  15950. if (!separator.global) {
  15951. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15952. }
  15953. separator.lastIndex = 0;
  15954. while ((match = separator.exec(substring))) {
  15955. var newEnd = match.index;
  15956. }
  15957. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15958. }
  15959. } else if (string.indexOf(baseToString(separator), end) != end) {
  15960. var index = result.lastIndexOf(separator);
  15961. if (index > -1) {
  15962. result = result.slice(0, index);
  15963. }
  15964. }
  15965. return result + omission;
  15966. }
  15967. /**
  15968. * The inverse of `_.escape`; this method converts the HTML entities
  15969. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15970. * their corresponding characters.
  15971. *
  15972. * **Note:** No other HTML entities are unescaped. To unescape additional
  15973. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15974. *
  15975. * @static
  15976. * @memberOf _
  15977. * @since 0.6.0
  15978. * @category String
  15979. * @param {string} [string=''] The string to unescape.
  15980. * @returns {string} Returns the unescaped string.
  15981. * @example
  15982. *
  15983. * _.unescape('fred, barney, &amp; pebbles');
  15984. * // => 'fred, barney, & pebbles'
  15985. */
  15986. function unescape(string) {
  15987. string = toString(string);
  15988. return (string && reHasEscapedHtml.test(string))
  15989. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15990. : string;
  15991. }
  15992. /**
  15993. * Converts `string`, as space separated words, to upper case.
  15994. *
  15995. * @static
  15996. * @memberOf _
  15997. * @since 4.0.0
  15998. * @category String
  15999. * @param {string} [string=''] The string to convert.
  16000. * @returns {string} Returns the upper cased string.
  16001. * @example
  16002. *
  16003. * _.upperCase('--foo-bar');
  16004. * // => 'FOO BAR'
  16005. *
  16006. * _.upperCase('fooBar');
  16007. * // => 'FOO BAR'
  16008. *
  16009. * _.upperCase('__foo_bar__');
  16010. * // => 'FOO BAR'
  16011. */
  16012. var upperCase = createCompounder(function(result, word, index) {
  16013. return result + (index ? ' ' : '') + word.toUpperCase();
  16014. });
  16015. /**
  16016. * Converts the first character of `string` to upper case.
  16017. *
  16018. * @static
  16019. * @memberOf _
  16020. * @since 4.0.0
  16021. * @category String
  16022. * @param {string} [string=''] The string to convert.
  16023. * @returns {string} Returns the converted string.
  16024. * @example
  16025. *
  16026. * _.upperFirst('fred');
  16027. * // => 'Fred'
  16028. *
  16029. * _.upperFirst('FRED');
  16030. * // => 'FRED'
  16031. */
  16032. var upperFirst = createCaseFirst('toUpperCase');
  16033. /**
  16034. * Splits `string` into an array of its words.
  16035. *
  16036. * @static
  16037. * @memberOf _
  16038. * @since 3.0.0
  16039. * @category String
  16040. * @param {string} [string=''] The string to inspect.
  16041. * @param {RegExp|string} [pattern] The pattern to match words.
  16042. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16043. * @returns {Array} Returns the words of `string`.
  16044. * @example
  16045. *
  16046. * _.words('fred, barney, & pebbles');
  16047. * // => ['fred', 'barney', 'pebbles']
  16048. *
  16049. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  16050. * // => ['fred', 'barney', '&', 'pebbles']
  16051. */
  16052. function words(string, pattern, guard) {
  16053. string = toString(string);
  16054. pattern = guard ? undefined : pattern;
  16055. if (pattern === undefined) {
  16056. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  16057. }
  16058. return string.match(pattern) || [];
  16059. }
  16060. /*------------------------------------------------------------------------*/
  16061. /**
  16062. * Attempts to invoke `func`, returning either the result or the caught error
  16063. * object. Any additional arguments are provided to `func` when it's invoked.
  16064. *
  16065. * @static
  16066. * @memberOf _
  16067. * @since 3.0.0
  16068. * @category Util
  16069. * @param {Function} func The function to attempt.
  16070. * @param {...*} [args] The arguments to invoke `func` with.
  16071. * @returns {*} Returns the `func` result or error object.
  16072. * @example
  16073. *
  16074. * // Avoid throwing errors for invalid selectors.
  16075. * var elements = _.attempt(function(selector) {
  16076. * return document.querySelectorAll(selector);
  16077. * }, '>_>');
  16078. *
  16079. * if (_.isError(elements)) {
  16080. * elements = [];
  16081. * }
  16082. */
  16083. var attempt = baseRest(function(func, args) {
  16084. try {
  16085. return apply(func, undefined, args);
  16086. } catch (e) {
  16087. return isError(e) ? e : new Error(e);
  16088. }
  16089. });
  16090. /**
  16091. * Binds methods of an object to the object itself, overwriting the existing
  16092. * method.
  16093. *
  16094. * **Note:** This method doesn't set the "length" property of bound functions.
  16095. *
  16096. * @static
  16097. * @since 0.1.0
  16098. * @memberOf _
  16099. * @category Util
  16100. * @param {Object} object The object to bind and assign the bound methods to.
  16101. * @param {...(string|string[])} methodNames The object method names to bind.
  16102. * @returns {Object} Returns `object`.
  16103. * @example
  16104. *
  16105. * var view = {
  16106. * 'label': 'docs',
  16107. * 'click': function() {
  16108. * console.log('clicked ' + this.label);
  16109. * }
  16110. * };
  16111. *
  16112. * _.bindAll(view, ['click']);
  16113. * jQuery(element).on('click', view.click);
  16114. * // => Logs 'clicked docs' when clicked.
  16115. */
  16116. var bindAll = flatRest(function(object, methodNames) {
  16117. arrayEach(methodNames, function(key) {
  16118. key = toKey(key);
  16119. baseAssignValue(object, key, bind(object[key], object));
  16120. });
  16121. return object;
  16122. });
  16123. /**
  16124. * Creates a function that iterates over `pairs` and invokes the corresponding
  16125. * function of the first predicate to return truthy. The predicate-function
  16126. * pairs are invoked with the `this` binding and arguments of the created
  16127. * function.
  16128. *
  16129. * @static
  16130. * @memberOf _
  16131. * @since 4.0.0
  16132. * @category Util
  16133. * @param {Array} pairs The predicate-function pairs.
  16134. * @returns {Function} Returns the new composite function.
  16135. * @example
  16136. *
  16137. * var func = _.cond([
  16138. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  16139. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  16140. * [_.stubTrue, _.constant('no match')]
  16141. * ]);
  16142. *
  16143. * func({ 'a': 1, 'b': 2 });
  16144. * // => 'matches A'
  16145. *
  16146. * func({ 'a': 0, 'b': 1 });
  16147. * // => 'matches B'
  16148. *
  16149. * func({ 'a': '1', 'b': '2' });
  16150. * // => 'no match'
  16151. */
  16152. function cond(pairs) {
  16153. var length = pairs == null ? 0 : pairs.length,
  16154. toIteratee = getIteratee();
  16155. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  16156. if (typeof pair[1] != 'function') {
  16157. throw new TypeError(FUNC_ERROR_TEXT);
  16158. }
  16159. return [toIteratee(pair[0]), pair[1]];
  16160. });
  16161. return baseRest(function(args) {
  16162. var index = -1;
  16163. while (++index < length) {
  16164. var pair = pairs[index];
  16165. if (apply(pair[0], this, args)) {
  16166. return apply(pair[1], this, args);
  16167. }
  16168. }
  16169. });
  16170. }
  16171. /**
  16172. * Creates a function that invokes the predicate properties of `source` with
  16173. * the corresponding property values of a given object, returning `true` if
  16174. * all predicates return truthy, else `false`.
  16175. *
  16176. * **Note:** The created function is equivalent to `_.conformsTo` with
  16177. * `source` partially applied.
  16178. *
  16179. * @static
  16180. * @memberOf _
  16181. * @since 4.0.0
  16182. * @category Util
  16183. * @param {Object} source The object of property predicates to conform to.
  16184. * @returns {Function} Returns the new spec function.
  16185. * @example
  16186. *
  16187. * var objects = [
  16188. * { 'a': 2, 'b': 1 },
  16189. * { 'a': 1, 'b': 2 }
  16190. * ];
  16191. *
  16192. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  16193. * // => [{ 'a': 1, 'b': 2 }]
  16194. */
  16195. function conforms(source) {
  16196. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  16197. }
  16198. /**
  16199. * Creates a function that returns `value`.
  16200. *
  16201. * @static
  16202. * @memberOf _
  16203. * @since 2.4.0
  16204. * @category Util
  16205. * @param {*} value The value to return from the new function.
  16206. * @returns {Function} Returns the new constant function.
  16207. * @example
  16208. *
  16209. * var objects = _.times(2, _.constant({ 'a': 1 }));
  16210. *
  16211. * console.log(objects);
  16212. * // => [{ 'a': 1 }, { 'a': 1 }]
  16213. *
  16214. * console.log(objects[0] === objects[1]);
  16215. * // => true
  16216. */
  16217. function constant(value) {
  16218. return function() {
  16219. return value;
  16220. };
  16221. }
  16222. /**
  16223. * Checks `value` to determine whether a default value should be returned in
  16224. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  16225. * or `undefined`.
  16226. *
  16227. * @static
  16228. * @memberOf _
  16229. * @since 4.14.0
  16230. * @category Util
  16231. * @param {*} value The value to check.
  16232. * @param {*} defaultValue The default value.
  16233. * @returns {*} Returns the resolved value.
  16234. * @example
  16235. *
  16236. * _.defaultTo(1, 10);
  16237. * // => 1
  16238. *
  16239. * _.defaultTo(undefined, 10);
  16240. * // => 10
  16241. */
  16242. function defaultTo(value, defaultValue) {
  16243. return (value == null || value !== value) ? defaultValue : value;
  16244. }
  16245. /**
  16246. * Creates a function that returns the result of invoking the given functions
  16247. * with the `this` binding of the created function, where each successive
  16248. * invocation is supplied the return value of the previous.
  16249. *
  16250. * @static
  16251. * @memberOf _
  16252. * @since 3.0.0
  16253. * @category Util
  16254. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16255. * @returns {Function} Returns the new composite function.
  16256. * @see _.flowRight
  16257. * @example
  16258. *
  16259. * function square(n) {
  16260. * return n * n;
  16261. * }
  16262. *
  16263. * var addSquare = _.flow([_.add, square]);
  16264. * addSquare(1, 2);
  16265. * // => 9
  16266. */
  16267. var flow = createFlow();
  16268. /**
  16269. * This method is like `_.flow` except that it creates a function that
  16270. * invokes the given functions from right to left.
  16271. *
  16272. * @static
  16273. * @since 3.0.0
  16274. * @memberOf _
  16275. * @category Util
  16276. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16277. * @returns {Function} Returns the new composite function.
  16278. * @see _.flow
  16279. * @example
  16280. *
  16281. * function square(n) {
  16282. * return n * n;
  16283. * }
  16284. *
  16285. * var addSquare = _.flowRight([square, _.add]);
  16286. * addSquare(1, 2);
  16287. * // => 9
  16288. */
  16289. var flowRight = createFlow(true);
  16290. /**
  16291. * This method returns the first argument it receives.
  16292. *
  16293. * @static
  16294. * @since 0.1.0
  16295. * @memberOf _
  16296. * @category Util
  16297. * @param {*} value Any value.
  16298. * @returns {*} Returns `value`.
  16299. * @example
  16300. *
  16301. * var object = { 'a': 1 };
  16302. *
  16303. * console.log(_.identity(object) === object);
  16304. * // => true
  16305. */
  16306. function identity(value) {
  16307. return value;
  16308. }
  16309. /**
  16310. * Creates a function that invokes `func` with the arguments of the created
  16311. * function. If `func` is a property name, the created function returns the
  16312. * property value for a given element. If `func` is an array or object, the
  16313. * created function returns `true` for elements that contain the equivalent
  16314. * source properties, otherwise it returns `false`.
  16315. *
  16316. * @static
  16317. * @since 4.0.0
  16318. * @memberOf _
  16319. * @category Util
  16320. * @param {*} [func=_.identity] The value to convert to a callback.
  16321. * @returns {Function} Returns the callback.
  16322. * @example
  16323. *
  16324. * var users = [
  16325. * { 'user': 'barney', 'age': 36, 'active': true },
  16326. * { 'user': 'fred', 'age': 40, 'active': false }
  16327. * ];
  16328. *
  16329. * // The `_.matches` iteratee shorthand.
  16330. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  16331. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  16332. *
  16333. * // The `_.matchesProperty` iteratee shorthand.
  16334. * _.filter(users, _.iteratee(['user', 'fred']));
  16335. * // => [{ 'user': 'fred', 'age': 40 }]
  16336. *
  16337. * // The `_.property` iteratee shorthand.
  16338. * _.map(users, _.iteratee('user'));
  16339. * // => ['barney', 'fred']
  16340. *
  16341. * // Create custom iteratee shorthands.
  16342. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  16343. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  16344. * return func.test(string);
  16345. * };
  16346. * });
  16347. *
  16348. * _.filter(['abc', 'def'], /ef/);
  16349. * // => ['def']
  16350. */
  16351. function iteratee(func) {
  16352. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  16353. }
  16354. /**
  16355. * Creates a function that performs a partial deep comparison between a given
  16356. * object and `source`, returning `true` if the given object has equivalent
  16357. * property values, else `false`.
  16358. *
  16359. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  16360. * partially applied.
  16361. *
  16362. * Partial comparisons will match empty array and empty object `source`
  16363. * values against any array or object value, respectively. See `_.isEqual`
  16364. * for a list of supported value comparisons.
  16365. *
  16366. * **Note:** Multiple values can be checked by combining several matchers
  16367. * using `_.overSome`
  16368. *
  16369. * @static
  16370. * @memberOf _
  16371. * @since 3.0.0
  16372. * @category Util
  16373. * @param {Object} source The object of property values to match.
  16374. * @returns {Function} Returns the new spec function.
  16375. * @example
  16376. *
  16377. * var objects = [
  16378. * { 'a': 1, 'b': 2, 'c': 3 },
  16379. * { 'a': 4, 'b': 5, 'c': 6 }
  16380. * ];
  16381. *
  16382. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  16383. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  16384. *
  16385. * // Checking for several possible values
  16386. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16387. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16388. */
  16389. function matches(source) {
  16390. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16391. }
  16392. /**
  16393. * Creates a function that performs a partial deep comparison between the
  16394. * value at `path` of a given object to `srcValue`, returning `true` if the
  16395. * object value is equivalent, else `false`.
  16396. *
  16397. * **Note:** Partial comparisons will match empty array and empty object
  16398. * `srcValue` values against any array or object value, respectively. See
  16399. * `_.isEqual` for a list of supported value comparisons.
  16400. *
  16401. * **Note:** Multiple values can be checked by combining several matchers
  16402. * using `_.overSome`
  16403. *
  16404. * @static
  16405. * @memberOf _
  16406. * @since 3.2.0
  16407. * @category Util
  16408. * @param {Array|string} path The path of the property to get.
  16409. * @param {*} srcValue The value to match.
  16410. * @returns {Function} Returns the new spec function.
  16411. * @example
  16412. *
  16413. * var objects = [
  16414. * { 'a': 1, 'b': 2, 'c': 3 },
  16415. * { 'a': 4, 'b': 5, 'c': 6 }
  16416. * ];
  16417. *
  16418. * _.find(objects, _.matchesProperty('a', 4));
  16419. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16420. *
  16421. * // Checking for several possible values
  16422. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16423. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16424. */
  16425. function matchesProperty(path, srcValue) {
  16426. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16427. }
  16428. /**
  16429. * Creates a function that invokes the method at `path` of a given object.
  16430. * Any additional arguments are provided to the invoked method.
  16431. *
  16432. * @static
  16433. * @memberOf _
  16434. * @since 3.7.0
  16435. * @category Util
  16436. * @param {Array|string} path The path of the method to invoke.
  16437. * @param {...*} [args] The arguments to invoke the method with.
  16438. * @returns {Function} Returns the new invoker function.
  16439. * @example
  16440. *
  16441. * var objects = [
  16442. * { 'a': { 'b': _.constant(2) } },
  16443. * { 'a': { 'b': _.constant(1) } }
  16444. * ];
  16445. *
  16446. * _.map(objects, _.method('a.b'));
  16447. * // => [2, 1]
  16448. *
  16449. * _.map(objects, _.method(['a', 'b']));
  16450. * // => [2, 1]
  16451. */
  16452. var method = baseRest(function(path, args) {
  16453. return function(object) {
  16454. return baseInvoke(object, path, args);
  16455. };
  16456. });
  16457. /**
  16458. * The opposite of `_.method`; this method creates a function that invokes
  16459. * the method at a given path of `object`. Any additional arguments are
  16460. * provided to the invoked method.
  16461. *
  16462. * @static
  16463. * @memberOf _
  16464. * @since 3.7.0
  16465. * @category Util
  16466. * @param {Object} object The object to query.
  16467. * @param {...*} [args] The arguments to invoke the method with.
  16468. * @returns {Function} Returns the new invoker function.
  16469. * @example
  16470. *
  16471. * var array = _.times(3, _.constant),
  16472. * object = { 'a': array, 'b': array, 'c': array };
  16473. *
  16474. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16475. * // => [2, 0]
  16476. *
  16477. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16478. * // => [2, 0]
  16479. */
  16480. var methodOf = baseRest(function(object, args) {
  16481. return function(path) {
  16482. return baseInvoke(object, path, args);
  16483. };
  16484. });
  16485. /**
  16486. * Adds all own enumerable string keyed function properties of a source
  16487. * object to the destination object. If `object` is a function, then methods
  16488. * are added to its prototype as well.
  16489. *
  16490. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16491. * avoid conflicts caused by modifying the original.
  16492. *
  16493. * @static
  16494. * @since 0.1.0
  16495. * @memberOf _
  16496. * @category Util
  16497. * @param {Function|Object} [object=lodash] The destination object.
  16498. * @param {Object} source The object of functions to add.
  16499. * @param {Object} [options={}] The options object.
  16500. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16501. * @returns {Function|Object} Returns `object`.
  16502. * @example
  16503. *
  16504. * function vowels(string) {
  16505. * return _.filter(string, function(v) {
  16506. * return /[aeiou]/i.test(v);
  16507. * });
  16508. * }
  16509. *
  16510. * _.mixin({ 'vowels': vowels });
  16511. * _.vowels('fred');
  16512. * // => ['e']
  16513. *
  16514. * _('fred').vowels().value();
  16515. * // => ['e']
  16516. *
  16517. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16518. * _('fred').vowels();
  16519. * // => ['e']
  16520. */
  16521. function mixin(object, source, options) {
  16522. var props = keys(source),
  16523. methodNames = baseFunctions(source, props);
  16524. if (options == null &&
  16525. !(isObject(source) && (methodNames.length || !props.length))) {
  16526. options = source;
  16527. source = object;
  16528. object = this;
  16529. methodNames = baseFunctions(source, keys(source));
  16530. }
  16531. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16532. isFunc = isFunction(object);
  16533. arrayEach(methodNames, function(methodName) {
  16534. var func = source[methodName];
  16535. object[methodName] = func;
  16536. if (isFunc) {
  16537. object.prototype[methodName] = function() {
  16538. var chainAll = this.__chain__;
  16539. if (chain || chainAll) {
  16540. var result = object(this.__wrapped__),
  16541. actions = result.__actions__ = copyArray(this.__actions__);
  16542. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16543. result.__chain__ = chainAll;
  16544. return result;
  16545. }
  16546. return func.apply(object, arrayPush([this.value()], arguments));
  16547. };
  16548. }
  16549. });
  16550. return object;
  16551. }
  16552. /**
  16553. * Reverts the `_` variable to its previous value and returns a reference to
  16554. * the `lodash` function.
  16555. *
  16556. * @static
  16557. * @since 0.1.0
  16558. * @memberOf _
  16559. * @category Util
  16560. * @returns {Function} Returns the `lodash` function.
  16561. * @example
  16562. *
  16563. * var lodash = _.noConflict();
  16564. */
  16565. function noConflict() {
  16566. if (root._ === this) {
  16567. root._ = oldDash;
  16568. }
  16569. return this;
  16570. }
  16571. /**
  16572. * This method returns `undefined`.
  16573. *
  16574. * @static
  16575. * @memberOf _
  16576. * @since 2.3.0
  16577. * @category Util
  16578. * @example
  16579. *
  16580. * _.times(2, _.noop);
  16581. * // => [undefined, undefined]
  16582. */
  16583. function noop() {
  16584. // No operation performed.
  16585. }
  16586. /**
  16587. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16588. * the nth argument from the end is returned.
  16589. *
  16590. * @static
  16591. * @memberOf _
  16592. * @since 4.0.0
  16593. * @category Util
  16594. * @param {number} [n=0] The index of the argument to return.
  16595. * @returns {Function} Returns the new pass-thru function.
  16596. * @example
  16597. *
  16598. * var func = _.nthArg(1);
  16599. * func('a', 'b', 'c', 'd');
  16600. * // => 'b'
  16601. *
  16602. * var func = _.nthArg(-2);
  16603. * func('a', 'b', 'c', 'd');
  16604. * // => 'c'
  16605. */
  16606. function nthArg(n) {
  16607. n = toInteger(n);
  16608. return baseRest(function(args) {
  16609. return baseNth(args, n);
  16610. });
  16611. }
  16612. /**
  16613. * Creates a function that invokes `iteratees` with the arguments it receives
  16614. * and returns their results.
  16615. *
  16616. * @static
  16617. * @memberOf _
  16618. * @since 4.0.0
  16619. * @category Util
  16620. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16621. * The iteratees to invoke.
  16622. * @returns {Function} Returns the new function.
  16623. * @example
  16624. *
  16625. * var func = _.over([Math.max, Math.min]);
  16626. *
  16627. * func(1, 2, 3, 4);
  16628. * // => [4, 1]
  16629. */
  16630. var over = createOver(arrayMap);
  16631. /**
  16632. * Creates a function that checks if **all** of the `predicates` return
  16633. * truthy when invoked with the arguments it receives.
  16634. *
  16635. * Following shorthands are possible for providing predicates.
  16636. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16637. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16638. *
  16639. * @static
  16640. * @memberOf _
  16641. * @since 4.0.0
  16642. * @category Util
  16643. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16644. * The predicates to check.
  16645. * @returns {Function} Returns the new function.
  16646. * @example
  16647. *
  16648. * var func = _.overEvery([Boolean, isFinite]);
  16649. *
  16650. * func('1');
  16651. * // => true
  16652. *
  16653. * func(null);
  16654. * // => false
  16655. *
  16656. * func(NaN);
  16657. * // => false
  16658. */
  16659. var overEvery = createOver(arrayEvery);
  16660. /**
  16661. * Creates a function that checks if **any** of the `predicates` return
  16662. * truthy when invoked with the arguments it receives.
  16663. *
  16664. * Following shorthands are possible for providing predicates.
  16665. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16666. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16667. *
  16668. * @static
  16669. * @memberOf _
  16670. * @since 4.0.0
  16671. * @category Util
  16672. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16673. * The predicates to check.
  16674. * @returns {Function} Returns the new function.
  16675. * @example
  16676. *
  16677. * var func = _.overSome([Boolean, isFinite]);
  16678. *
  16679. * func('1');
  16680. * // => true
  16681. *
  16682. * func(null);
  16683. * // => true
  16684. *
  16685. * func(NaN);
  16686. * // => false
  16687. *
  16688. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16689. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16690. */
  16691. var overSome = createOver(arraySome);
  16692. /**
  16693. * Creates a function that returns the value at `path` of a given object.
  16694. *
  16695. * @static
  16696. * @memberOf _
  16697. * @since 2.4.0
  16698. * @category Util
  16699. * @param {Array|string} path The path of the property to get.
  16700. * @returns {Function} Returns the new accessor function.
  16701. * @example
  16702. *
  16703. * var objects = [
  16704. * { 'a': { 'b': 2 } },
  16705. * { 'a': { 'b': 1 } }
  16706. * ];
  16707. *
  16708. * _.map(objects, _.property('a.b'));
  16709. * // => [2, 1]
  16710. *
  16711. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16712. * // => [1, 2]
  16713. */
  16714. function property(path) {
  16715. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16716. }
  16717. /**
  16718. * The opposite of `_.property`; this method creates a function that returns
  16719. * the value at a given path of `object`.
  16720. *
  16721. * @static
  16722. * @memberOf _
  16723. * @since 3.0.0
  16724. * @category Util
  16725. * @param {Object} object The object to query.
  16726. * @returns {Function} Returns the new accessor function.
  16727. * @example
  16728. *
  16729. * var array = [0, 1, 2],
  16730. * object = { 'a': array, 'b': array, 'c': array };
  16731. *
  16732. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16733. * // => [2, 0]
  16734. *
  16735. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16736. * // => [2, 0]
  16737. */
  16738. function propertyOf(object) {
  16739. return function(path) {
  16740. return object == null ? undefined : baseGet(object, path);
  16741. };
  16742. }
  16743. /**
  16744. * Creates an array of numbers (positive and/or negative) progressing from
  16745. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16746. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16747. * it's set to `start` with `start` then set to `0`.
  16748. *
  16749. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16750. * floating-point values which can produce unexpected results.
  16751. *
  16752. * @static
  16753. * @since 0.1.0
  16754. * @memberOf _
  16755. * @category Util
  16756. * @param {number} [start=0] The start of the range.
  16757. * @param {number} end The end of the range.
  16758. * @param {number} [step=1] The value to increment or decrement by.
  16759. * @returns {Array} Returns the range of numbers.
  16760. * @see _.inRange, _.rangeRight
  16761. * @example
  16762. *
  16763. * _.range(4);
  16764. * // => [0, 1, 2, 3]
  16765. *
  16766. * _.range(-4);
  16767. * // => [0, -1, -2, -3]
  16768. *
  16769. * _.range(1, 5);
  16770. * // => [1, 2, 3, 4]
  16771. *
  16772. * _.range(0, 20, 5);
  16773. * // => [0, 5, 10, 15]
  16774. *
  16775. * _.range(0, -4, -1);
  16776. * // => [0, -1, -2, -3]
  16777. *
  16778. * _.range(1, 4, 0);
  16779. * // => [1, 1, 1]
  16780. *
  16781. * _.range(0);
  16782. * // => []
  16783. */
  16784. var range = createRange();
  16785. /**
  16786. * This method is like `_.range` except that it populates values in
  16787. * descending order.
  16788. *
  16789. * @static
  16790. * @memberOf _
  16791. * @since 4.0.0
  16792. * @category Util
  16793. * @param {number} [start=0] The start of the range.
  16794. * @param {number} end The end of the range.
  16795. * @param {number} [step=1] The value to increment or decrement by.
  16796. * @returns {Array} Returns the range of numbers.
  16797. * @see _.inRange, _.range
  16798. * @example
  16799. *
  16800. * _.rangeRight(4);
  16801. * // => [3, 2, 1, 0]
  16802. *
  16803. * _.rangeRight(-4);
  16804. * // => [-3, -2, -1, 0]
  16805. *
  16806. * _.rangeRight(1, 5);
  16807. * // => [4, 3, 2, 1]
  16808. *
  16809. * _.rangeRight(0, 20, 5);
  16810. * // => [15, 10, 5, 0]
  16811. *
  16812. * _.rangeRight(0, -4, -1);
  16813. * // => [-3, -2, -1, 0]
  16814. *
  16815. * _.rangeRight(1, 4, 0);
  16816. * // => [1, 1, 1]
  16817. *
  16818. * _.rangeRight(0);
  16819. * // => []
  16820. */
  16821. var rangeRight = createRange(true);
  16822. /**
  16823. * This method returns a new empty array.
  16824. *
  16825. * @static
  16826. * @memberOf _
  16827. * @since 4.13.0
  16828. * @category Util
  16829. * @returns {Array} Returns the new empty array.
  16830. * @example
  16831. *
  16832. * var arrays = _.times(2, _.stubArray);
  16833. *
  16834. * console.log(arrays);
  16835. * // => [[], []]
  16836. *
  16837. * console.log(arrays[0] === arrays[1]);
  16838. * // => false
  16839. */
  16840. function stubArray() {
  16841. return [];
  16842. }
  16843. /**
  16844. * This method returns `false`.
  16845. *
  16846. * @static
  16847. * @memberOf _
  16848. * @since 4.13.0
  16849. * @category Util
  16850. * @returns {boolean} Returns `false`.
  16851. * @example
  16852. *
  16853. * _.times(2, _.stubFalse);
  16854. * // => [false, false]
  16855. */
  16856. function stubFalse() {
  16857. return false;
  16858. }
  16859. /**
  16860. * This method returns a new empty object.
  16861. *
  16862. * @static
  16863. * @memberOf _
  16864. * @since 4.13.0
  16865. * @category Util
  16866. * @returns {Object} Returns the new empty object.
  16867. * @example
  16868. *
  16869. * var objects = _.times(2, _.stubObject);
  16870. *
  16871. * console.log(objects);
  16872. * // => [{}, {}]
  16873. *
  16874. * console.log(objects[0] === objects[1]);
  16875. * // => false
  16876. */
  16877. function stubObject() {
  16878. return {};
  16879. }
  16880. /**
  16881. * This method returns an empty string.
  16882. *
  16883. * @static
  16884. * @memberOf _
  16885. * @since 4.13.0
  16886. * @category Util
  16887. * @returns {string} Returns the empty string.
  16888. * @example
  16889. *
  16890. * _.times(2, _.stubString);
  16891. * // => ['', '']
  16892. */
  16893. function stubString() {
  16894. return '';
  16895. }
  16896. /**
  16897. * This method returns `true`.
  16898. *
  16899. * @static
  16900. * @memberOf _
  16901. * @since 4.13.0
  16902. * @category Util
  16903. * @returns {boolean} Returns `true`.
  16904. * @example
  16905. *
  16906. * _.times(2, _.stubTrue);
  16907. * // => [true, true]
  16908. */
  16909. function stubTrue() {
  16910. return true;
  16911. }
  16912. /**
  16913. * Invokes the iteratee `n` times, returning an array of the results of
  16914. * each invocation. The iteratee is invoked with one argument; (index).
  16915. *
  16916. * @static
  16917. * @since 0.1.0
  16918. * @memberOf _
  16919. * @category Util
  16920. * @param {number} n The number of times to invoke `iteratee`.
  16921. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16922. * @returns {Array} Returns the array of results.
  16923. * @example
  16924. *
  16925. * _.times(3, String);
  16926. * // => ['0', '1', '2']
  16927. *
  16928. * _.times(4, _.constant(0));
  16929. * // => [0, 0, 0, 0]
  16930. */
  16931. function times(n, iteratee) {
  16932. n = toInteger(n);
  16933. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16934. return [];
  16935. }
  16936. var index = MAX_ARRAY_LENGTH,
  16937. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16938. iteratee = getIteratee(iteratee);
  16939. n -= MAX_ARRAY_LENGTH;
  16940. var result = baseTimes(length, iteratee);
  16941. while (++index < n) {
  16942. iteratee(index);
  16943. }
  16944. return result;
  16945. }
  16946. /**
  16947. * Converts `value` to a property path array.
  16948. *
  16949. * @static
  16950. * @memberOf _
  16951. * @since 4.0.0
  16952. * @category Util
  16953. * @param {*} value The value to convert.
  16954. * @returns {Array} Returns the new property path array.
  16955. * @example
  16956. *
  16957. * _.toPath('a.b.c');
  16958. * // => ['a', 'b', 'c']
  16959. *
  16960. * _.toPath('a[0].b.c');
  16961. * // => ['a', '0', 'b', 'c']
  16962. */
  16963. function toPath(value) {
  16964. if (isArray(value)) {
  16965. return arrayMap(value, toKey);
  16966. }
  16967. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16968. }
  16969. /**
  16970. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16971. *
  16972. * @static
  16973. * @since 0.1.0
  16974. * @memberOf _
  16975. * @category Util
  16976. * @param {string} [prefix=''] The value to prefix the ID with.
  16977. * @returns {string} Returns the unique ID.
  16978. * @example
  16979. *
  16980. * _.uniqueId('contact_');
  16981. * // => 'contact_104'
  16982. *
  16983. * _.uniqueId();
  16984. * // => '105'
  16985. */
  16986. function uniqueId(prefix) {
  16987. var id = ++idCounter;
  16988. return toString(prefix) + id;
  16989. }
  16990. /*------------------------------------------------------------------------*/
  16991. /**
  16992. * Adds two numbers.
  16993. *
  16994. * @static
  16995. * @memberOf _
  16996. * @since 3.4.0
  16997. * @category Math
  16998. * @param {number} augend The first number in an addition.
  16999. * @param {number} addend The second number in an addition.
  17000. * @returns {number} Returns the total.
  17001. * @example
  17002. *
  17003. * _.add(6, 4);
  17004. * // => 10
  17005. */
  17006. var add = createMathOperation(function(augend, addend) {
  17007. return augend + addend;
  17008. }, 0);
  17009. /**
  17010. * Computes `number` rounded up to `precision`.
  17011. *
  17012. * @static
  17013. * @memberOf _
  17014. * @since 3.10.0
  17015. * @category Math
  17016. * @param {number} number The number to round up.
  17017. * @param {number} [precision=0] The precision to round up to.
  17018. * @returns {number} Returns the rounded up number.
  17019. * @example
  17020. *
  17021. * _.ceil(4.006);
  17022. * // => 5
  17023. *
  17024. * _.ceil(6.004, 2);
  17025. * // => 6.01
  17026. *
  17027. * _.ceil(6040, -2);
  17028. * // => 6100
  17029. */
  17030. var ceil = createRound('ceil');
  17031. /**
  17032. * Divide two numbers.
  17033. *
  17034. * @static
  17035. * @memberOf _
  17036. * @since 4.7.0
  17037. * @category Math
  17038. * @param {number} dividend The first number in a division.
  17039. * @param {number} divisor The second number in a division.
  17040. * @returns {number} Returns the quotient.
  17041. * @example
  17042. *
  17043. * _.divide(6, 4);
  17044. * // => 1.5
  17045. */
  17046. var divide = createMathOperation(function(dividend, divisor) {
  17047. return dividend / divisor;
  17048. }, 1);
  17049. /**
  17050. * Computes `number` rounded down to `precision`.
  17051. *
  17052. * @static
  17053. * @memberOf _
  17054. * @since 3.10.0
  17055. * @category Math
  17056. * @param {number} number The number to round down.
  17057. * @param {number} [precision=0] The precision to round down to.
  17058. * @returns {number} Returns the rounded down number.
  17059. * @example
  17060. *
  17061. * _.floor(4.006);
  17062. * // => 4
  17063. *
  17064. * _.floor(0.046, 2);
  17065. * // => 0.04
  17066. *
  17067. * _.floor(4060, -2);
  17068. * // => 4000
  17069. */
  17070. var floor = createRound('floor');
  17071. /**
  17072. * Computes the maximum value of `array`. If `array` is empty or falsey,
  17073. * `undefined` is returned.
  17074. *
  17075. * @static
  17076. * @since 0.1.0
  17077. * @memberOf _
  17078. * @category Math
  17079. * @param {Array} array The array to iterate over.
  17080. * @returns {*} Returns the maximum value.
  17081. * @example
  17082. *
  17083. * _.max([4, 2, 8, 6]);
  17084. * // => 8
  17085. *
  17086. * _.max([]);
  17087. * // => undefined
  17088. */
  17089. function max(array) {
  17090. return (array && array.length)
  17091. ? baseExtremum(array, identity, baseGt)
  17092. : undefined;
  17093. }
  17094. /**
  17095. * This method is like `_.max` except that it accepts `iteratee` which is
  17096. * invoked for each element in `array` to generate the criterion by which
  17097. * the value is ranked. The iteratee is invoked with one argument: (value).
  17098. *
  17099. * @static
  17100. * @memberOf _
  17101. * @since 4.0.0
  17102. * @category Math
  17103. * @param {Array} array The array to iterate over.
  17104. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17105. * @returns {*} Returns the maximum value.
  17106. * @example
  17107. *
  17108. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17109. *
  17110. * _.maxBy(objects, function(o) { return o.n; });
  17111. * // => { 'n': 2 }
  17112. *
  17113. * // The `_.property` iteratee shorthand.
  17114. * _.maxBy(objects, 'n');
  17115. * // => { 'n': 2 }
  17116. */
  17117. function maxBy(array, iteratee) {
  17118. return (array && array.length)
  17119. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  17120. : undefined;
  17121. }
  17122. /**
  17123. * Computes the mean of the values in `array`.
  17124. *
  17125. * @static
  17126. * @memberOf _
  17127. * @since 4.0.0
  17128. * @category Math
  17129. * @param {Array} array The array to iterate over.
  17130. * @returns {number} Returns the mean.
  17131. * @example
  17132. *
  17133. * _.mean([4, 2, 8, 6]);
  17134. * // => 5
  17135. */
  17136. function mean(array) {
  17137. return baseMean(array, identity);
  17138. }
  17139. /**
  17140. * This method is like `_.mean` except that it accepts `iteratee` which is
  17141. * invoked for each element in `array` to generate the value to be averaged.
  17142. * The iteratee is invoked with one argument: (value).
  17143. *
  17144. * @static
  17145. * @memberOf _
  17146. * @since 4.7.0
  17147. * @category Math
  17148. * @param {Array} array The array to iterate over.
  17149. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17150. * @returns {number} Returns the mean.
  17151. * @example
  17152. *
  17153. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17154. *
  17155. * _.meanBy(objects, function(o) { return o.n; });
  17156. * // => 5
  17157. *
  17158. * // The `_.property` iteratee shorthand.
  17159. * _.meanBy(objects, 'n');
  17160. * // => 5
  17161. */
  17162. function meanBy(array, iteratee) {
  17163. return baseMean(array, getIteratee(iteratee, 2));
  17164. }
  17165. /**
  17166. * Computes the minimum value of `array`. If `array` is empty or falsey,
  17167. * `undefined` is returned.
  17168. *
  17169. * @static
  17170. * @since 0.1.0
  17171. * @memberOf _
  17172. * @category Math
  17173. * @param {Array} array The array to iterate over.
  17174. * @returns {*} Returns the minimum value.
  17175. * @example
  17176. *
  17177. * _.min([4, 2, 8, 6]);
  17178. * // => 2
  17179. *
  17180. * _.min([]);
  17181. * // => undefined
  17182. */
  17183. function min(array) {
  17184. return (array && array.length)
  17185. ? baseExtremum(array, identity, baseLt)
  17186. : undefined;
  17187. }
  17188. /**
  17189. * This method is like `_.min` except that it accepts `iteratee` which is
  17190. * invoked for each element in `array` to generate the criterion by which
  17191. * the value is ranked. The iteratee is invoked with one argument: (value).
  17192. *
  17193. * @static
  17194. * @memberOf _
  17195. * @since 4.0.0
  17196. * @category Math
  17197. * @param {Array} array The array to iterate over.
  17198. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17199. * @returns {*} Returns the minimum value.
  17200. * @example
  17201. *
  17202. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17203. *
  17204. * _.minBy(objects, function(o) { return o.n; });
  17205. * // => { 'n': 1 }
  17206. *
  17207. * // The `_.property` iteratee shorthand.
  17208. * _.minBy(objects, 'n');
  17209. * // => { 'n': 1 }
  17210. */
  17211. function minBy(array, iteratee) {
  17212. return (array && array.length)
  17213. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  17214. : undefined;
  17215. }
  17216. /**
  17217. * Multiply two numbers.
  17218. *
  17219. * @static
  17220. * @memberOf _
  17221. * @since 4.7.0
  17222. * @category Math
  17223. * @param {number} multiplier The first number in a multiplication.
  17224. * @param {number} multiplicand The second number in a multiplication.
  17225. * @returns {number} Returns the product.
  17226. * @example
  17227. *
  17228. * _.multiply(6, 4);
  17229. * // => 24
  17230. */
  17231. var multiply = createMathOperation(function(multiplier, multiplicand) {
  17232. return multiplier * multiplicand;
  17233. }, 1);
  17234. /**
  17235. * Computes `number` rounded to `precision`.
  17236. *
  17237. * @static
  17238. * @memberOf _
  17239. * @since 3.10.0
  17240. * @category Math
  17241. * @param {number} number The number to round.
  17242. * @param {number} [precision=0] The precision to round to.
  17243. * @returns {number} Returns the rounded number.
  17244. * @example
  17245. *
  17246. * _.round(4.006);
  17247. * // => 4
  17248. *
  17249. * _.round(4.006, 2);
  17250. * // => 4.01
  17251. *
  17252. * _.round(4060, -2);
  17253. * // => 4100
  17254. */
  17255. var round = createRound('round');
  17256. /**
  17257. * Subtract two numbers.
  17258. *
  17259. * @static
  17260. * @memberOf _
  17261. * @since 4.0.0
  17262. * @category Math
  17263. * @param {number} minuend The first number in a subtraction.
  17264. * @param {number} subtrahend The second number in a subtraction.
  17265. * @returns {number} Returns the difference.
  17266. * @example
  17267. *
  17268. * _.subtract(6, 4);
  17269. * // => 2
  17270. */
  17271. var subtract = createMathOperation(function(minuend, subtrahend) {
  17272. return minuend - subtrahend;
  17273. }, 0);
  17274. /**
  17275. * Computes the sum of the values in `array`.
  17276. *
  17277. * @static
  17278. * @memberOf _
  17279. * @since 3.4.0
  17280. * @category Math
  17281. * @param {Array} array The array to iterate over.
  17282. * @returns {number} Returns the sum.
  17283. * @example
  17284. *
  17285. * _.sum([4, 2, 8, 6]);
  17286. * // => 20
  17287. */
  17288. function sum(array) {
  17289. return (array && array.length)
  17290. ? baseSum(array, identity)
  17291. : 0;
  17292. }
  17293. /**
  17294. * This method is like `_.sum` except that it accepts `iteratee` which is
  17295. * invoked for each element in `array` to generate the value to be summed.
  17296. * The iteratee is invoked with one argument: (value).
  17297. *
  17298. * @static
  17299. * @memberOf _
  17300. * @since 4.0.0
  17301. * @category Math
  17302. * @param {Array} array The array to iterate over.
  17303. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17304. * @returns {number} Returns the sum.
  17305. * @example
  17306. *
  17307. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17308. *
  17309. * _.sumBy(objects, function(o) { return o.n; });
  17310. * // => 20
  17311. *
  17312. * // The `_.property` iteratee shorthand.
  17313. * _.sumBy(objects, 'n');
  17314. * // => 20
  17315. */
  17316. function sumBy(array, iteratee) {
  17317. return (array && array.length)
  17318. ? baseSum(array, getIteratee(iteratee, 2))
  17319. : 0;
  17320. }
  17321. /*------------------------------------------------------------------------*/
  17322. // Add methods that return wrapped values in chain sequences.
  17323. lodash.after = after;
  17324. lodash.ary = ary;
  17325. lodash.assign = assign;
  17326. lodash.assignIn = assignIn;
  17327. lodash.assignInWith = assignInWith;
  17328. lodash.assignWith = assignWith;
  17329. lodash.at = at;
  17330. lodash.before = before;
  17331. lodash.bind = bind;
  17332. lodash.bindAll = bindAll;
  17333. lodash.bindKey = bindKey;
  17334. lodash.castArray = castArray;
  17335. lodash.chain = chain;
  17336. lodash.chunk = chunk;
  17337. lodash.compact = compact;
  17338. lodash.concat = concat;
  17339. lodash.cond = cond;
  17340. lodash.conforms = conforms;
  17341. lodash.constant = constant;
  17342. lodash.countBy = countBy;
  17343. lodash.create = create;
  17344. lodash.curry = curry;
  17345. lodash.curryRight = curryRight;
  17346. lodash.debounce = debounce;
  17347. lodash.defaults = defaults;
  17348. lodash.defaultsDeep = defaultsDeep;
  17349. lodash.defer = defer;
  17350. lodash.delay = delay;
  17351. lodash.difference = difference;
  17352. lodash.differenceBy = differenceBy;
  17353. lodash.differenceWith = differenceWith;
  17354. lodash.drop = drop;
  17355. lodash.dropRight = dropRight;
  17356. lodash.dropRightWhile = dropRightWhile;
  17357. lodash.dropWhile = dropWhile;
  17358. lodash.fill = fill;
  17359. lodash.filter = filter;
  17360. lodash.flatMap = flatMap;
  17361. lodash.flatMapDeep = flatMapDeep;
  17362. lodash.flatMapDepth = flatMapDepth;
  17363. lodash.flatten = flatten;
  17364. lodash.flattenDeep = flattenDeep;
  17365. lodash.flattenDepth = flattenDepth;
  17366. lodash.flip = flip;
  17367. lodash.flow = flow;
  17368. lodash.flowRight = flowRight;
  17369. lodash.fromPairs = fromPairs;
  17370. lodash.functions = functions;
  17371. lodash.functionsIn = functionsIn;
  17372. lodash.groupBy = groupBy;
  17373. lodash.initial = initial;
  17374. lodash.intersection = intersection;
  17375. lodash.intersectionBy = intersectionBy;
  17376. lodash.intersectionWith = intersectionWith;
  17377. lodash.invert = invert;
  17378. lodash.invertBy = invertBy;
  17379. lodash.invokeMap = invokeMap;
  17380. lodash.iteratee = iteratee;
  17381. lodash.keyBy = keyBy;
  17382. lodash.keys = keys;
  17383. lodash.keysIn = keysIn;
  17384. lodash.map = map;
  17385. lodash.mapKeys = mapKeys;
  17386. lodash.mapValues = mapValues;
  17387. lodash.matches = matches;
  17388. lodash.matchesProperty = matchesProperty;
  17389. lodash.memoize = memoize;
  17390. lodash.merge = merge;
  17391. lodash.mergeWith = mergeWith;
  17392. lodash.method = method;
  17393. lodash.methodOf = methodOf;
  17394. lodash.mixin = mixin;
  17395. lodash.negate = negate;
  17396. lodash.nthArg = nthArg;
  17397. lodash.omit = omit;
  17398. lodash.omitBy = omitBy;
  17399. lodash.once = once;
  17400. lodash.orderBy = orderBy;
  17401. lodash.over = over;
  17402. lodash.overArgs = overArgs;
  17403. lodash.overEvery = overEvery;
  17404. lodash.overSome = overSome;
  17405. lodash.partial = partial;
  17406. lodash.partialRight = partialRight;
  17407. lodash.partition = partition;
  17408. lodash.pick = pick;
  17409. lodash.pickBy = pickBy;
  17410. lodash.property = property;
  17411. lodash.propertyOf = propertyOf;
  17412. lodash.pull = pull;
  17413. lodash.pullAll = pullAll;
  17414. lodash.pullAllBy = pullAllBy;
  17415. lodash.pullAllWith = pullAllWith;
  17416. lodash.pullAt = pullAt;
  17417. lodash.range = range;
  17418. lodash.rangeRight = rangeRight;
  17419. lodash.rearg = rearg;
  17420. lodash.reject = reject;
  17421. lodash.remove = remove;
  17422. lodash.rest = rest;
  17423. lodash.reverse = reverse;
  17424. lodash.sampleSize = sampleSize;
  17425. lodash.set = set;
  17426. lodash.setWith = setWith;
  17427. lodash.shuffle = shuffle;
  17428. lodash.slice = slice;
  17429. lodash.sortBy = sortBy;
  17430. lodash.sortedUniq = sortedUniq;
  17431. lodash.sortedUniqBy = sortedUniqBy;
  17432. lodash.split = split;
  17433. lodash.spread = spread;
  17434. lodash.tail = tail;
  17435. lodash.take = take;
  17436. lodash.takeRight = takeRight;
  17437. lodash.takeRightWhile = takeRightWhile;
  17438. lodash.takeWhile = takeWhile;
  17439. lodash.tap = tap;
  17440. lodash.throttle = throttle;
  17441. lodash.thru = thru;
  17442. lodash.toArray = toArray;
  17443. lodash.toPairs = toPairs;
  17444. lodash.toPairsIn = toPairsIn;
  17445. lodash.toPath = toPath;
  17446. lodash.toPlainObject = toPlainObject;
  17447. lodash.transform = transform;
  17448. lodash.unary = unary;
  17449. lodash.union = union;
  17450. lodash.unionBy = unionBy;
  17451. lodash.unionWith = unionWith;
  17452. lodash.uniq = uniq;
  17453. lodash.uniqBy = uniqBy;
  17454. lodash.uniqWith = uniqWith;
  17455. lodash.unset = unset;
  17456. lodash.unzip = unzip;
  17457. lodash.unzipWith = unzipWith;
  17458. lodash.update = update;
  17459. lodash.updateWith = updateWith;
  17460. lodash.values = values;
  17461. lodash.valuesIn = valuesIn;
  17462. lodash.without = without;
  17463. lodash.words = words;
  17464. lodash.wrap = wrap;
  17465. lodash.xor = xor;
  17466. lodash.xorBy = xorBy;
  17467. lodash.xorWith = xorWith;
  17468. lodash.zip = zip;
  17469. lodash.zipObject = zipObject;
  17470. lodash.zipObjectDeep = zipObjectDeep;
  17471. lodash.zipWith = zipWith;
  17472. // Add aliases.
  17473. lodash.entries = toPairs;
  17474. lodash.entriesIn = toPairsIn;
  17475. lodash.extend = assignIn;
  17476. lodash.extendWith = assignInWith;
  17477. // Add methods to `lodash.prototype`.
  17478. mixin(lodash, lodash);
  17479. /*------------------------------------------------------------------------*/
  17480. // Add methods that return unwrapped values in chain sequences.
  17481. lodash.add = add;
  17482. lodash.attempt = attempt;
  17483. lodash.camelCase = camelCase;
  17484. lodash.capitalize = capitalize;
  17485. lodash.ceil = ceil;
  17486. lodash.clamp = clamp;
  17487. lodash.clone = clone;
  17488. lodash.cloneDeep = cloneDeep;
  17489. lodash.cloneDeepWith = cloneDeepWith;
  17490. lodash.cloneWith = cloneWith;
  17491. lodash.conformsTo = conformsTo;
  17492. lodash.deburr = deburr;
  17493. lodash.defaultTo = defaultTo;
  17494. lodash.divide = divide;
  17495. lodash.endsWith = endsWith;
  17496. lodash.eq = eq;
  17497. lodash.escape = escape;
  17498. lodash.escapeRegExp = escapeRegExp;
  17499. lodash.every = every;
  17500. lodash.find = find;
  17501. lodash.findIndex = findIndex;
  17502. lodash.findKey = findKey;
  17503. lodash.findLast = findLast;
  17504. lodash.findLastIndex = findLastIndex;
  17505. lodash.findLastKey = findLastKey;
  17506. lodash.floor = floor;
  17507. lodash.forEach = forEach;
  17508. lodash.forEachRight = forEachRight;
  17509. lodash.forIn = forIn;
  17510. lodash.forInRight = forInRight;
  17511. lodash.forOwn = forOwn;
  17512. lodash.forOwnRight = forOwnRight;
  17513. lodash.get = get;
  17514. lodash.gt = gt;
  17515. lodash.gte = gte;
  17516. lodash.has = has;
  17517. lodash.hasIn = hasIn;
  17518. lodash.head = head;
  17519. lodash.identity = identity;
  17520. lodash.includes = includes;
  17521. lodash.indexOf = indexOf;
  17522. lodash.inRange = inRange;
  17523. lodash.invoke = invoke;
  17524. lodash.isArguments = isArguments;
  17525. lodash.isArray = isArray;
  17526. lodash.isArrayBuffer = isArrayBuffer;
  17527. lodash.isArrayLike = isArrayLike;
  17528. lodash.isArrayLikeObject = isArrayLikeObject;
  17529. lodash.isBoolean = isBoolean;
  17530. lodash.isBuffer = isBuffer;
  17531. lodash.isDate = isDate;
  17532. lodash.isElement = isElement;
  17533. lodash.isEmpty = isEmpty;
  17534. lodash.isEqual = isEqual;
  17535. lodash.isEqualWith = isEqualWith;
  17536. lodash.isError = isError;
  17537. lodash.isFinite = isFinite;
  17538. lodash.isFunction = isFunction;
  17539. lodash.isInteger = isInteger;
  17540. lodash.isLength = isLength;
  17541. lodash.isMap = isMap;
  17542. lodash.isMatch = isMatch;
  17543. lodash.isMatchWith = isMatchWith;
  17544. lodash.isNaN = isNaN;
  17545. lodash.isNative = isNative;
  17546. lodash.isNil = isNil;
  17547. lodash.isNull = isNull;
  17548. lodash.isNumber = isNumber;
  17549. lodash.isObject = isObject;
  17550. lodash.isObjectLike = isObjectLike;
  17551. lodash.isPlainObject = isPlainObject;
  17552. lodash.isRegExp = isRegExp;
  17553. lodash.isSafeInteger = isSafeInteger;
  17554. lodash.isSet = isSet;
  17555. lodash.isString = isString;
  17556. lodash.isSymbol = isSymbol;
  17557. lodash.isTypedArray = isTypedArray;
  17558. lodash.isUndefined = isUndefined;
  17559. lodash.isWeakMap = isWeakMap;
  17560. lodash.isWeakSet = isWeakSet;
  17561. lodash.join = join;
  17562. lodash.kebabCase = kebabCase;
  17563. lodash.last = last;
  17564. lodash.lastIndexOf = lastIndexOf;
  17565. lodash.lowerCase = lowerCase;
  17566. lodash.lowerFirst = lowerFirst;
  17567. lodash.lt = lt;
  17568. lodash.lte = lte;
  17569. lodash.max = max;
  17570. lodash.maxBy = maxBy;
  17571. lodash.mean = mean;
  17572. lodash.meanBy = meanBy;
  17573. lodash.min = min;
  17574. lodash.minBy = minBy;
  17575. lodash.stubArray = stubArray;
  17576. lodash.stubFalse = stubFalse;
  17577. lodash.stubObject = stubObject;
  17578. lodash.stubString = stubString;
  17579. lodash.stubTrue = stubTrue;
  17580. lodash.multiply = multiply;
  17581. lodash.nth = nth;
  17582. lodash.noConflict = noConflict;
  17583. lodash.noop = noop;
  17584. lodash.now = now;
  17585. lodash.pad = pad;
  17586. lodash.padEnd = padEnd;
  17587. lodash.padStart = padStart;
  17588. lodash.parseInt = parseInt;
  17589. lodash.random = random;
  17590. lodash.reduce = reduce;
  17591. lodash.reduceRight = reduceRight;
  17592. lodash.repeat = repeat;
  17593. lodash.replace = replace;
  17594. lodash.result = result;
  17595. lodash.round = round;
  17596. lodash.runInContext = runInContext;
  17597. lodash.sample = sample;
  17598. lodash.size = size;
  17599. lodash.snakeCase = snakeCase;
  17600. lodash.some = some;
  17601. lodash.sortedIndex = sortedIndex;
  17602. lodash.sortedIndexBy = sortedIndexBy;
  17603. lodash.sortedIndexOf = sortedIndexOf;
  17604. lodash.sortedLastIndex = sortedLastIndex;
  17605. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17606. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17607. lodash.startCase = startCase;
  17608. lodash.startsWith = startsWith;
  17609. lodash.subtract = subtract;
  17610. lodash.sum = sum;
  17611. lodash.sumBy = sumBy;
  17612. lodash.template = template;
  17613. lodash.times = times;
  17614. lodash.toFinite = toFinite;
  17615. lodash.toInteger = toInteger;
  17616. lodash.toLength = toLength;
  17617. lodash.toLower = toLower;
  17618. lodash.toNumber = toNumber;
  17619. lodash.toSafeInteger = toSafeInteger;
  17620. lodash.toString = toString;
  17621. lodash.toUpper = toUpper;
  17622. lodash.trim = trim;
  17623. lodash.trimEnd = trimEnd;
  17624. lodash.trimStart = trimStart;
  17625. lodash.truncate = truncate;
  17626. lodash.unescape = unescape;
  17627. lodash.uniqueId = uniqueId;
  17628. lodash.upperCase = upperCase;
  17629. lodash.upperFirst = upperFirst;
  17630. // Add aliases.
  17631. lodash.each = forEach;
  17632. lodash.eachRight = forEachRight;
  17633. lodash.first = head;
  17634. mixin(lodash, (function() {
  17635. var source = {};
  17636. baseForOwn(lodash, function(func, methodName) {
  17637. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17638. source[methodName] = func;
  17639. }
  17640. });
  17641. return source;
  17642. }()), { 'chain': false });
  17643. /*------------------------------------------------------------------------*/
  17644. /**
  17645. * The semantic version number.
  17646. *
  17647. * @static
  17648. * @memberOf _
  17649. * @type {string}
  17650. */
  17651. lodash.VERSION = VERSION;
  17652. // Assign default placeholders.
  17653. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17654. lodash[methodName].placeholder = lodash;
  17655. });
  17656. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17657. arrayEach(['drop', 'take'], function(methodName, index) {
  17658. LazyWrapper.prototype[methodName] = function(n) {
  17659. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17660. var result = (this.__filtered__ && !index)
  17661. ? new LazyWrapper(this)
  17662. : this.clone();
  17663. if (result.__filtered__) {
  17664. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17665. } else {
  17666. result.__views__.push({
  17667. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17668. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17669. });
  17670. }
  17671. return result;
  17672. };
  17673. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17674. return this.reverse()[methodName](n).reverse();
  17675. };
  17676. });
  17677. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17678. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17679. var type = index + 1,
  17680. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17681. LazyWrapper.prototype[methodName] = function(iteratee) {
  17682. var result = this.clone();
  17683. result.__iteratees__.push({
  17684. 'iteratee': getIteratee(iteratee, 3),
  17685. 'type': type
  17686. });
  17687. result.__filtered__ = result.__filtered__ || isFilter;
  17688. return result;
  17689. };
  17690. });
  17691. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17692. arrayEach(['head', 'last'], function(methodName, index) {
  17693. var takeName = 'take' + (index ? 'Right' : '');
  17694. LazyWrapper.prototype[methodName] = function() {
  17695. return this[takeName](1).value()[0];
  17696. };
  17697. });
  17698. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17699. arrayEach(['initial', 'tail'], function(methodName, index) {
  17700. var dropName = 'drop' + (index ? '' : 'Right');
  17701. LazyWrapper.prototype[methodName] = function() {
  17702. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17703. };
  17704. });
  17705. LazyWrapper.prototype.compact = function() {
  17706. return this.filter(identity);
  17707. };
  17708. LazyWrapper.prototype.find = function(predicate) {
  17709. return this.filter(predicate).head();
  17710. };
  17711. LazyWrapper.prototype.findLast = function(predicate) {
  17712. return this.reverse().find(predicate);
  17713. };
  17714. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17715. if (typeof path == 'function') {
  17716. return new LazyWrapper(this);
  17717. }
  17718. return this.map(function(value) {
  17719. return baseInvoke(value, path, args);
  17720. });
  17721. });
  17722. LazyWrapper.prototype.reject = function(predicate) {
  17723. return this.filter(negate(getIteratee(predicate)));
  17724. };
  17725. LazyWrapper.prototype.slice = function(start, end) {
  17726. start = toInteger(start);
  17727. var result = this;
  17728. if (result.__filtered__ && (start > 0 || end < 0)) {
  17729. return new LazyWrapper(result);
  17730. }
  17731. if (start < 0) {
  17732. result = result.takeRight(-start);
  17733. } else if (start) {
  17734. result = result.drop(start);
  17735. }
  17736. if (end !== undefined) {
  17737. end = toInteger(end);
  17738. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17739. }
  17740. return result;
  17741. };
  17742. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17743. return this.reverse().takeWhile(predicate).reverse();
  17744. };
  17745. LazyWrapper.prototype.toArray = function() {
  17746. return this.take(MAX_ARRAY_LENGTH);
  17747. };
  17748. // Add `LazyWrapper` methods to `lodash.prototype`.
  17749. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17750. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17751. isTaker = /^(?:head|last)$/.test(methodName),
  17752. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17753. retUnwrapped = isTaker || /^find/.test(methodName);
  17754. if (!lodashFunc) {
  17755. return;
  17756. }
  17757. lodash.prototype[methodName] = function() {
  17758. var value = this.__wrapped__,
  17759. args = isTaker ? [1] : arguments,
  17760. isLazy = value instanceof LazyWrapper,
  17761. iteratee = args[0],
  17762. useLazy = isLazy || isArray(value);
  17763. var interceptor = function(value) {
  17764. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17765. return (isTaker && chainAll) ? result[0] : result;
  17766. };
  17767. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17768. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17769. isLazy = useLazy = false;
  17770. }
  17771. var chainAll = this.__chain__,
  17772. isHybrid = !!this.__actions__.length,
  17773. isUnwrapped = retUnwrapped && !chainAll,
  17774. onlyLazy = isLazy && !isHybrid;
  17775. if (!retUnwrapped && useLazy) {
  17776. value = onlyLazy ? value : new LazyWrapper(this);
  17777. var result = func.apply(value, args);
  17778. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17779. return new LodashWrapper(result, chainAll);
  17780. }
  17781. if (isUnwrapped && onlyLazy) {
  17782. return func.apply(this, args);
  17783. }
  17784. result = this.thru(interceptor);
  17785. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17786. };
  17787. });
  17788. // Add `Array` methods to `lodash.prototype`.
  17789. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17790. var func = arrayProto[methodName],
  17791. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17792. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17793. lodash.prototype[methodName] = function() {
  17794. var args = arguments;
  17795. if (retUnwrapped && !this.__chain__) {
  17796. var value = this.value();
  17797. return func.apply(isArray(value) ? value : [], args);
  17798. }
  17799. return this[chainName](function(value) {
  17800. return func.apply(isArray(value) ? value : [], args);
  17801. });
  17802. };
  17803. });
  17804. // Map minified method names to their real names.
  17805. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17806. var lodashFunc = lodash[methodName];
  17807. if (lodashFunc) {
  17808. var key = lodashFunc.name + '';
  17809. if (!hasOwnProperty.call(realNames, key)) {
  17810. realNames[key] = [];
  17811. }
  17812. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17813. }
  17814. });
  17815. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17816. 'name': 'wrapper',
  17817. 'func': undefined
  17818. }];
  17819. // Add methods to `LazyWrapper`.
  17820. LazyWrapper.prototype.clone = lazyClone;
  17821. LazyWrapper.prototype.reverse = lazyReverse;
  17822. LazyWrapper.prototype.value = lazyValue;
  17823. // Add chain sequence methods to the `lodash` wrapper.
  17824. lodash.prototype.at = wrapperAt;
  17825. lodash.prototype.chain = wrapperChain;
  17826. lodash.prototype.commit = wrapperCommit;
  17827. lodash.prototype.next = wrapperNext;
  17828. lodash.prototype.plant = wrapperPlant;
  17829. lodash.prototype.reverse = wrapperReverse;
  17830. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17831. // Add lazy aliases.
  17832. lodash.prototype.first = lodash.prototype.head;
  17833. if (symIterator) {
  17834. lodash.prototype[symIterator] = wrapperToIterator;
  17835. }
  17836. return lodash;
  17837. });
  17838. /*--------------------------------------------------------------------------*/
  17839. // Export lodash.
  17840. var _ = runInContext();
  17841. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17842. if (true) {
  17843. // Expose Lodash on the global object to prevent errors when Lodash is
  17844. // loaded by a script tag in the presence of an AMD loader.
  17845. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17846. // Use `_.noConflict` to remove Lodash from the global object.
  17847. root._ = _;
  17848. // Define as an anonymous module so, through path mapping, it can be
  17849. // referenced as the "underscore" module.
  17850. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17851. return _;
  17852. }).call(exports, __webpack_require__, exports, module),
  17853. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17854. }
  17855. // Check for `exports` after `define` in case a build optimizer adds it.
  17856. else {}
  17857. }.call(this));
  17858. /***/ }),
  17859. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17860. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17861. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17862. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17863. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17864. "use strict";
  17865. __webpack_require__.r(__webpack_exports__);
  17866. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17867. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17868. /* harmony export */ });
  17869. /* 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");
  17870. /* 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__);
  17871. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17872. var options = {};
  17873. options.insert = "head";
  17874. options.singleton = false;
  17875. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17876. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17877. /***/ }),
  17878. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17879. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17880. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17881. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17882. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17883. "use strict";
  17884. __webpack_require__.r(__webpack_exports__);
  17885. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17886. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17887. /* harmony export */ });
  17888. /* 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");
  17889. /* 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__);
  17890. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17891. var options = {};
  17892. options.insert = "head";
  17893. options.singleton = false;
  17894. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17895. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17896. /***/ }),
  17897. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17898. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17899. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17900. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17901. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17902. "use strict";
  17903. __webpack_require__.r(__webpack_exports__);
  17904. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17905. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17906. /* harmony export */ });
  17907. /* 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");
  17908. /* 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__);
  17909. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17910. var options = {};
  17911. options.insert = "head";
  17912. options.singleton = false;
  17913. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17914. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17915. /***/ }),
  17916. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17917. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17918. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17919. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17920. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17921. "use strict";
  17922. __webpack_require__.r(__webpack_exports__);
  17923. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17924. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17925. /* harmony export */ });
  17926. /* 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");
  17927. /* 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__);
  17928. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17929. var options = {};
  17930. options.insert = "head";
  17931. options.singleton = false;
  17932. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17933. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17934. /***/ }),
  17935. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17936. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17937. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17938. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17939. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17940. "use strict";
  17941. __webpack_require__.r(__webpack_exports__);
  17942. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17943. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17944. /* harmony export */ });
  17945. /* 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");
  17946. /* 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__);
  17947. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17948. var options = {};
  17949. options.insert = "head";
  17950. options.singleton = false;
  17951. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17952. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17953. /***/ }),
  17954. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17955. /*!******************************************************!*\
  17956. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17957. \******************************************************/
  17958. /***/ ((__unused_webpack_module, exports) => {
  17959. "use strict";
  17960. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17961. // runtime helper for setting properties on components
  17962. // in a tree-shakable way
  17963. exports["default"] = (sfc, props) => {
  17964. const target = sfc.__vccOpts || sfc;
  17965. for (const [key, val] of props) {
  17966. target[key] = val;
  17967. }
  17968. return target;
  17969. };
  17970. /***/ }),
  17971. /***/ "./resources/js/components/AppDropdown.vue":
  17972. /*!*************************************************!*\
  17973. !*** ./resources/js/components/AppDropdown.vue ***!
  17974. \*************************************************/
  17975. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17976. "use strict";
  17977. __webpack_require__.r(__webpack_exports__);
  17978. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17979. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17980. /* harmony export */ });
  17981. /* harmony import */ var _AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992");
  17982. /* harmony import */ var _AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  17983. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17984. ;
  17985. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppDropdown.vue"]])
  17986. /* hot reload */
  17987. if (false) {}
  17988. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17989. /***/ }),
  17990. /***/ "./resources/js/components/AppFooter.vue":
  17991. /*!***********************************************!*\
  17992. !*** ./resources/js/components/AppFooter.vue ***!
  17993. \***********************************************/
  17994. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17995. "use strict";
  17996. __webpack_require__.r(__webpack_exports__);
  17997. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17998. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17999. /* harmony export */ });
  18000. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  18001. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  18002. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18003. const script = {}
  18004. ;
  18005. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  18006. /* hot reload */
  18007. if (false) {}
  18008. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18009. /***/ }),
  18010. /***/ "./resources/js/components/AppInputText.vue":
  18011. /*!**************************************************!*\
  18012. !*** ./resources/js/components/AppInputText.vue ***!
  18013. \**************************************************/
  18014. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18015. "use strict";
  18016. __webpack_require__.r(__webpack_exports__);
  18017. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18018. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18019. /* harmony export */ });
  18020. /* harmony import */ var _AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=template&id=16729fe1 */ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1");
  18021. /* harmony import */ var _AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js");
  18022. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18023. ;
  18024. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppInputText.vue"]])
  18025. /* hot reload */
  18026. if (false) {}
  18027. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18028. /***/ }),
  18029. /***/ "./resources/js/components/AppMessage.vue":
  18030. /*!************************************************!*\
  18031. !*** ./resources/js/components/AppMessage.vue ***!
  18032. \************************************************/
  18033. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18034. "use strict";
  18035. __webpack_require__.r(__webpack_exports__);
  18036. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18037. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18038. /* harmony export */ });
  18039. /* 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");
  18040. /* 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");
  18041. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18042. ;
  18043. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  18044. /* hot reload */
  18045. if (false) {}
  18046. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18047. /***/ }),
  18048. /***/ "./resources/js/components/AppSidebar.vue":
  18049. /*!************************************************!*\
  18050. !*** ./resources/js/components/AppSidebar.vue ***!
  18051. \************************************************/
  18052. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18053. "use strict";
  18054. __webpack_require__.r(__webpack_exports__);
  18055. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18056. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18057. /* harmony export */ });
  18058. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  18059. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  18060. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  18061. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18062. ;
  18063. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  18064. /* hot reload */
  18065. if (false) {}
  18066. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18067. /***/ }),
  18068. /***/ "./resources/js/components/AppSubSidebar.vue":
  18069. /*!***************************************************!*\
  18070. !*** ./resources/js/components/AppSubSidebar.vue ***!
  18071. \***************************************************/
  18072. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18073. "use strict";
  18074. __webpack_require__.r(__webpack_exports__);
  18075. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18076. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18077. /* harmony export */ });
  18078. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  18079. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  18080. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  18081. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18082. ;
  18083. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  18084. /* hot reload */
  18085. if (false) {}
  18086. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18087. /***/ }),
  18088. /***/ "./resources/js/components/AppTopBar.vue":
  18089. /*!***********************************************!*\
  18090. !*** ./resources/js/components/AppTopBar.vue ***!
  18091. \***********************************************/
  18092. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18093. "use strict";
  18094. __webpack_require__.r(__webpack_exports__);
  18095. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18096. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18097. /* harmony export */ });
  18098. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  18099. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  18100. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  18101. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18102. ;
  18103. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  18104. /* hot reload */
  18105. if (false) {}
  18106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18107. /***/ }),
  18108. /***/ "./resources/js/layouts/DashboardLayout.vue":
  18109. /*!**************************************************!*\
  18110. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  18111. \**************************************************/
  18112. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18113. "use strict";
  18114. __webpack_require__.r(__webpack_exports__);
  18115. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18116. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18117. /* harmony export */ });
  18118. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  18119. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  18120. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  18121. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18122. ;
  18123. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  18124. /* hot reload */
  18125. if (false) {}
  18126. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18127. /***/ }),
  18128. /***/ "./resources/js/pages/member/Edit.vue":
  18129. /*!********************************************!*\
  18130. !*** ./resources/js/pages/member/Edit.vue ***!
  18131. \********************************************/
  18132. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18133. "use strict";
  18134. __webpack_require__.r(__webpack_exports__);
  18135. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18136. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18137. /* harmony export */ });
  18138. /* harmony import */ var _Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Edit.vue?vue&type=template&id=1a9fb226 */ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226");
  18139. /* harmony import */ var _Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Edit.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js");
  18140. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  18141. ;
  18142. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/member/Edit.vue"]])
  18143. /* hot reload */
  18144. if (false) {}
  18145. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18146. /***/ }),
  18147. /***/ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  18148. /*!************************************************************************************!*\
  18149. !*** ./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  18150. \************************************************************************************/
  18151. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18152. "use strict";
  18153. __webpack_require__.r(__webpack_exports__);
  18154. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18155. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18156. /* harmony export */ });
  18157. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppDropdown.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  18158. /***/ }),
  18159. /***/ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  18160. /*!*************************************************************************************!*\
  18161. !*** ./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  18162. \*************************************************************************************/
  18163. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18164. "use strict";
  18165. __webpack_require__.r(__webpack_exports__);
  18166. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18167. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18168. /* harmony export */ });
  18169. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppInputText.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js");
  18170. /***/ }),
  18171. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  18172. /*!***********************************************************************************!*\
  18173. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  18174. \***********************************************************************************/
  18175. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18176. "use strict";
  18177. __webpack_require__.r(__webpack_exports__);
  18178. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18179. /* 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"])
  18180. /* harmony export */ });
  18181. /* 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");
  18182. /***/ }),
  18183. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  18184. /*!***********************************************************************************!*\
  18185. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18186. \***********************************************************************************/
  18187. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18188. "use strict";
  18189. __webpack_require__.r(__webpack_exports__);
  18190. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18191. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18192. /* harmony export */ });
  18193. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  18194. /***/ }),
  18195. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  18196. /*!**************************************************************************************!*\
  18197. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18198. \**************************************************************************************/
  18199. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18200. "use strict";
  18201. __webpack_require__.r(__webpack_exports__);
  18202. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18203. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18204. /* harmony export */ });
  18205. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  18206. /***/ }),
  18207. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  18208. /*!**********************************************************************************!*\
  18209. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  18210. \**********************************************************************************/
  18211. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18212. "use strict";
  18213. __webpack_require__.r(__webpack_exports__);
  18214. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18215. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18216. /* harmony export */ });
  18217. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  18218. /***/ }),
  18219. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  18220. /*!*************************************************************************************!*\
  18221. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  18222. \*************************************************************************************/
  18223. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18224. "use strict";
  18225. __webpack_require__.r(__webpack_exports__);
  18226. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18227. /* 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"])
  18228. /* harmony export */ });
  18229. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  18230. /***/ }),
  18231. /***/ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js":
  18232. /*!*******************************************************************************!*\
  18233. !*** ./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  18234. \*******************************************************************************/
  18235. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18236. "use strict";
  18237. __webpack_require__.r(__webpack_exports__);
  18238. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18239. /* 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_Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18240. /* harmony export */ });
  18241. /* 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_Edit_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]!./Edit.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/member/Edit.vue?vue&type=script&setup=true&lang=js");
  18242. /***/ }),
  18243. /***/ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  18244. /*!*******************************************************************************!*\
  18245. !*** ./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  18246. \*******************************************************************************/
  18247. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18248. "use strict";
  18249. __webpack_require__.r(__webpack_exports__);
  18250. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18251. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render)
  18252. /* harmony export */ });
  18253. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992");
  18254. /***/ }),
  18255. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  18256. /*!*****************************************************************************************!*\
  18257. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  18258. \*****************************************************************************************/
  18259. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18260. "use strict";
  18261. __webpack_require__.r(__webpack_exports__);
  18262. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18263. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  18264. /* harmony export */ });
  18265. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  18266. /***/ }),
  18267. /***/ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  18268. /*!********************************************************************************!*\
  18269. !*** ./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  18270. \********************************************************************************/
  18271. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18272. "use strict";
  18273. __webpack_require__.r(__webpack_exports__);
  18274. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18275. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render)
  18276. /* harmony export */ });
  18277. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppInputText.vue?vue&type=template&id=16729fe1 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1");
  18278. /***/ }),
  18279. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  18280. /*!******************************************************************************!*\
  18281. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  18282. \******************************************************************************/
  18283. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18284. "use strict";
  18285. __webpack_require__.r(__webpack_exports__);
  18286. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18287. /* 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)
  18288. /* harmony export */ });
  18289. /* 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");
  18290. /***/ }),
  18291. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  18292. /*!******************************************************************************************!*\
  18293. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  18294. \******************************************************************************************/
  18295. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18296. "use strict";
  18297. __webpack_require__.r(__webpack_exports__);
  18298. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18299. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  18300. /* harmony export */ });
  18301. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  18302. /***/ }),
  18303. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  18304. /*!*********************************************************************************************!*\
  18305. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  18306. \*********************************************************************************************/
  18307. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18308. "use strict";
  18309. __webpack_require__.r(__webpack_exports__);
  18310. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18311. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  18312. /* harmony export */ });
  18313. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  18314. /***/ }),
  18315. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  18316. /*!*****************************************************************************************!*\
  18317. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  18318. \*****************************************************************************************/
  18319. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18320. "use strict";
  18321. __webpack_require__.r(__webpack_exports__);
  18322. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18323. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  18324. /* harmony export */ });
  18325. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  18326. /***/ }),
  18327. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  18328. /*!********************************************************************************************!*\
  18329. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  18330. \********************************************************************************************/
  18331. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18332. "use strict";
  18333. __webpack_require__.r(__webpack_exports__);
  18334. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18335. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  18336. /* harmony export */ });
  18337. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  18338. /***/ }),
  18339. /***/ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226":
  18340. /*!**************************************************************************!*\
  18341. !*** ./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  18342. \**************************************************************************/
  18343. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18344. "use strict";
  18345. __webpack_require__.r(__webpack_exports__);
  18346. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18347. /* 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_Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__.render)
  18348. /* harmony export */ });
  18349. /* 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_Edit_vue_vue_type_template_id_1a9fb226__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]!./Edit.vue?vue&type=template&id=1a9fb226 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226");
  18350. /***/ }),
  18351. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  18352. /*!********************************************************************************************************!*\
  18353. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  18354. \********************************************************************************************************/
  18355. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18356. "use strict";
  18357. __webpack_require__.r(__webpack_exports__);
  18358. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  18359. /***/ }),
  18360. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  18361. /*!*********************************************************************************************************!*\
  18362. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  18363. \*********************************************************************************************************/
  18364. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18365. "use strict";
  18366. __webpack_require__.r(__webpack_exports__);
  18367. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  18368. /***/ }),
  18369. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  18370. /*!************************************************************************************************************!*\
  18371. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  18372. \************************************************************************************************************/
  18373. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18374. "use strict";
  18375. __webpack_require__.r(__webpack_exports__);
  18376. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  18377. /***/ }),
  18378. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  18379. /*!********************************************************************************************************!*\
  18380. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  18381. \********************************************************************************************************/
  18382. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18383. "use strict";
  18384. __webpack_require__.r(__webpack_exports__);
  18385. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  18386. /***/ }),
  18387. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18388. /*!***********************************************************************************************************!*\
  18389. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18390. \***********************************************************************************************************/
  18391. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18392. "use strict";
  18393. __webpack_require__.r(__webpack_exports__);
  18394. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  18395. /***/ })
  18396. }]);