cdn.js 275 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468
  1. (() => {
  2. function _createForOfIteratorHelper(o, allowArrayLike) {var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = it.call(o);}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}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);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}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);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}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, _toPropertyKey(descriptor.key), descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, "prototype", { writable: false });return Constructor;}function _toArray(arr) {return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}var __defProp = Object.defineProperty;
  3. var __export = function __export(target, all) {
  4. for (var name in all)
  5. __defProp(target, name, {
  6. get: all[name],
  7. enumerable: true,
  8. configurable: true,
  9. set: function set(newValue) {return all[name] = function () {return newValue;};}
  10. });
  11. };
  12. // lib/fp.js
  13. var exports_fp = {};
  14. __export(exports_fp, {
  15. yearsToQuarters: function yearsToQuarters() {return yearsToQuarters3;},
  16. yearsToMonths: function yearsToMonths() {return yearsToMonths3;},
  17. yearsToDays: function yearsToDays() {return yearsToDays3;},
  18. weeksToDays: function weeksToDays() {return weeksToDays3;},
  19. transpose: function transpose() {return transpose4;},
  20. toDate: function toDate() {return toDate108;},
  21. subYearsWithOptions: function subYearsWithOptions() {return _subYearsWithOptions;},
  22. subYears: function subYears() {return subYears3;},
  23. subWithOptions: function subWithOptions() {return _subWithOptions;},
  24. subWeeksWithOptions: function subWeeksWithOptions() {return _subWeeksWithOptions;},
  25. subWeeks: function subWeeks() {return subWeeks3;},
  26. subSecondsWithOptions: function subSecondsWithOptions() {return _subSecondsWithOptions;},
  27. subSeconds: function subSeconds() {return subSeconds3;},
  28. subQuartersWithOptions: function subQuartersWithOptions() {return _subQuartersWithOptions;},
  29. subQuarters: function subQuarters() {return subQuarters3;},
  30. subMonthsWithOptions: function subMonthsWithOptions() {return _subMonthsWithOptions;},
  31. subMonths: function subMonths() {return subMonths4;},
  32. subMinutesWithOptions: function subMinutesWithOptions() {return _subMinutesWithOptions;},
  33. subMinutes: function subMinutes() {return subMinutes3;},
  34. subMillisecondsWithOptions: function subMillisecondsWithOptions() {return _subMillisecondsWithOptions;},
  35. subMilliseconds: function subMilliseconds() {return subMilliseconds3;},
  36. subISOWeekYearsWithOptions: function subISOWeekYearsWithOptions() {return _subISOWeekYearsWithOptions;},
  37. subISOWeekYears: function subISOWeekYears() {return subISOWeekYears4;},
  38. subHoursWithOptions: function subHoursWithOptions() {return _subHoursWithOptions;},
  39. subHours: function subHours() {return subHours3;},
  40. subDaysWithOptions: function subDaysWithOptions() {return _subDaysWithOptions;},
  41. subDays: function subDays() {return subDays5;},
  42. subBusinessDaysWithOptions: function subBusinessDaysWithOptions() {return _subBusinessDaysWithOptions;},
  43. subBusinessDays: function subBusinessDays() {return subBusinessDays3;},
  44. sub: function sub() {return sub3;},
  45. startOfYearWithOptions: function startOfYearWithOptions() {return _startOfYearWithOptions;},
  46. startOfYear: function startOfYear() {return startOfYear5;},
  47. startOfWeekYearWithOptions: function startOfWeekYearWithOptions() {return _startOfWeekYearWithOptions;},
  48. startOfWeekYear: function startOfWeekYear() {return startOfWeekYear5;},
  49. startOfWeekWithOptions: function startOfWeekWithOptions() {return _startOfWeekWithOptions;},
  50. startOfWeek: function startOfWeek() {return startOfWeek12;},
  51. startOfSecondWithOptions: function startOfSecondWithOptions() {return _startOfSecondWithOptions;},
  52. startOfSecond: function startOfSecond() {return startOfSecond4;},
  53. startOfQuarterWithOptions: function startOfQuarterWithOptions() {return _startOfQuarterWithOptions;},
  54. startOfQuarter: function startOfQuarter() {return startOfQuarter5;},
  55. startOfMonthWithOptions: function startOfMonthWithOptions() {return _startOfMonthWithOptions;},
  56. startOfMonth: function startOfMonth() {return startOfMonth6;},
  57. startOfMinuteWithOptions: function startOfMinuteWithOptions() {return _startOfMinuteWithOptions;},
  58. startOfMinute: function startOfMinute() {return startOfMinute4;},
  59. startOfISOWeekYearWithOptions: function startOfISOWeekYearWithOptions() {return _startOfISOWeekYearWithOptions;},
  60. startOfISOWeekYear: function startOfISOWeekYear() {return startOfISOWeekYear7;},
  61. startOfISOWeekWithOptions: function startOfISOWeekWithOptions() {return _startOfISOWeekWithOptions;},
  62. startOfISOWeek: function startOfISOWeek() {return startOfISOWeek11;},
  63. startOfHourWithOptions: function startOfHourWithOptions() {return _startOfHourWithOptions;},
  64. startOfHour: function startOfHour() {return startOfHour4;},
  65. startOfDecadeWithOptions: function startOfDecadeWithOptions() {return _startOfDecadeWithOptions;},
  66. startOfDecade: function startOfDecade() {return startOfDecade3;},
  67. startOfDayWithOptions: function startOfDayWithOptions() {return _startOfDayWithOptions;},
  68. startOfDay: function startOfDay() {return startOfDay5;},
  69. setYearWithOptions: function setYearWithOptions() {return _setYearWithOptions;},
  70. setYear: function setYear() {return setYear3;},
  71. setWithOptions: function setWithOptions() {return _setWithOptions;},
  72. setWeekYearWithOptions: function setWeekYearWithOptions() {return _setWeekYearWithOptions;},
  73. setWeekYear: function setWeekYear() {return setWeekYear3;},
  74. setWeekWithOptions: function setWeekWithOptions() {return _setWeekWithOptions;},
  75. setWeek: function setWeek() {return setWeek4;},
  76. setSecondsWithOptions: function setSecondsWithOptions() {return _setSecondsWithOptions;},
  77. setSeconds: function setSeconds() {return setSeconds3;},
  78. setQuarterWithOptions: function setQuarterWithOptions() {return _setQuarterWithOptions;},
  79. setQuarter: function setQuarter() {return setQuarter3;},
  80. setMonthWithOptions: function setMonthWithOptions() {return _setMonthWithOptions;},
  81. setMonth: function setMonth() {return setMonth4;},
  82. setMinutesWithOptions: function setMinutesWithOptions() {return _setMinutesWithOptions;},
  83. setMinutes: function setMinutes() {return setMinutes3;},
  84. setMillisecondsWithOptions: function setMillisecondsWithOptions() {return _setMillisecondsWithOptions;},
  85. setMilliseconds: function setMilliseconds() {return setMilliseconds3;},
  86. setISOWeekYearWithOptions: function setISOWeekYearWithOptions() {return _setISOWeekYearWithOptions;},
  87. setISOWeekYear: function setISOWeekYear() {return setISOWeekYear4;},
  88. setISOWeekWithOptions: function setISOWeekWithOptions() {return _setISOWeekWithOptions;},
  89. setISOWeek: function setISOWeek() {return setISOWeek4;},
  90. setISODayWithOptions: function setISODayWithOptions() {return _setISODayWithOptions;},
  91. setISODay: function setISODay() {return setISODay4;},
  92. setHoursWithOptions: function setHoursWithOptions() {return _setHoursWithOptions;},
  93. setHours: function setHours() {return setHours3;},
  94. setDayWithOptions: function setDayWithOptions() {return _setDayWithOptions;},
  95. setDayOfYearWithOptions: function setDayOfYearWithOptions() {return _setDayOfYearWithOptions;},
  96. setDayOfYear: function setDayOfYear() {return setDayOfYear3;},
  97. setDay: function setDay() {return setDay6;},
  98. setDateWithOptions: function setDateWithOptions() {return _setDateWithOptions;},
  99. setDate: function setDate() {return setDate3;},
  100. set: function set() {return set3;},
  101. secondsToMinutes: function secondsToMinutes() {return secondsToMinutes3;},
  102. secondsToMilliseconds: function secondsToMilliseconds() {return secondsToMilliseconds3;},
  103. secondsToHours: function secondsToHours() {return secondsToHours3;},
  104. roundToNearestMinutesWithOptions: function roundToNearestMinutesWithOptions() {return _roundToNearestMinutesWithOptions;},
  105. roundToNearestMinutes: function roundToNearestMinutes() {return roundToNearestMinutes3;},
  106. roundToNearestHoursWithOptions: function roundToNearestHoursWithOptions() {return _roundToNearestHoursWithOptions;},
  107. roundToNearestHours: function roundToNearestHours() {return roundToNearestHours3;},
  108. quartersToYears: function quartersToYears() {return quartersToYears3;},
  109. quartersToMonths: function quartersToMonths() {return quartersToMonths3;},
  110. previousWednesdayWithOptions: function previousWednesdayWithOptions() {return _previousWednesdayWithOptions;},
  111. previousWednesday: function previousWednesday() {return previousWednesday3;},
  112. previousTuesdayWithOptions: function previousTuesdayWithOptions() {return _previousTuesdayWithOptions;},
  113. previousTuesday: function previousTuesday() {return previousTuesday3;},
  114. previousThursdayWithOptions: function previousThursdayWithOptions() {return _previousThursdayWithOptions;},
  115. previousThursday: function previousThursday() {return previousThursday3;},
  116. previousSundayWithOptions: function previousSundayWithOptions() {return _previousSundayWithOptions;},
  117. previousSunday: function previousSunday() {return previousSunday3;},
  118. previousSaturdayWithOptions: function previousSaturdayWithOptions() {return _previousSaturdayWithOptions;},
  119. previousSaturday: function previousSaturday() {return previousSaturday3;},
  120. previousMondayWithOptions: function previousMondayWithOptions() {return _previousMondayWithOptions;},
  121. previousMonday: function previousMonday() {return previousMonday3;},
  122. previousFridayWithOptions: function previousFridayWithOptions() {return _previousFridayWithOptions;},
  123. previousFriday: function previousFriday() {return previousFriday3;},
  124. previousDayWithOptions: function previousDayWithOptions() {return _previousDayWithOptions;},
  125. previousDay: function previousDay() {return previousDay3;},
  126. parseWithOptions: function parseWithOptions() {return _parseWithOptions;},
  127. parseJSONWithOptions: function parseJSONWithOptions() {return _parseJSONWithOptions;},
  128. parseJSON: function parseJSON() {return parseJSON3;},
  129. parseISOWithOptions: function parseISOWithOptions() {return _parseISOWithOptions;},
  130. parseISO: function parseISO() {return parseISO3;},
  131. parse: function parse() {return parse4;},
  132. nextWednesdayWithOptions: function nextWednesdayWithOptions() {return _nextWednesdayWithOptions;},
  133. nextWednesday: function nextWednesday() {return nextWednesday3;},
  134. nextTuesdayWithOptions: function nextTuesdayWithOptions() {return _nextTuesdayWithOptions;},
  135. nextTuesday: function nextTuesday() {return nextTuesday3;},
  136. nextThursdayWithOptions: function nextThursdayWithOptions() {return _nextThursdayWithOptions;},
  137. nextThursday: function nextThursday() {return nextThursday3;},
  138. nextSundayWithOptions: function nextSundayWithOptions() {return _nextSundayWithOptions;},
  139. nextSunday: function nextSunday() {return nextSunday3;},
  140. nextSaturdayWithOptions: function nextSaturdayWithOptions() {return _nextSaturdayWithOptions;},
  141. nextSaturday: function nextSaturday() {return nextSaturday3;},
  142. nextMondayWithOptions: function nextMondayWithOptions() {return _nextMondayWithOptions;},
  143. nextMonday: function nextMonday() {return nextMonday3;},
  144. nextFridayWithOptions: function nextFridayWithOptions() {return _nextFridayWithOptions;},
  145. nextFriday: function nextFriday() {return nextFriday3;},
  146. nextDayWithOptions: function nextDayWithOptions() {return _nextDayWithOptions;},
  147. nextDay: function nextDay() {return nextDay3;},
  148. monthsToYears: function monthsToYears() {return monthsToYears3;},
  149. monthsToQuarters: function monthsToQuarters() {return monthsToQuarters3;},
  150. minutesToSeconds: function minutesToSeconds() {return minutesToSeconds3;},
  151. minutesToMilliseconds: function minutesToMilliseconds() {return minutesToMilliseconds3;},
  152. minutesToHours: function minutesToHours() {return minutesToHours3;},
  153. minWithOptions: function minWithOptions() {return _minWithOptions;},
  154. min: function min() {return min4;},
  155. millisecondsToSeconds: function millisecondsToSeconds() {return millisecondsToSeconds3;},
  156. millisecondsToMinutes: function millisecondsToMinutes() {return millisecondsToMinutes3;},
  157. millisecondsToHours: function millisecondsToHours() {return millisecondsToHours3;},
  158. milliseconds: function milliseconds() {return milliseconds3;},
  159. maxWithOptions: function maxWithOptions() {return _maxWithOptions;},
  160. max: function max() {return max4;},
  161. lightFormat: function lightFormat() {return lightFormat3;},
  162. lastDayOfYearWithOptions: function lastDayOfYearWithOptions() {return _lastDayOfYearWithOptions;},
  163. lastDayOfYear: function lastDayOfYear() {return lastDayOfYear3;},
  164. lastDayOfWeekWithOptions: function lastDayOfWeekWithOptions() {return _lastDayOfWeekWithOptions;},
  165. lastDayOfWeek: function lastDayOfWeek() {return lastDayOfWeek4;},
  166. lastDayOfQuarterWithOptions: function lastDayOfQuarterWithOptions() {return _lastDayOfQuarterWithOptions;},
  167. lastDayOfQuarter: function lastDayOfQuarter() {return lastDayOfQuarter3;},
  168. lastDayOfMonthWithOptions: function lastDayOfMonthWithOptions() {return _lastDayOfMonthWithOptions;},
  169. lastDayOfMonth: function lastDayOfMonth() {return lastDayOfMonth4;},
  170. lastDayOfISOWeekYearWithOptions: function lastDayOfISOWeekYearWithOptions() {return _lastDayOfISOWeekYearWithOptions;},
  171. lastDayOfISOWeekYear: function lastDayOfISOWeekYear() {return lastDayOfISOWeekYear3;},
  172. lastDayOfISOWeekWithOptions: function lastDayOfISOWeekWithOptions() {return _lastDayOfISOWeekWithOptions;},
  173. lastDayOfISOWeek: function lastDayOfISOWeek() {return lastDayOfISOWeek3;},
  174. lastDayOfDecadeWithOptions: function lastDayOfDecadeWithOptions() {return _lastDayOfDecadeWithOptions;},
  175. lastDayOfDecade: function lastDayOfDecade() {return lastDayOfDecade3;},
  176. isWithinIntervalWithOptions: function isWithinIntervalWithOptions() {return _isWithinIntervalWithOptions;},
  177. isWithinInterval: function isWithinInterval() {return isWithinInterval3;},
  178. isWeekendWithOptions: function isWeekendWithOptions() {return _isWeekendWithOptions;},
  179. isWeekend: function isWeekend() {return isWeekend6;},
  180. isWednesdayWithOptions: function isWednesdayWithOptions() {return _isWednesdayWithOptions;},
  181. isWednesday: function isWednesday() {return isWednesday3;},
  182. isValid: function isValid() {return isValid9;},
  183. isTuesdayWithOptions: function isTuesdayWithOptions() {return _isTuesdayWithOptions;},
  184. isTuesday: function isTuesday() {return isTuesday3;},
  185. isThursdayWithOptions: function isThursdayWithOptions() {return _isThursdayWithOptions;},
  186. isThursday: function isThursday() {return isThursday3;},
  187. isSundayWithOptions: function isSundayWithOptions() {return _isSundayWithOptions;},
  188. isSunday: function isSunday() {return isSunday4;},
  189. isSaturdayWithOptions: function isSaturdayWithOptions() {return _isSaturdayWithOptions;},
  190. isSaturday: function isSaturday() {return isSaturday4;},
  191. isSameYearWithOptions: function isSameYearWithOptions() {return _isSameYearWithOptions;},
  192. isSameYear: function isSameYear() {return isSameYear3;},
  193. isSameWeekWithOptions: function isSameWeekWithOptions() {return _isSameWeekWithOptions;},
  194. isSameWeek: function isSameWeek() {return isSameWeek4;},
  195. isSameSecond: function isSameSecond() {return isSameSecond3;},
  196. isSameQuarterWithOptions: function isSameQuarterWithOptions() {return _isSameQuarterWithOptions;},
  197. isSameQuarter: function isSameQuarter() {return isSameQuarter3;},
  198. isSameMonthWithOptions: function isSameMonthWithOptions() {return _isSameMonthWithOptions;},
  199. isSameMonth: function isSameMonth() {return isSameMonth3;},
  200. isSameMinute: function isSameMinute() {return isSameMinute3;},
  201. isSameISOWeekYearWithOptions: function isSameISOWeekYearWithOptions() {return _isSameISOWeekYearWithOptions;},
  202. isSameISOWeekYear: function isSameISOWeekYear() {return isSameISOWeekYear3;},
  203. isSameISOWeekWithOptions: function isSameISOWeekWithOptions() {return _isSameISOWeekWithOptions;},
  204. isSameISOWeek: function isSameISOWeek() {return isSameISOWeek3;},
  205. isSameHourWithOptions: function isSameHourWithOptions() {return _isSameHourWithOptions;},
  206. isSameHour: function isSameHour() {return isSameHour3;},
  207. isSameDayWithOptions: function isSameDayWithOptions() {return _isSameDayWithOptions;},
  208. isSameDay: function isSameDay() {return isSameDay4;},
  209. isMondayWithOptions: function isMondayWithOptions() {return _isMondayWithOptions;},
  210. isMonday: function isMonday() {return isMonday3;},
  211. isMatchWithOptions: function isMatchWithOptions() {return _isMatchWithOptions;},
  212. isMatch: function isMatch() {return isMatch3;},
  213. isLeapYearWithOptions: function isLeapYearWithOptions() {return _isLeapYearWithOptions;},
  214. isLeapYear: function isLeapYear() {return isLeapYear4;},
  215. isLastDayOfMonthWithOptions: function isLastDayOfMonthWithOptions() {return _isLastDayOfMonthWithOptions;},
  216. isLastDayOfMonth: function isLastDayOfMonth() {return isLastDayOfMonth4;},
  217. isFridayWithOptions: function isFridayWithOptions() {return _isFridayWithOptions;},
  218. isFriday: function isFriday() {return isFriday3;},
  219. isFirstDayOfMonthWithOptions: function isFirstDayOfMonthWithOptions() {return _isFirstDayOfMonthWithOptions;},
  220. isFirstDayOfMonth: function isFirstDayOfMonth() {return isFirstDayOfMonth3;},
  221. isExists: function isExists() {return isExists3;},
  222. isEqual: function isEqual() {return isEqual3;},
  223. isDate: function isDate() {return isDate4;},
  224. isBefore: function isBefore() {return isBefore3;},
  225. isAfter: function isAfter() {return isAfter3;},
  226. intlFormatDistanceWithOptions: function intlFormatDistanceWithOptions() {return _intlFormatDistanceWithOptions;},
  227. intlFormatDistance: function intlFormatDistance() {return intlFormatDistance3;},
  228. intlFormat: function intlFormat() {return intlFormat3;},
  229. intervalWithOptions: function intervalWithOptions() {return _intervalWithOptions;},
  230. intervalToDurationWithOptions: function intervalToDurationWithOptions() {return _intervalToDurationWithOptions;},
  231. intervalToDuration: function intervalToDuration() {return intervalToDuration3;},
  232. interval: function interval() {return interval3;},
  233. hoursToSeconds: function hoursToSeconds() {return hoursToSeconds3;},
  234. hoursToMinutes: function hoursToMinutes() {return hoursToMinutes3;},
  235. hoursToMilliseconds: function hoursToMilliseconds() {return hoursToMilliseconds3;},
  236. getYearWithOptions: function getYearWithOptions() {return _getYearWithOptions;},
  237. getYear: function getYear() {return getYear3;},
  238. getWeeksInMonthWithOptions: function getWeeksInMonthWithOptions() {return _getWeeksInMonthWithOptions;},
  239. getWeeksInMonth: function getWeeksInMonth() {return getWeeksInMonth3;},
  240. getWeekYearWithOptions: function getWeekYearWithOptions() {return _getWeekYearWithOptions;},
  241. getWeekYear: function getWeekYear() {return getWeekYear5;},
  242. getWeekWithOptions: function getWeekWithOptions() {return _getWeekWithOptions;},
  243. getWeekOfMonthWithOptions: function getWeekOfMonthWithOptions() {return _getWeekOfMonthWithOptions;},
  244. getWeekOfMonth: function getWeekOfMonth() {return getWeekOfMonth3;},
  245. getWeek: function getWeek() {return getWeek4;},
  246. getUnixTime: function getUnixTime() {return getUnixTime3;},
  247. getTime: function getTime() {return getTime3;},
  248. getSeconds: function getSeconds() {return getSeconds3;},
  249. getQuarterWithOptions: function getQuarterWithOptions() {return _getQuarterWithOptions;},
  250. getQuarter: function getQuarter() {return getQuarter4;},
  251. getOverlappingDaysInIntervals: function getOverlappingDaysInIntervals() {return getOverlappingDaysInIntervals3;},
  252. getMonthWithOptions: function getMonthWithOptions() {return _getMonthWithOptions;},
  253. getMonth: function getMonth() {return getMonth3;},
  254. getMinutesWithOptions: function getMinutesWithOptions() {return _getMinutesWithOptions;},
  255. getMinutes: function getMinutes() {return getMinutes3;},
  256. getMilliseconds: function getMilliseconds() {return getMilliseconds3;},
  257. getISOWeeksInYearWithOptions: function getISOWeeksInYearWithOptions() {return _getISOWeeksInYearWithOptions;},
  258. getISOWeeksInYear: function getISOWeeksInYear() {return getISOWeeksInYear3;},
  259. getISOWeekYearWithOptions: function getISOWeekYearWithOptions() {return _getISOWeekYearWithOptions;},
  260. getISOWeekYear: function getISOWeekYear() {return getISOWeekYear8;},
  261. getISOWeekWithOptions: function getISOWeekWithOptions() {return _getISOWeekWithOptions;},
  262. getISOWeek: function getISOWeek() {return getISOWeek4;},
  263. getISODayWithOptions: function getISODayWithOptions() {return _getISODayWithOptions;},
  264. getISODay: function getISODay() {return getISODay3;},
  265. getHoursWithOptions: function getHoursWithOptions() {return _getHoursWithOptions;},
  266. getHours: function getHours() {return getHours3;},
  267. getDecadeWithOptions: function getDecadeWithOptions() {return _getDecadeWithOptions;},
  268. getDecade: function getDecade() {return getDecade3;},
  269. getDaysInYearWithOptions: function getDaysInYearWithOptions() {return _getDaysInYearWithOptions;},
  270. getDaysInYear: function getDaysInYear() {return getDaysInYear3;},
  271. getDaysInMonthWithOptions: function getDaysInMonthWithOptions() {return _getDaysInMonthWithOptions;},
  272. getDaysInMonth: function getDaysInMonth() {return getDaysInMonth3;},
  273. getDayWithOptions: function getDayWithOptions() {return _getDayWithOptions;},
  274. getDayOfYearWithOptions: function getDayOfYearWithOptions() {return _getDayOfYearWithOptions;},
  275. getDayOfYear: function getDayOfYear() {return getDayOfYear4;},
  276. getDay: function getDay() {return getDay3;},
  277. getDateWithOptions: function getDateWithOptions() {return _getDateWithOptions;},
  278. getDate: function getDate() {return getDate3;},
  279. fromUnixTimeWithOptions: function fromUnixTimeWithOptions() {return _fromUnixTimeWithOptions;},
  280. fromUnixTime: function fromUnixTime() {return fromUnixTime3;},
  281. formatWithOptions: function formatWithOptions() {return _formatWithOptions;},
  282. formatRelativeWithOptions: function formatRelativeWithOptions() {return _formatRelativeWithOptions;},
  283. formatRelative: function formatRelative() {return formatRelative5;},
  284. formatRFC7231: function formatRFC7231() {return formatRFC72313;},
  285. formatRFC3339WithOptions: function formatRFC3339WithOptions() {return _formatRFC3339WithOptions;},
  286. formatRFC3339: function formatRFC3339() {return formatRFC33393;},
  287. formatISOWithOptions: function formatISOWithOptions() {return _formatISOWithOptions;},
  288. formatISODuration: function formatISODuration() {return formatISODuration3;},
  289. formatISO9075WithOptions: function formatISO9075WithOptions() {return _formatISO9075WithOptions;},
  290. formatISO9075: function formatISO9075() {return formatISO90753;},
  291. formatISO: function formatISO() {return formatISO3;},
  292. formatDurationWithOptions: function formatDurationWithOptions() {return _formatDurationWithOptions;},
  293. formatDuration: function formatDuration() {return formatDuration3;},
  294. formatDistanceWithOptions: function formatDistanceWithOptions() {return _formatDistanceWithOptions;},
  295. formatDistanceStrictWithOptions: function formatDistanceStrictWithOptions() {return _formatDistanceStrictWithOptions;},
  296. formatDistanceStrict: function formatDistanceStrict() {return formatDistanceStrict3;},
  297. formatDistance: function formatDistance() {return formatDistance5;},
  298. format: function format() {return format3;},
  299. endOfYearWithOptions: function endOfYearWithOptions() {return _endOfYearWithOptions;},
  300. endOfYear: function endOfYear() {return endOfYear4;},
  301. endOfWeekWithOptions: function endOfWeekWithOptions() {return _endOfWeekWithOptions;},
  302. endOfWeek: function endOfWeek() {return endOfWeek4;},
  303. endOfSecondWithOptions: function endOfSecondWithOptions() {return _endOfSecondWithOptions;},
  304. endOfSecond: function endOfSecond() {return endOfSecond3;},
  305. endOfQuarterWithOptions: function endOfQuarterWithOptions() {return _endOfQuarterWithOptions;},
  306. endOfQuarter: function endOfQuarter() {return endOfQuarter3;},
  307. endOfMonthWithOptions: function endOfMonthWithOptions() {return _endOfMonthWithOptions;},
  308. endOfMonth: function endOfMonth() {return endOfMonth5;},
  309. endOfMinuteWithOptions: function endOfMinuteWithOptions() {return _endOfMinuteWithOptions;},
  310. endOfMinute: function endOfMinute() {return endOfMinute3;},
  311. endOfISOWeekYearWithOptions: function endOfISOWeekYearWithOptions() {return _endOfISOWeekYearWithOptions;},
  312. endOfISOWeekYear: function endOfISOWeekYear() {return endOfISOWeekYear3;},
  313. endOfISOWeekWithOptions: function endOfISOWeekWithOptions() {return _endOfISOWeekWithOptions;},
  314. endOfISOWeek: function endOfISOWeek() {return endOfISOWeek3;},
  315. endOfHourWithOptions: function endOfHourWithOptions() {return _endOfHourWithOptions;},
  316. endOfHour: function endOfHour() {return endOfHour3;},
  317. endOfDecadeWithOptions: function endOfDecadeWithOptions() {return _endOfDecadeWithOptions;},
  318. endOfDecade: function endOfDecade() {return endOfDecade3;},
  319. endOfDayWithOptions: function endOfDayWithOptions() {return _endOfDayWithOptions;},
  320. endOfDay: function endOfDay() {return endOfDay4;},
  321. eachYearOfIntervalWithOptions: function eachYearOfIntervalWithOptions() {return _eachYearOfIntervalWithOptions;},
  322. eachYearOfInterval: function eachYearOfInterval() {return eachYearOfInterval3;},
  323. eachWeekendOfYearWithOptions: function eachWeekendOfYearWithOptions() {return _eachWeekendOfYearWithOptions;},
  324. eachWeekendOfYear: function eachWeekendOfYear() {return eachWeekendOfYear3;},
  325. eachWeekendOfMonthWithOptions: function eachWeekendOfMonthWithOptions() {return _eachWeekendOfMonthWithOptions;},
  326. eachWeekendOfMonth: function eachWeekendOfMonth() {return eachWeekendOfMonth3;},
  327. eachWeekendOfIntervalWithOptions: function eachWeekendOfIntervalWithOptions() {return _eachWeekendOfIntervalWithOptions;},
  328. eachWeekendOfInterval: function eachWeekendOfInterval() {return eachWeekendOfInterval3;},
  329. eachWeekOfIntervalWithOptions: function eachWeekOfIntervalWithOptions() {return _eachWeekOfIntervalWithOptions;},
  330. eachWeekOfInterval: function eachWeekOfInterval() {return eachWeekOfInterval3;},
  331. eachQuarterOfIntervalWithOptions: function eachQuarterOfIntervalWithOptions() {return _eachQuarterOfIntervalWithOptions;},
  332. eachQuarterOfInterval: function eachQuarterOfInterval() {return eachQuarterOfInterval3;},
  333. eachMonthOfIntervalWithOptions: function eachMonthOfIntervalWithOptions() {return _eachMonthOfIntervalWithOptions;},
  334. eachMonthOfInterval: function eachMonthOfInterval() {return eachMonthOfInterval3;},
  335. eachMinuteOfIntervalWithOptions: function eachMinuteOfIntervalWithOptions() {return _eachMinuteOfIntervalWithOptions;},
  336. eachMinuteOfInterval: function eachMinuteOfInterval() {return eachMinuteOfInterval3;},
  337. eachHourOfIntervalWithOptions: function eachHourOfIntervalWithOptions() {return _eachHourOfIntervalWithOptions;},
  338. eachHourOfInterval: function eachHourOfInterval() {return eachHourOfInterval3;},
  339. eachDayOfIntervalWithOptions: function eachDayOfIntervalWithOptions() {return _eachDayOfIntervalWithOptions;},
  340. eachDayOfInterval: function eachDayOfInterval() {return eachDayOfInterval3;},
  341. differenceInYearsWithOptions: function differenceInYearsWithOptions() {return _differenceInYearsWithOptions;},
  342. differenceInYears: function differenceInYears() {return differenceInYears3;},
  343. differenceInWeeksWithOptions: function differenceInWeeksWithOptions() {return _differenceInWeeksWithOptions;},
  344. differenceInWeeks: function differenceInWeeks() {return differenceInWeeks3;},
  345. differenceInSecondsWithOptions: function differenceInSecondsWithOptions() {return _differenceInSecondsWithOptions;},
  346. differenceInSeconds: function differenceInSeconds() {return differenceInSeconds3;},
  347. differenceInQuartersWithOptions: function differenceInQuartersWithOptions() {return _differenceInQuartersWithOptions;},
  348. differenceInQuarters: function differenceInQuarters() {return differenceInQuarters3;},
  349. differenceInMonthsWithOptions: function differenceInMonthsWithOptions() {return _differenceInMonthsWithOptions;},
  350. differenceInMonths: function differenceInMonths() {return differenceInMonths3;},
  351. differenceInMinutesWithOptions: function differenceInMinutesWithOptions() {return _differenceInMinutesWithOptions;},
  352. differenceInMinutes: function differenceInMinutes() {return differenceInMinutes3;},
  353. differenceInMilliseconds: function differenceInMilliseconds() {return differenceInMilliseconds3;},
  354. differenceInISOWeekYearsWithOptions: function differenceInISOWeekYearsWithOptions() {return _differenceInISOWeekYearsWithOptions;},
  355. differenceInISOWeekYears: function differenceInISOWeekYears() {return differenceInISOWeekYears3;},
  356. differenceInHoursWithOptions: function differenceInHoursWithOptions() {return _differenceInHoursWithOptions;},
  357. differenceInHours: function differenceInHours() {return differenceInHours3;},
  358. differenceInDaysWithOptions: function differenceInDaysWithOptions() {return _differenceInDaysWithOptions;},
  359. differenceInDays: function differenceInDays() {return differenceInDays3;},
  360. differenceInCalendarYearsWithOptions: function differenceInCalendarYearsWithOptions() {return _differenceInCalendarYearsWithOptions;},
  361. differenceInCalendarYears: function differenceInCalendarYears() {return differenceInCalendarYears3;},
  362. differenceInCalendarWeeksWithOptions: function differenceInCalendarWeeksWithOptions() {return _differenceInCalendarWeeksWithOptions;},
  363. differenceInCalendarWeeks: function differenceInCalendarWeeks() {return differenceInCalendarWeeks3;},
  364. differenceInCalendarQuartersWithOptions: function differenceInCalendarQuartersWithOptions() {return _differenceInCalendarQuartersWithOptions;},
  365. differenceInCalendarQuarters: function differenceInCalendarQuarters() {return differenceInCalendarQuarters3;},
  366. differenceInCalendarMonthsWithOptions: function differenceInCalendarMonthsWithOptions() {return _differenceInCalendarMonthsWithOptions;},
  367. differenceInCalendarMonths: function differenceInCalendarMonths() {return differenceInCalendarMonths3;},
  368. differenceInCalendarISOWeeksWithOptions: function differenceInCalendarISOWeeksWithOptions() {return _differenceInCalendarISOWeeksWithOptions;},
  369. differenceInCalendarISOWeeks: function differenceInCalendarISOWeeks() {return differenceInCalendarISOWeeks3;},
  370. differenceInCalendarISOWeekYearsWithOptions: function differenceInCalendarISOWeekYearsWithOptions() {return _differenceInCalendarISOWeekYearsWithOptions;},
  371. differenceInCalendarISOWeekYears: function differenceInCalendarISOWeekYears() {return differenceInCalendarISOWeekYears3;},
  372. differenceInCalendarDaysWithOptions: function differenceInCalendarDaysWithOptions() {return _differenceInCalendarDaysWithOptions;},
  373. differenceInCalendarDays: function differenceInCalendarDays() {return differenceInCalendarDays5;},
  374. differenceInBusinessDaysWithOptions: function differenceInBusinessDaysWithOptions() {return _differenceInBusinessDaysWithOptions;},
  375. differenceInBusinessDays: function differenceInBusinessDays() {return differenceInBusinessDays3;},
  376. daysToWeeks: function daysToWeeks() {return daysToWeeks3;},
  377. constructFrom: function constructFrom() {return constructFrom16;},
  378. compareDesc: function compareDesc() {return compareDesc3;},
  379. compareAsc: function compareAsc() {return compareAsc3;},
  380. closestToWithOptions: function closestToWithOptions() {return _closestToWithOptions;},
  381. closestTo: function closestTo() {return closestTo3;},
  382. closestIndexTo: function closestIndexTo() {return closestIndexTo3;},
  383. clampWithOptions: function clampWithOptions() {return _clampWithOptions;},
  384. clamp: function clamp() {return clamp3;},
  385. areIntervalsOverlappingWithOptions: function areIntervalsOverlappingWithOptions() {return _areIntervalsOverlappingWithOptions;},
  386. areIntervalsOverlapping: function areIntervalsOverlapping() {return areIntervalsOverlapping3;},
  387. addYearsWithOptions: function addYearsWithOptions() {return _addYearsWithOptions;},
  388. addYears: function addYears() {return addYears3;},
  389. addWithOptions: function addWithOptions() {return _addWithOptions;},
  390. addWeeksWithOptions: function addWeeksWithOptions() {return _addWeeksWithOptions;},
  391. addWeeks: function addWeeks() {return addWeeks3;},
  392. addSecondsWithOptions: function addSecondsWithOptions() {return _addSecondsWithOptions;},
  393. addSeconds: function addSeconds() {return addSeconds3;},
  394. addQuartersWithOptions: function addQuartersWithOptions() {return _addQuartersWithOptions;},
  395. addQuarters: function addQuarters() {return addQuarters3;},
  396. addMonthsWithOptions: function addMonthsWithOptions() {return _addMonthsWithOptions;},
  397. addMonths: function addMonths() {return addMonths4;},
  398. addMinutesWithOptions: function addMinutesWithOptions() {return _addMinutesWithOptions;},
  399. addMinutes: function addMinutes() {return addMinutes3;},
  400. addMillisecondsWithOptions: function addMillisecondsWithOptions() {return _addMillisecondsWithOptions;},
  401. addMilliseconds: function addMilliseconds() {return addMilliseconds4;},
  402. addISOWeekYearsWithOptions: function addISOWeekYearsWithOptions() {return _addISOWeekYearsWithOptions;},
  403. addISOWeekYears: function addISOWeekYears() {return addISOWeekYears3;},
  404. addHoursWithOptions: function addHoursWithOptions() {return _addHoursWithOptions;},
  405. addHours: function addHours() {return addHours3;},
  406. addDaysWithOptions: function addDaysWithOptions() {return _addDaysWithOptions;},
  407. addDays: function addDays() {return addDays4;},
  408. addBusinessDaysWithOptions: function addBusinessDaysWithOptions() {return _addBusinessDaysWithOptions;},
  409. addBusinessDays: function addBusinessDays() {return addBusinessDays3;},
  410. add: function add() {return add3;}
  411. });
  412. // lib/constants.js
  413. var daysInWeek = 7;
  414. var daysInYear = 365.2425;
  415. var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
  416. var minTime = -maxTime;
  417. var millisecondsInWeek = 604800000;
  418. var millisecondsInDay = 86400000;
  419. var millisecondsInMinute = 60000;
  420. var millisecondsInHour = 3600000;
  421. var millisecondsInSecond = 1000;
  422. var minutesInYear = 525600;
  423. var minutesInMonth = 43200;
  424. var minutesInDay = 1440;
  425. var minutesInHour = 60;
  426. var monthsInQuarter = 3;
  427. var monthsInYear = 12;
  428. var quartersInYear = 4;
  429. var secondsInHour = 3600;
  430. var secondsInMinute = 60;
  431. var secondsInDay = secondsInHour * 24;
  432. var secondsInWeek = secondsInDay * 7;
  433. var secondsInYear = secondsInDay * daysInYear;
  434. var secondsInMonth = secondsInYear / 12;
  435. var secondsInQuarter = secondsInMonth * 3;
  436. var constructFromSymbol = Symbol.for("constructDateFrom");
  437. // lib/constructFrom.js
  438. function constructFrom(date, value) {
  439. if (typeof date === "function")
  440. return date(value);
  441. if (date && _typeof(date) === "object" && constructFromSymbol in date)
  442. return date[constructFromSymbol](value);
  443. if (date instanceof Date)
  444. return new date.constructor(value);
  445. return new Date(value);
  446. }
  447. // lib/toDate.js
  448. function toDate(argument, context) {
  449. return constructFrom(context || argument, argument);
  450. }
  451. // lib/addDays.js
  452. function addDays(date, amount, options) {
  453. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  454. if (isNaN(amount))
  455. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
  456. if (!amount)
  457. return _date;
  458. _date.setDate(_date.getDate() + amount);
  459. return _date;
  460. }
  461. // lib/addMonths.js
  462. function addMonths(date, amount, options) {
  463. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  464. if (isNaN(amount))
  465. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
  466. if (!amount) {
  467. return _date;
  468. }
  469. var dayOfMonth = _date.getDate();
  470. var endOfDesiredMonth = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, _date.getTime());
  471. endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
  472. var daysInMonth = endOfDesiredMonth.getDate();
  473. if (dayOfMonth >= daysInMonth) {
  474. return endOfDesiredMonth;
  475. } else {
  476. _date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
  477. return _date;
  478. }
  479. }
  480. // lib/add.js
  481. function add(date, duration, options) {
  482. var _duration$years =
  483. duration.years,years = _duration$years === void 0 ? 0 : _duration$years,_duration$months = duration.months,months = _duration$months === void 0 ? 0 : _duration$months,_duration$weeks = duration.weeks,weeks = _duration$weeks === void 0 ? 0 : _duration$weeks,_duration$days = duration.days,days = _duration$days === void 0 ? 0 : _duration$days,_duration$hours = duration.hours,hours = _duration$hours === void 0 ? 0 : _duration$hours,_duration$minutes = duration.minutes,minutes = _duration$minutes === void 0 ? 0 : _duration$minutes,_duration$seconds = duration.seconds,seconds = _duration$seconds === void 0 ? 0 : _duration$seconds;
  484. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  485. var dateWithMonths = months || years ? addMonths(_date, months + years * 12) : _date;
  486. var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
  487. var minutesToAdd = minutes + hours * 60;
  488. var secondsToAdd = seconds + minutesToAdd * 60;
  489. var msToAdd = secondsToAdd * 1000;
  490. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +dateWithDays + msToAdd);
  491. }
  492. // lib/fp/_lib/convertToFP.js
  493. function convertToFP(fn, arity) {var curriedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  494. return curriedArgs.length >= arity ? fn.apply(void 0, _toConsumableArray(curriedArgs.slice(0, arity).reverse())) : function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}return convertToFP(fn, arity, curriedArgs.concat(args));};
  495. }
  496. // lib/fp/add.js
  497. var add3 = convertToFP(add, 2);
  498. // lib/isSaturday.js
  499. function isSaturday(date, options) {
  500. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 6;
  501. }
  502. // lib/isSunday.js
  503. function isSunday(date, options) {
  504. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 0;
  505. }
  506. // lib/isWeekend.js
  507. function isWeekend(date, options) {
  508. var day = toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay();
  509. return day === 0 || day === 6;
  510. }
  511. // lib/addBusinessDays.js
  512. function addBusinessDays(date, amount, options) {
  513. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  514. var startedOnWeekend = isWeekend(_date, options);
  515. if (isNaN(amount))
  516. return constructFrom(options === null || options === void 0 ? void 0 : options.in, NaN);
  517. var hours = _date.getHours();
  518. var sign = amount < 0 ? -1 : 1;
  519. var fullWeeks = Math.trunc(amount / 5);
  520. _date.setDate(_date.getDate() + fullWeeks * 7);
  521. var restDays = Math.abs(amount % 5);
  522. while (restDays > 0) {
  523. _date.setDate(_date.getDate() + sign);
  524. if (!isWeekend(_date, options))
  525. restDays -= 1;
  526. }
  527. if (startedOnWeekend && isWeekend(_date, options) && amount !== 0) {
  528. if (isSaturday(_date, options))
  529. _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));
  530. if (isSunday(_date, options))
  531. _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));
  532. }
  533. _date.setHours(hours);
  534. return _date;
  535. }
  536. // lib/fp/addBusinessDays.js
  537. var addBusinessDays3 = convertToFP(addBusinessDays, 2);
  538. // lib/fp/addBusinessDaysWithOptions.js
  539. var _addBusinessDaysWithOptions = convertToFP(addBusinessDays, 3);
  540. // lib/fp/addDays.js
  541. var addDays4 = convertToFP(addDays, 2);
  542. // lib/fp/addDaysWithOptions.js
  543. var _addDaysWithOptions = convertToFP(addDays, 3);
  544. // lib/addMilliseconds.js
  545. function addMilliseconds(date, amount, options) {
  546. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +toDate(date) + amount);
  547. }
  548. // lib/addHours.js
  549. function addHours(date, amount, options) {
  550. return addMilliseconds(date, amount * millisecondsInHour, options);
  551. }
  552. // lib/fp/addHours.js
  553. var addHours3 = convertToFP(addHours, 2);
  554. // lib/fp/addHoursWithOptions.js
  555. var _addHoursWithOptions = convertToFP(addHours, 3);
  556. // lib/_lib/defaultOptions.js
  557. function getDefaultOptions() {
  558. return defaultOptions;
  559. }
  560. function setDefaultOptions(newOptions) {
  561. defaultOptions = newOptions;
  562. }
  563. var defaultOptions = {};
  564. // lib/startOfWeek.js
  565. function startOfWeek(date, options) {var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _defaultOptions3$loca;
  566. var defaultOptions3 = getDefaultOptions();
  567. var weekStartsOn = (_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 || (_options$locale = options.locale) === null || _options$locale === void 0 || (_options$locale = _options$locale.options) === null || _options$locale === void 0 ? void 0 : _options$locale.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions3$loca = defaultOptions3.locale) === null || _defaultOptions3$loca === void 0 || (_defaultOptions3$loca = _defaultOptions3$loca.options) === null || _defaultOptions3$loca === void 0 ? void 0 : _defaultOptions3$loca.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0;
  568. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  569. var day = _date.getDay();
  570. var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  571. _date.setDate(_date.getDate() - diff);
  572. _date.setHours(0, 0, 0, 0);
  573. return _date;
  574. }
  575. // lib/startOfISOWeek.js
  576. function startOfISOWeek(date, options) {
  577. return startOfWeek(date, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
  578. }
  579. // lib/getISOWeekYear.js
  580. function getISOWeekYear(date, options) {
  581. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  582. var year = _date.getFullYear();
  583. var fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
  584. fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
  585. fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
  586. var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
  587. var fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
  588. fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
  589. fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
  590. var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
  591. if (_date.getTime() >= startOfNextYear.getTime()) {
  592. return year + 1;
  593. } else if (_date.getTime() >= startOfThisYear.getTime()) {
  594. return year;
  595. } else {
  596. return year - 1;
  597. }
  598. }
  599. // lib/_lib/getTimezoneOffsetInMilliseconds.js
  600. function getTimezoneOffsetInMilliseconds(date) {
  601. var _date = toDate(date);
  602. var utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
  603. utcDate.setUTCFullYear(_date.getFullYear());
  604. return +date - +utcDate;
  605. }
  606. // lib/_lib/normalizeDates.js
  607. function normalizeDates(context) {for (var _len2 = arguments.length, dates = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {dates[_key2 - 1] = arguments[_key2];}
  608. var normalize = constructFrom.bind(null, context || dates.find(function (date) {return _typeof(date) === "object";}));
  609. return dates.map(normalize);
  610. }
  611. // lib/startOfDay.js
  612. function startOfDay(date, options) {
  613. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  614. _date.setHours(0, 0, 0, 0);
  615. return _date;
  616. }
  617. // lib/differenceInCalendarDays.js
  618. function differenceInCalendarDays(laterDate, earlierDate, options) {
  619. var _normalizeDates = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates2 = _slicedToArray(_normalizeDates, 2),laterDate_ = _normalizeDates2[0],earlierDate_ = _normalizeDates2[1];
  620. var laterStartOfDay = startOfDay(laterDate_);
  621. var earlierStartOfDay = startOfDay(earlierDate_);
  622. var laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
  623. var earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
  624. return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
  625. }
  626. // lib/startOfISOWeekYear.js
  627. function startOfISOWeekYear(date, options) {
  628. var year = getISOWeekYear(date, options);
  629. var fourthOfJanuary = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  630. fourthOfJanuary.setFullYear(year, 0, 4);
  631. fourthOfJanuary.setHours(0, 0, 0, 0);
  632. return startOfISOWeek(fourthOfJanuary);
  633. }
  634. // lib/setISOWeekYear.js
  635. function setISOWeekYear(date, weekYear, options) {
  636. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  637. var diff = differenceInCalendarDays(_date, startOfISOWeekYear(_date, options));
  638. var fourthOfJanuary = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  639. fourthOfJanuary.setFullYear(weekYear, 0, 4);
  640. fourthOfJanuary.setHours(0, 0, 0, 0);
  641. _date = startOfISOWeekYear(fourthOfJanuary);
  642. _date.setDate(_date.getDate() + diff);
  643. return _date;
  644. }
  645. // lib/addISOWeekYears.js
  646. function addISOWeekYears(date, amount, options) {
  647. return setISOWeekYear(date, getISOWeekYear(date, options) + amount, options);
  648. }
  649. // lib/fp/addISOWeekYears.js
  650. var addISOWeekYears3 = convertToFP(addISOWeekYears, 2);
  651. // lib/fp/addISOWeekYearsWithOptions.js
  652. var _addISOWeekYearsWithOptions = convertToFP(addISOWeekYears, 3);
  653. // lib/fp/addMilliseconds.js
  654. var addMilliseconds4 = convertToFP(addMilliseconds, 2);
  655. // lib/fp/addMillisecondsWithOptions.js
  656. var _addMillisecondsWithOptions = convertToFP(addMilliseconds, 3);
  657. // lib/addMinutes.js
  658. function addMinutes(date, amount, options) {
  659. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  660. _date.setTime(_date.getTime() + amount * millisecondsInMinute);
  661. return _date;
  662. }
  663. // lib/fp/addMinutes.js
  664. var addMinutes3 = convertToFP(addMinutes, 2);
  665. // lib/fp/addMinutesWithOptions.js
  666. var _addMinutesWithOptions = convertToFP(addMinutes, 3);
  667. // lib/fp/addMonths.js
  668. var addMonths4 = convertToFP(addMonths, 2);
  669. // lib/fp/addMonthsWithOptions.js
  670. var _addMonthsWithOptions = convertToFP(addMonths, 3);
  671. // lib/addQuarters.js
  672. function addQuarters(date, amount, options) {
  673. return addMonths(date, amount * 3, options);
  674. }
  675. // lib/fp/addQuarters.js
  676. var addQuarters3 = convertToFP(addQuarters, 2);
  677. // lib/fp/addQuartersWithOptions.js
  678. var _addQuartersWithOptions = convertToFP(addQuarters, 3);
  679. // lib/addSeconds.js
  680. function addSeconds(date, amount, options) {
  681. return addMilliseconds(date, amount * 1000, options);
  682. }
  683. // lib/fp/addSeconds.js
  684. var addSeconds3 = convertToFP(addSeconds, 2);
  685. // lib/fp/addSecondsWithOptions.js
  686. var _addSecondsWithOptions = convertToFP(addSeconds, 3);
  687. // lib/addWeeks.js
  688. function addWeeks(date, amount, options) {
  689. return addDays(date, amount * 7, options);
  690. }
  691. // lib/fp/addWeeks.js
  692. var addWeeks3 = convertToFP(addWeeks, 2);
  693. // lib/fp/addWeeksWithOptions.js
  694. var _addWeeksWithOptions = convertToFP(addWeeks, 3);
  695. // lib/fp/addWithOptions.js
  696. var _addWithOptions = convertToFP(add, 3);
  697. // lib/addYears.js
  698. function addYears(date, amount, options) {
  699. return addMonths(date, amount * 12, options);
  700. }
  701. // lib/fp/addYears.js
  702. var addYears3 = convertToFP(addYears, 2);
  703. // lib/fp/addYearsWithOptions.js
  704. var _addYearsWithOptions = convertToFP(addYears, 3);
  705. // lib/areIntervalsOverlapping.js
  706. function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
  707. var _sort = [
  708. +toDate(intervalLeft.start, options === null || options === void 0 ? void 0 : options.in),
  709. +toDate(intervalLeft.end, options === null || options === void 0 ? void 0 : options.in)].
  710. sort(function (a, b) {return a - b;}),_sort2 = _slicedToArray(_sort, 2),leftStartTime = _sort2[0],leftEndTime = _sort2[1];
  711. var _sort3 = [
  712. +toDate(intervalRight.start, options === null || options === void 0 ? void 0 : options.in),
  713. +toDate(intervalRight.end, options === null || options === void 0 ? void 0 : options.in)].
  714. sort(function (a, b) {return a - b;}),_sort4 = _slicedToArray(_sort3, 2),rightStartTime = _sort4[0],rightEndTime = _sort4[1];
  715. if (options !== null && options !== void 0 && options.inclusive)
  716. return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
  717. return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
  718. }
  719. // lib/fp/areIntervalsOverlapping.js
  720. var areIntervalsOverlapping3 = convertToFP(areIntervalsOverlapping, 2);
  721. // lib/fp/areIntervalsOverlappingWithOptions.js
  722. var _areIntervalsOverlappingWithOptions = convertToFP(areIntervalsOverlapping, 3);
  723. // lib/max.js
  724. function max(dates, options) {
  725. var result;
  726. var context = options === null || options === void 0 ? void 0 : options.in;
  727. dates.forEach(function (date) {
  728. if (!context && _typeof(date) === "object")
  729. context = constructFrom.bind(null, date);
  730. var date_ = toDate(date, context);
  731. if (!result || result < date_ || isNaN(+date_))
  732. result = date_;
  733. });
  734. return constructFrom(context, result || NaN);
  735. }
  736. // lib/min.js
  737. function min(dates, options) {
  738. var result;
  739. var context = options === null || options === void 0 ? void 0 : options.in;
  740. dates.forEach(function (date) {
  741. if (!context && _typeof(date) === "object")
  742. context = constructFrom.bind(null, date);
  743. var date_ = toDate(date, context);
  744. if (!result || result > date_ || isNaN(+date_))
  745. result = date_;
  746. });
  747. return constructFrom(context, result || NaN);
  748. }
  749. // lib/clamp.js
  750. function clamp(date, interval, options) {
  751. var _normalizeDates3 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, date, interval.start, interval.end),_normalizeDates4 = _slicedToArray(_normalizeDates3, 3),date_ = _normalizeDates4[0],start = _normalizeDates4[1],end = _normalizeDates4[2];
  752. return min([max([date_, start], options), end], options);
  753. }
  754. // lib/fp/clamp.js
  755. var clamp3 = convertToFP(clamp, 2);
  756. // lib/fp/clampWithOptions.js
  757. var _clampWithOptions = convertToFP(clamp, 3);
  758. // lib/closestIndexTo.js
  759. function closestIndexTo(dateToCompare, dates) {
  760. var timeToCompare = +toDate(dateToCompare);
  761. if (isNaN(timeToCompare))
  762. return NaN;
  763. var result;
  764. var minDistance;
  765. dates.forEach(function (date, index) {
  766. var date_ = toDate(date);
  767. if (isNaN(+date_)) {
  768. result = NaN;
  769. minDistance = NaN;
  770. return;
  771. }
  772. var distance = Math.abs(timeToCompare - +date_);
  773. if (result == null || distance < minDistance) {
  774. result = index;
  775. minDistance = distance;
  776. }
  777. });
  778. return result;
  779. }
  780. // lib/fp/closestIndexTo.js
  781. var closestIndexTo3 = convertToFP(closestIndexTo, 2);
  782. // lib/closestTo.js
  783. function closestTo(dateToCompare, dates, options) {
  784. var _normalizeDates5 = normalizeDates.apply(void 0, [options === null || options === void 0 ? void 0 : options.in, dateToCompare].concat(_toConsumableArray(dates))),_normalizeDates6 = _toArray(_normalizeDates5),dateToCompare_ = _normalizeDates6[0],dates_ = _normalizeDates6.slice(1);
  785. var index = closestIndexTo(dateToCompare_, dates_);
  786. if (typeof index === "number" && isNaN(index))
  787. return constructFrom(dateToCompare_, NaN);
  788. if (index !== undefined)
  789. return dates_[index];
  790. }
  791. // lib/fp/closestTo.js
  792. var closestTo3 = convertToFP(closestTo, 2);
  793. // lib/fp/closestToWithOptions.js
  794. var _closestToWithOptions = convertToFP(closestTo, 3);
  795. // lib/compareAsc.js
  796. function compareAsc(dateLeft, dateRight) {
  797. var diff = +toDate(dateLeft) - +toDate(dateRight);
  798. if (diff < 0)
  799. return -1;else
  800. if (diff > 0)
  801. return 1;
  802. return diff;
  803. }
  804. // lib/fp/compareAsc.js
  805. var compareAsc3 = convertToFP(compareAsc, 2);
  806. // lib/compareDesc.js
  807. function compareDesc(dateLeft, dateRight) {
  808. var diff = +toDate(dateLeft) - +toDate(dateRight);
  809. if (diff > 0)
  810. return -1;else
  811. if (diff < 0)
  812. return 1;
  813. return diff;
  814. }
  815. // lib/fp/compareDesc.js
  816. var compareDesc3 = convertToFP(compareDesc, 2);
  817. // lib/fp/constructFrom.js
  818. var constructFrom16 = convertToFP(constructFrom, 2);
  819. // lib/daysToWeeks.js
  820. function daysToWeeks(days) {
  821. var result = Math.trunc(days / daysInWeek);
  822. return result === 0 ? 0 : result;
  823. }
  824. // lib/fp/daysToWeeks.js
  825. var daysToWeeks3 = convertToFP(daysToWeeks, 1);
  826. // lib/isSameDay.js
  827. function isSameDay(laterDate, earlierDate, options) {
  828. var _normalizeDates7 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates8 = _slicedToArray(_normalizeDates7, 2),dateLeft_ = _normalizeDates8[0],dateRight_ = _normalizeDates8[1];
  829. return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
  830. }
  831. // lib/isDate.js
  832. function isDate(value) {
  833. return value instanceof Date || _typeof(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
  834. }
  835. // lib/isValid.js
  836. function isValid(date) {
  837. return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
  838. }
  839. // lib/differenceInBusinessDays.js
  840. function differenceInBusinessDays(laterDate, earlierDate, options) {
  841. var _normalizeDates9 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates10 = _slicedToArray(_normalizeDates9, 2),laterDate_ = _normalizeDates10[0],earlierDate_ = _normalizeDates10[1];
  842. if (!isValid(laterDate_) || !isValid(earlierDate_))
  843. return NaN;
  844. var diff = differenceInCalendarDays(laterDate_, earlierDate_);
  845. var sign = diff < 0 ? -1 : 1;
  846. var weeks = Math.trunc(diff / 7);
  847. var result = weeks * 5;
  848. var movingDate = addDays(earlierDate_, weeks * 7);
  849. while (!isSameDay(laterDate_, movingDate)) {
  850. result += isWeekend(movingDate, options) ? 0 : sign;
  851. movingDate = addDays(movingDate, sign);
  852. }
  853. return result === 0 ? 0 : result;
  854. }
  855. // lib/fp/differenceInBusinessDays.js
  856. var differenceInBusinessDays3 = convertToFP(differenceInBusinessDays, 2);
  857. // lib/fp/differenceInBusinessDaysWithOptions.js
  858. var _differenceInBusinessDaysWithOptions = convertToFP(differenceInBusinessDays, 3);
  859. // lib/fp/differenceInCalendarDays.js
  860. var differenceInCalendarDays5 = convertToFP(differenceInCalendarDays, 2);
  861. // lib/fp/differenceInCalendarDaysWithOptions.js
  862. var _differenceInCalendarDaysWithOptions = convertToFP(differenceInCalendarDays, 3);
  863. // lib/differenceInCalendarISOWeekYears.js
  864. function differenceInCalendarISOWeekYears(laterDate, earlierDate, options) {
  865. var _normalizeDates11 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates12 = _slicedToArray(_normalizeDates11, 2),laterDate_ = _normalizeDates12[0],earlierDate_ = _normalizeDates12[1];
  866. return getISOWeekYear(laterDate_, options) - getISOWeekYear(earlierDate_, options);
  867. }
  868. // lib/fp/differenceInCalendarISOWeekYears.js
  869. var differenceInCalendarISOWeekYears3 = convertToFP(differenceInCalendarISOWeekYears, 2);
  870. // lib/fp/differenceInCalendarISOWeekYearsWithOptions.js
  871. var _differenceInCalendarISOWeekYearsWithOptions = convertToFP(differenceInCalendarISOWeekYears, 3);
  872. // lib/differenceInCalendarISOWeeks.js
  873. function differenceInCalendarISOWeeks(laterDate, earlierDate, options) {
  874. var _normalizeDates13 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates14 = _slicedToArray(_normalizeDates13, 2),laterDate_ = _normalizeDates14[0],earlierDate_ = _normalizeDates14[1];
  875. var startOfISOWeekLeft = startOfISOWeek(laterDate_);
  876. var startOfISOWeekRight = startOfISOWeek(earlierDate_);
  877. var timestampLeft = +startOfISOWeekLeft - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);
  878. var timestampRight = +startOfISOWeekRight - getTimezoneOffsetInMilliseconds(startOfISOWeekRight);
  879. return Math.round((timestampLeft - timestampRight) / millisecondsInWeek);
  880. }
  881. // lib/fp/differenceInCalendarISOWeeks.js
  882. var differenceInCalendarISOWeeks3 = convertToFP(differenceInCalendarISOWeeks, 2);
  883. // lib/fp/differenceInCalendarISOWeeksWithOptions.js
  884. var _differenceInCalendarISOWeeksWithOptions = convertToFP(differenceInCalendarISOWeeks, 3);
  885. // lib/differenceInCalendarMonths.js
  886. function differenceInCalendarMonths(laterDate, earlierDate, options) {
  887. var _normalizeDates15 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates16 = _slicedToArray(_normalizeDates15, 2),laterDate_ = _normalizeDates16[0],earlierDate_ = _normalizeDates16[1];
  888. var yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
  889. var monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
  890. return yearsDiff * 12 + monthsDiff;
  891. }
  892. // lib/fp/differenceInCalendarMonths.js
  893. var differenceInCalendarMonths3 = convertToFP(differenceInCalendarMonths, 2);
  894. // lib/fp/differenceInCalendarMonthsWithOptions.js
  895. var _differenceInCalendarMonthsWithOptions = convertToFP(differenceInCalendarMonths, 3);
  896. // lib/getQuarter.js
  897. function getQuarter(date, options) {
  898. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  899. var quarter = Math.trunc(_date.getMonth() / 3) + 1;
  900. return quarter;
  901. }
  902. // lib/differenceInCalendarQuarters.js
  903. function differenceInCalendarQuarters(laterDate, earlierDate, options) {
  904. var _normalizeDates17 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates18 = _slicedToArray(_normalizeDates17, 2),laterDate_ = _normalizeDates18[0],earlierDate_ = _normalizeDates18[1];
  905. var yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
  906. var quartersDiff = getQuarter(laterDate_) - getQuarter(earlierDate_);
  907. return yearsDiff * 4 + quartersDiff;
  908. }
  909. // lib/fp/differenceInCalendarQuarters.js
  910. var differenceInCalendarQuarters3 = convertToFP(differenceInCalendarQuarters, 2);
  911. // lib/fp/differenceInCalendarQuartersWithOptions.js
  912. var _differenceInCalendarQuartersWithOptions = convertToFP(differenceInCalendarQuarters, 3);
  913. // lib/differenceInCalendarWeeks.js
  914. function differenceInCalendarWeeks(laterDate, earlierDate, options) {
  915. var _normalizeDates19 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates20 = _slicedToArray(_normalizeDates19, 2),laterDate_ = _normalizeDates20[0],earlierDate_ = _normalizeDates20[1];
  916. var laterStartOfWeek = startOfWeek(laterDate_, options);
  917. var earlierStartOfWeek = startOfWeek(earlierDate_, options);
  918. var laterTimestamp = +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek);
  919. var earlierTimestamp = +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek);
  920. return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek);
  921. }
  922. // lib/fp/differenceInCalendarWeeks.js
  923. var differenceInCalendarWeeks3 = convertToFP(differenceInCalendarWeeks, 2);
  924. // lib/fp/differenceInCalendarWeeksWithOptions.js
  925. var _differenceInCalendarWeeksWithOptions = convertToFP(differenceInCalendarWeeks, 3);
  926. // lib/differenceInCalendarYears.js
  927. function differenceInCalendarYears(laterDate, earlierDate, options) {
  928. var _normalizeDates21 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates22 = _slicedToArray(_normalizeDates21, 2),laterDate_ = _normalizeDates22[0],earlierDate_ = _normalizeDates22[1];
  929. return laterDate_.getFullYear() - earlierDate_.getFullYear();
  930. }
  931. // lib/fp/differenceInCalendarYears.js
  932. var differenceInCalendarYears3 = convertToFP(differenceInCalendarYears, 2);
  933. // lib/fp/differenceInCalendarYearsWithOptions.js
  934. var _differenceInCalendarYearsWithOptions = convertToFP(differenceInCalendarYears, 3);
  935. // lib/differenceInDays.js
  936. function differenceInDays(laterDate, earlierDate, options) {
  937. var _normalizeDates23 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates24 = _slicedToArray(_normalizeDates23, 2),laterDate_ = _normalizeDates24[0],earlierDate_ = _normalizeDates24[1];
  938. var sign = compareLocalAsc(laterDate_, earlierDate_);
  939. var difference = Math.abs(differenceInCalendarDays(laterDate_, earlierDate_));
  940. laterDate_.setDate(laterDate_.getDate() - sign * difference);
  941. var isLastDayNotFull = Number(compareLocalAsc(laterDate_, earlierDate_) === -sign);
  942. var result = sign * (difference - isLastDayNotFull);
  943. return result === 0 ? 0 : result;
  944. }
  945. function compareLocalAsc(laterDate, earlierDate) {
  946. var diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds();
  947. if (diff < 0)
  948. return -1;
  949. if (diff > 0)
  950. return 1;
  951. return diff;
  952. }
  953. // lib/fp/differenceInDays.js
  954. var differenceInDays3 = convertToFP(differenceInDays, 2);
  955. // lib/fp/differenceInDaysWithOptions.js
  956. var _differenceInDaysWithOptions = convertToFP(differenceInDays, 3);
  957. // lib/_lib/getRoundingMethod.js
  958. function getRoundingMethod(method) {
  959. return function (number) {
  960. var round = method ? Math[method] : Math.trunc;
  961. var result = round(number);
  962. return result === 0 ? 0 : result;
  963. };
  964. }
  965. // lib/differenceInHours.js
  966. function differenceInHours(laterDate, earlierDate, options) {
  967. var _normalizeDates25 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates26 = _slicedToArray(_normalizeDates25, 2),laterDate_ = _normalizeDates26[0],earlierDate_ = _normalizeDates26[1];
  968. var diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;
  969. return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
  970. }
  971. // lib/fp/differenceInHours.js
  972. var differenceInHours3 = convertToFP(differenceInHours, 2);
  973. // lib/fp/differenceInHoursWithOptions.js
  974. var _differenceInHoursWithOptions = convertToFP(differenceInHours, 3);
  975. // lib/subISOWeekYears.js
  976. function subISOWeekYears(date, amount, options) {
  977. return addISOWeekYears(date, -amount, options);
  978. }
  979. // lib/differenceInISOWeekYears.js
  980. function differenceInISOWeekYears(laterDate, earlierDate, options) {
  981. var _normalizeDates27 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates28 = _slicedToArray(_normalizeDates27, 2),laterDate_ = _normalizeDates28[0],earlierDate_ = _normalizeDates28[1];
  982. var sign = compareAsc(laterDate_, earlierDate_);
  983. var diff = Math.abs(differenceInCalendarISOWeekYears(laterDate_, earlierDate_, options));
  984. var adjustedDate = subISOWeekYears(laterDate_, sign * diff, options);
  985. var isLastISOWeekYearNotFull = Number(compareAsc(adjustedDate, earlierDate_) === -sign);
  986. var result = sign * (diff - isLastISOWeekYearNotFull);
  987. return result === 0 ? 0 : result;
  988. }
  989. // lib/fp/differenceInISOWeekYears.js
  990. var differenceInISOWeekYears3 = convertToFP(differenceInISOWeekYears, 2);
  991. // lib/fp/differenceInISOWeekYearsWithOptions.js
  992. var _differenceInISOWeekYearsWithOptions = convertToFP(differenceInISOWeekYears, 3);
  993. // lib/differenceInMilliseconds.js
  994. function differenceInMilliseconds(laterDate, earlierDate) {
  995. return +toDate(laterDate) - +toDate(earlierDate);
  996. }
  997. // lib/fp/differenceInMilliseconds.js
  998. var differenceInMilliseconds3 = convertToFP(differenceInMilliseconds, 2);
  999. // lib/differenceInMinutes.js
  1000. function differenceInMinutes(dateLeft, dateRight, options) {
  1001. var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
  1002. return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
  1003. }
  1004. // lib/fp/differenceInMinutes.js
  1005. var differenceInMinutes3 = convertToFP(differenceInMinutes, 2);
  1006. // lib/fp/differenceInMinutesWithOptions.js
  1007. var _differenceInMinutesWithOptions = convertToFP(differenceInMinutes, 3);
  1008. // lib/endOfDay.js
  1009. function endOfDay(date, options) {
  1010. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1011. _date.setHours(23, 59, 59, 999);
  1012. return _date;
  1013. }
  1014. // lib/endOfMonth.js
  1015. function endOfMonth(date, options) {
  1016. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1017. var month = _date.getMonth();
  1018. _date.setFullYear(_date.getFullYear(), month + 1, 0);
  1019. _date.setHours(23, 59, 59, 999);
  1020. return _date;
  1021. }
  1022. // lib/isLastDayOfMonth.js
  1023. function isLastDayOfMonth(date, options) {
  1024. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1025. return +endOfDay(_date, options) === +endOfMonth(_date, options);
  1026. }
  1027. // lib/differenceInMonths.js
  1028. function differenceInMonths(laterDate, earlierDate, options) {
  1029. var _normalizeDates29 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, laterDate, earlierDate),_normalizeDates30 = _slicedToArray(_normalizeDates29, 3),laterDate_ = _normalizeDates30[0],workingLaterDate = _normalizeDates30[1],earlierDate_ = _normalizeDates30[2];
  1030. var sign = compareAsc(workingLaterDate, earlierDate_);
  1031. var difference = Math.abs(differenceInCalendarMonths(workingLaterDate, earlierDate_));
  1032. if (difference < 1)
  1033. return 0;
  1034. if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
  1035. workingLaterDate.setDate(30);
  1036. workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
  1037. var isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
  1038. if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
  1039. isLastMonthNotFull = false;
  1040. }
  1041. var result = sign * (difference - +isLastMonthNotFull);
  1042. return result === 0 ? 0 : result;
  1043. }
  1044. // lib/fp/differenceInMonths.js
  1045. var differenceInMonths3 = convertToFP(differenceInMonths, 2);
  1046. // lib/fp/differenceInMonthsWithOptions.js
  1047. var _differenceInMonthsWithOptions = convertToFP(differenceInMonths, 3);
  1048. // lib/differenceInQuarters.js
  1049. function differenceInQuarters(laterDate, earlierDate, options) {
  1050. var diff = differenceInMonths(laterDate, earlierDate, options) / 3;
  1051. return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
  1052. }
  1053. // lib/fp/differenceInQuarters.js
  1054. var differenceInQuarters3 = convertToFP(differenceInQuarters, 2);
  1055. // lib/fp/differenceInQuartersWithOptions.js
  1056. var _differenceInQuartersWithOptions = convertToFP(differenceInQuarters, 3);
  1057. // lib/differenceInSeconds.js
  1058. function differenceInSeconds(laterDate, earlierDate, options) {
  1059. var diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;
  1060. return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
  1061. }
  1062. // lib/fp/differenceInSeconds.js
  1063. var differenceInSeconds3 = convertToFP(differenceInSeconds, 2);
  1064. // lib/fp/differenceInSecondsWithOptions.js
  1065. var _differenceInSecondsWithOptions = convertToFP(differenceInSeconds, 3);
  1066. // lib/differenceInWeeks.js
  1067. function differenceInWeeks(laterDate, earlierDate, options) {
  1068. var diff = differenceInDays(laterDate, earlierDate, options) / 7;
  1069. return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
  1070. }
  1071. // lib/fp/differenceInWeeks.js
  1072. var differenceInWeeks3 = convertToFP(differenceInWeeks, 2);
  1073. // lib/fp/differenceInWeeksWithOptions.js
  1074. var _differenceInWeeksWithOptions = convertToFP(differenceInWeeks, 3);
  1075. // lib/differenceInYears.js
  1076. function differenceInYears(laterDate, earlierDate, options) {
  1077. var _normalizeDates31 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates32 = _slicedToArray(_normalizeDates31, 2),laterDate_ = _normalizeDates32[0],earlierDate_ = _normalizeDates32[1];
  1078. var sign = compareAsc(laterDate_, earlierDate_);
  1079. var diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_));
  1080. laterDate_.setFullYear(1584);
  1081. earlierDate_.setFullYear(1584);
  1082. var partial = compareAsc(laterDate_, earlierDate_) === -sign;
  1083. var result = sign * (diff - +partial);
  1084. return result === 0 ? 0 : result;
  1085. }
  1086. // lib/fp/differenceInYears.js
  1087. var differenceInYears3 = convertToFP(differenceInYears, 2);
  1088. // lib/fp/differenceInYearsWithOptions.js
  1089. var _differenceInYearsWithOptions = convertToFP(differenceInYears, 3);
  1090. // lib/_lib/normalizeInterval.js
  1091. function normalizeInterval(context, interval) {
  1092. var _normalizeDates33 = normalizeDates(context, interval.start, interval.end),_normalizeDates34 = _slicedToArray(_normalizeDates33, 2),start = _normalizeDates34[0],end = _normalizeDates34[1];
  1093. return { start: start, end: end };
  1094. }
  1095. // lib/eachDayOfInterval.js
  1096. function eachDayOfInterval(interval, options) {var _options$step;
  1097. var _normalizeInterval = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval.start,end = _normalizeInterval.end;
  1098. var reversed = +start > +end;
  1099. var endTime = reversed ? +start : +end;
  1100. var date = reversed ? end : start;
  1101. date.setHours(0, 0, 0, 0);
  1102. var step = (_options$step = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step !== void 0 ? _options$step : 1;
  1103. if (!step)
  1104. return [];
  1105. if (step < 0) {
  1106. step = -step;
  1107. reversed = !reversed;
  1108. }
  1109. var dates = [];
  1110. while (+date <= endTime) {
  1111. dates.push(constructFrom(start, date));
  1112. date.setDate(date.getDate() + step);
  1113. date.setHours(0, 0, 0, 0);
  1114. }
  1115. return reversed ? dates.reverse() : dates;
  1116. }
  1117. // lib/fp/eachDayOfInterval.js
  1118. var eachDayOfInterval3 = convertToFP(eachDayOfInterval, 1);
  1119. // lib/fp/eachDayOfIntervalWithOptions.js
  1120. var _eachDayOfIntervalWithOptions = convertToFP(eachDayOfInterval, 2);
  1121. // lib/eachHourOfInterval.js
  1122. function eachHourOfInterval(interval, options) {var _options$step2;
  1123. var _normalizeInterval2 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval2.start,end = _normalizeInterval2.end;
  1124. var reversed = +start > +end;
  1125. var endTime = reversed ? +start : +end;
  1126. var date = reversed ? end : start;
  1127. date.setMinutes(0, 0, 0);
  1128. var step = (_options$step2 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step2 !== void 0 ? _options$step2 : 1;
  1129. if (!step)
  1130. return [];
  1131. if (step < 0) {
  1132. step = -step;
  1133. reversed = !reversed;
  1134. }
  1135. var dates = [];
  1136. while (+date <= endTime) {
  1137. dates.push(constructFrom(start, date));
  1138. date.setHours(date.getHours() + step);
  1139. }
  1140. return reversed ? dates.reverse() : dates;
  1141. }
  1142. // lib/fp/eachHourOfInterval.js
  1143. var eachHourOfInterval3 = convertToFP(eachHourOfInterval, 1);
  1144. // lib/fp/eachHourOfIntervalWithOptions.js
  1145. var _eachHourOfIntervalWithOptions = convertToFP(eachHourOfInterval, 2);
  1146. // lib/eachMinuteOfInterval.js
  1147. function eachMinuteOfInterval(interval, options) {var _options$step3;
  1148. var _normalizeInterval3 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval3.start,end = _normalizeInterval3.end;
  1149. start.setSeconds(0, 0);
  1150. var reversed = +start > +end;
  1151. var endTime = reversed ? +start : +end;
  1152. var date = reversed ? end : start;
  1153. var step = (_options$step3 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step3 !== void 0 ? _options$step3 : 1;
  1154. if (!step)
  1155. return [];
  1156. if (step < 0) {
  1157. step = -step;
  1158. reversed = !reversed;
  1159. }
  1160. var dates = [];
  1161. while (+date <= endTime) {
  1162. dates.push(constructFrom(start, date));
  1163. date = addMinutes(date, step);
  1164. }
  1165. return reversed ? dates.reverse() : dates;
  1166. }
  1167. // lib/fp/eachMinuteOfInterval.js
  1168. var eachMinuteOfInterval3 = convertToFP(eachMinuteOfInterval, 1);
  1169. // lib/fp/eachMinuteOfIntervalWithOptions.js
  1170. var _eachMinuteOfIntervalWithOptions = convertToFP(eachMinuteOfInterval, 2);
  1171. // lib/eachMonthOfInterval.js
  1172. function eachMonthOfInterval(interval, options) {var _options$step4;
  1173. var _normalizeInterval4 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval4.start,end = _normalizeInterval4.end;
  1174. var reversed = +start > +end;
  1175. var endTime = reversed ? +start : +end;
  1176. var date = reversed ? end : start;
  1177. date.setHours(0, 0, 0, 0);
  1178. date.setDate(1);
  1179. var step = (_options$step4 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step4 !== void 0 ? _options$step4 : 1;
  1180. if (!step)
  1181. return [];
  1182. if (step < 0) {
  1183. step = -step;
  1184. reversed = !reversed;
  1185. }
  1186. var dates = [];
  1187. while (+date <= endTime) {
  1188. dates.push(constructFrom(start, date));
  1189. date.setMonth(date.getMonth() + step);
  1190. }
  1191. return reversed ? dates.reverse() : dates;
  1192. }
  1193. // lib/fp/eachMonthOfInterval.js
  1194. var eachMonthOfInterval3 = convertToFP(eachMonthOfInterval, 1);
  1195. // lib/fp/eachMonthOfIntervalWithOptions.js
  1196. var _eachMonthOfIntervalWithOptions = convertToFP(eachMonthOfInterval, 2);
  1197. // lib/startOfQuarter.js
  1198. function startOfQuarter(date, options) {
  1199. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1200. var currentMonth = _date.getMonth();
  1201. var month = currentMonth - currentMonth % 3;
  1202. _date.setMonth(month, 1);
  1203. _date.setHours(0, 0, 0, 0);
  1204. return _date;
  1205. }
  1206. // lib/eachQuarterOfInterval.js
  1207. function eachQuarterOfInterval(interval, options) {var _options$step5;
  1208. var _normalizeInterval5 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval5.start,end = _normalizeInterval5.end;
  1209. var reversed = +start > +end;
  1210. var endTime = reversed ? +startOfQuarter(start) : +startOfQuarter(end);
  1211. var date = reversed ? startOfQuarter(end) : startOfQuarter(start);
  1212. var step = (_options$step5 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step5 !== void 0 ? _options$step5 : 1;
  1213. if (!step)
  1214. return [];
  1215. if (step < 0) {
  1216. step = -step;
  1217. reversed = !reversed;
  1218. }
  1219. var dates = [];
  1220. while (+date <= endTime) {
  1221. dates.push(constructFrom(start, date));
  1222. date = addQuarters(date, step);
  1223. }
  1224. return reversed ? dates.reverse() : dates;
  1225. }
  1226. // lib/fp/eachQuarterOfInterval.js
  1227. var eachQuarterOfInterval3 = convertToFP(eachQuarterOfInterval, 1);
  1228. // lib/fp/eachQuarterOfIntervalWithOptions.js
  1229. var _eachQuarterOfIntervalWithOptions = convertToFP(eachQuarterOfInterval, 2);
  1230. // lib/eachWeekOfInterval.js
  1231. function eachWeekOfInterval(interval, options) {var _options$step6;
  1232. var _normalizeInterval6 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval6.start,end = _normalizeInterval6.end;
  1233. var reversed = +start > +end;
  1234. var startDateWeek = reversed ? startOfWeek(end, options) : startOfWeek(start, options);
  1235. var endDateWeek = reversed ? startOfWeek(start, options) : startOfWeek(end, options);
  1236. startDateWeek.setHours(15);
  1237. endDateWeek.setHours(15);
  1238. var endTime = +endDateWeek.getTime();
  1239. var currentDate = startDateWeek;
  1240. var step = (_options$step6 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step6 !== void 0 ? _options$step6 : 1;
  1241. if (!step)
  1242. return [];
  1243. if (step < 0) {
  1244. step = -step;
  1245. reversed = !reversed;
  1246. }
  1247. var dates = [];
  1248. while (+currentDate <= endTime) {
  1249. currentDate.setHours(0);
  1250. dates.push(constructFrom(start, currentDate));
  1251. currentDate = addWeeks(currentDate, step);
  1252. currentDate.setHours(15);
  1253. }
  1254. return reversed ? dates.reverse() : dates;
  1255. }
  1256. // lib/fp/eachWeekOfInterval.js
  1257. var eachWeekOfInterval3 = convertToFP(eachWeekOfInterval, 1);
  1258. // lib/fp/eachWeekOfIntervalWithOptions.js
  1259. var _eachWeekOfIntervalWithOptions = convertToFP(eachWeekOfInterval, 2);
  1260. // lib/eachWeekendOfInterval.js
  1261. function eachWeekendOfInterval(interval, options) {
  1262. var _normalizeInterval7 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval7.start,end = _normalizeInterval7.end;
  1263. var dateInterval = eachDayOfInterval({ start: start, end: end }, options);
  1264. var weekends = [];
  1265. var index = 0;
  1266. while (index < dateInterval.length) {
  1267. var date = dateInterval[index++];
  1268. if (isWeekend(date))
  1269. weekends.push(constructFrom(start, date));
  1270. }
  1271. return weekends;
  1272. }
  1273. // lib/fp/eachWeekendOfInterval.js
  1274. var eachWeekendOfInterval3 = convertToFP(eachWeekendOfInterval, 1);
  1275. // lib/fp/eachWeekendOfIntervalWithOptions.js
  1276. var _eachWeekendOfIntervalWithOptions = convertToFP(eachWeekendOfInterval, 2);
  1277. // lib/startOfMonth.js
  1278. function startOfMonth(date, options) {
  1279. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1280. _date.setDate(1);
  1281. _date.setHours(0, 0, 0, 0);
  1282. return _date;
  1283. }
  1284. // lib/eachWeekendOfMonth.js
  1285. function eachWeekendOfMonth(date, options) {
  1286. var start = startOfMonth(date, options);
  1287. var end = endOfMonth(date, options);
  1288. return eachWeekendOfInterval({ start: start, end: end }, options);
  1289. }
  1290. // lib/fp/eachWeekendOfMonth.js
  1291. var eachWeekendOfMonth3 = convertToFP(eachWeekendOfMonth, 1);
  1292. // lib/fp/eachWeekendOfMonthWithOptions.js
  1293. var _eachWeekendOfMonthWithOptions = convertToFP(eachWeekendOfMonth, 2);
  1294. // lib/endOfYear.js
  1295. function endOfYear(date, options) {
  1296. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1297. var year = _date.getFullYear();
  1298. _date.setFullYear(year + 1, 0, 0);
  1299. _date.setHours(23, 59, 59, 999);
  1300. return _date;
  1301. }
  1302. // lib/startOfYear.js
  1303. function startOfYear(date, options) {
  1304. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1305. date_.setFullYear(date_.getFullYear(), 0, 1);
  1306. date_.setHours(0, 0, 0, 0);
  1307. return date_;
  1308. }
  1309. // lib/eachWeekendOfYear.js
  1310. function eachWeekendOfYear(date, options) {
  1311. var start = startOfYear(date, options);
  1312. var end = endOfYear(date, options);
  1313. return eachWeekendOfInterval({ start: start, end: end }, options);
  1314. }
  1315. // lib/fp/eachWeekendOfYear.js
  1316. var eachWeekendOfYear3 = convertToFP(eachWeekendOfYear, 1);
  1317. // lib/fp/eachWeekendOfYearWithOptions.js
  1318. var _eachWeekendOfYearWithOptions = convertToFP(eachWeekendOfYear, 2);
  1319. // lib/eachYearOfInterval.js
  1320. function eachYearOfInterval(interval, options) {var _options$step7;
  1321. var _normalizeInterval8 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval8.start,end = _normalizeInterval8.end;
  1322. var reversed = +start > +end;
  1323. var endTime = reversed ? +start : +end;
  1324. var date = reversed ? end : start;
  1325. date.setHours(0, 0, 0, 0);
  1326. date.setMonth(0, 1);
  1327. var step = (_options$step7 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step7 !== void 0 ? _options$step7 : 1;
  1328. if (!step)
  1329. return [];
  1330. if (step < 0) {
  1331. step = -step;
  1332. reversed = !reversed;
  1333. }
  1334. var dates = [];
  1335. while (+date <= endTime) {
  1336. dates.push(constructFrom(start, date));
  1337. date.setFullYear(date.getFullYear() + step);
  1338. }
  1339. return reversed ? dates.reverse() : dates;
  1340. }
  1341. // lib/fp/eachYearOfInterval.js
  1342. var eachYearOfInterval3 = convertToFP(eachYearOfInterval, 1);
  1343. // lib/fp/eachYearOfIntervalWithOptions.js
  1344. var _eachYearOfIntervalWithOptions = convertToFP(eachYearOfInterval, 2);
  1345. // lib/fp/endOfDay.js
  1346. var endOfDay4 = convertToFP(endOfDay, 1);
  1347. // lib/fp/endOfDayWithOptions.js
  1348. var _endOfDayWithOptions = convertToFP(endOfDay, 2);
  1349. // lib/endOfDecade.js
  1350. function endOfDecade(date, options) {
  1351. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1352. var year = _date.getFullYear();
  1353. var decade = 9 + Math.floor(year / 10) * 10;
  1354. _date.setFullYear(decade, 11, 31);
  1355. _date.setHours(23, 59, 59, 999);
  1356. return _date;
  1357. }
  1358. // lib/fp/endOfDecade.js
  1359. var endOfDecade3 = convertToFP(endOfDecade, 1);
  1360. // lib/fp/endOfDecadeWithOptions.js
  1361. var _endOfDecadeWithOptions = convertToFP(endOfDecade, 2);
  1362. // lib/endOfHour.js
  1363. function endOfHour(date, options) {
  1364. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1365. _date.setMinutes(59, 59, 999);
  1366. return _date;
  1367. }
  1368. // lib/fp/endOfHour.js
  1369. var endOfHour3 = convertToFP(endOfHour, 1);
  1370. // lib/fp/endOfHourWithOptions.js
  1371. var _endOfHourWithOptions = convertToFP(endOfHour, 2);
  1372. // lib/endOfWeek.js
  1373. function endOfWeek(date, options) {var _ref4, _ref5, _ref6, _options$weekStartsOn2, _options$locale2, _defaultOptions4$loca;
  1374. var defaultOptions4 = getDefaultOptions();
  1375. var weekStartsOn = (_ref4 = (_ref5 = (_ref6 = (_options$weekStartsOn2 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn2 !== void 0 ? _options$weekStartsOn2 : options === null || options === void 0 || (_options$locale2 = options.locale) === null || _options$locale2 === void 0 || (_options$locale2 = _options$locale2.options) === null || _options$locale2 === void 0 ? void 0 : _options$locale2.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : defaultOptions4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : (_defaultOptions4$loca = defaultOptions4.locale) === null || _defaultOptions4$loca === void 0 || (_defaultOptions4$loca = _defaultOptions4$loca.options) === null || _defaultOptions4$loca === void 0 ? void 0 : _defaultOptions4$loca.weekStartsOn) !== null && _ref4 !== void 0 ? _ref4 : 0;
  1376. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1377. var day = _date.getDay();
  1378. var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
  1379. _date.setDate(_date.getDate() + diff);
  1380. _date.setHours(23, 59, 59, 999);
  1381. return _date;
  1382. }
  1383. // lib/endOfISOWeek.js
  1384. function endOfISOWeek(date, options) {
  1385. return endOfWeek(date, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
  1386. }
  1387. // lib/fp/endOfISOWeek.js
  1388. var endOfISOWeek3 = convertToFP(endOfISOWeek, 1);
  1389. // lib/fp/endOfISOWeekWithOptions.js
  1390. var _endOfISOWeekWithOptions = convertToFP(endOfISOWeek, 2);
  1391. // lib/endOfISOWeekYear.js
  1392. function endOfISOWeekYear(date, options) {
  1393. var year = getISOWeekYear(date, options);
  1394. var fourthOfJanuaryOfNextYear = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  1395. fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
  1396. fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
  1397. var _date = startOfISOWeek(fourthOfJanuaryOfNextYear, options);
  1398. _date.setMilliseconds(_date.getMilliseconds() - 1);
  1399. return _date;
  1400. }
  1401. // lib/fp/endOfISOWeekYear.js
  1402. var endOfISOWeekYear3 = convertToFP(endOfISOWeekYear, 1);
  1403. // lib/fp/endOfISOWeekYearWithOptions.js
  1404. var _endOfISOWeekYearWithOptions = convertToFP(endOfISOWeekYear, 2);
  1405. // lib/endOfMinute.js
  1406. function endOfMinute(date, options) {
  1407. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1408. _date.setSeconds(59, 999);
  1409. return _date;
  1410. }
  1411. // lib/fp/endOfMinute.js
  1412. var endOfMinute3 = convertToFP(endOfMinute, 1);
  1413. // lib/fp/endOfMinuteWithOptions.js
  1414. var _endOfMinuteWithOptions = convertToFP(endOfMinute, 2);
  1415. // lib/fp/endOfMonth.js
  1416. var endOfMonth5 = convertToFP(endOfMonth, 1);
  1417. // lib/fp/endOfMonthWithOptions.js
  1418. var _endOfMonthWithOptions = convertToFP(endOfMonth, 2);
  1419. // lib/endOfQuarter.js
  1420. function endOfQuarter(date, options) {
  1421. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1422. var currentMonth = _date.getMonth();
  1423. var month = currentMonth - currentMonth % 3 + 3;
  1424. _date.setMonth(month, 0);
  1425. _date.setHours(23, 59, 59, 999);
  1426. return _date;
  1427. }
  1428. // lib/fp/endOfQuarter.js
  1429. var endOfQuarter3 = convertToFP(endOfQuarter, 1);
  1430. // lib/fp/endOfQuarterWithOptions.js
  1431. var _endOfQuarterWithOptions = convertToFP(endOfQuarter, 2);
  1432. // lib/endOfSecond.js
  1433. function endOfSecond(date, options) {
  1434. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1435. _date.setMilliseconds(999);
  1436. return _date;
  1437. }
  1438. // lib/fp/endOfSecond.js
  1439. var endOfSecond3 = convertToFP(endOfSecond, 1);
  1440. // lib/fp/endOfSecondWithOptions.js
  1441. var _endOfSecondWithOptions = convertToFP(endOfSecond, 2);
  1442. // lib/fp/endOfWeek.js
  1443. var endOfWeek4 = convertToFP(endOfWeek, 1);
  1444. // lib/fp/endOfWeekWithOptions.js
  1445. var _endOfWeekWithOptions = convertToFP(endOfWeek, 2);
  1446. // lib/fp/endOfYear.js
  1447. var endOfYear4 = convertToFP(endOfYear, 1);
  1448. // lib/fp/endOfYearWithOptions.js
  1449. var _endOfYearWithOptions = convertToFP(endOfYear, 2);
  1450. // lib/locale/en-US/_lib/formatDistance.js
  1451. var formatDistanceLocale = {
  1452. lessThanXSeconds: {
  1453. one: "less than a second",
  1454. other: "less than {{count}} seconds"
  1455. },
  1456. xSeconds: {
  1457. one: "1 second",
  1458. other: "{{count}} seconds"
  1459. },
  1460. halfAMinute: "half a minute",
  1461. lessThanXMinutes: {
  1462. one: "less than a minute",
  1463. other: "less than {{count}} minutes"
  1464. },
  1465. xMinutes: {
  1466. one: "1 minute",
  1467. other: "{{count}} minutes"
  1468. },
  1469. aboutXHours: {
  1470. one: "about 1 hour",
  1471. other: "about {{count}} hours"
  1472. },
  1473. xHours: {
  1474. one: "1 hour",
  1475. other: "{{count}} hours"
  1476. },
  1477. xDays: {
  1478. one: "1 day",
  1479. other: "{{count}} days"
  1480. },
  1481. aboutXWeeks: {
  1482. one: "about 1 week",
  1483. other: "about {{count}} weeks"
  1484. },
  1485. xWeeks: {
  1486. one: "1 week",
  1487. other: "{{count}} weeks"
  1488. },
  1489. aboutXMonths: {
  1490. one: "about 1 month",
  1491. other: "about {{count}} months"
  1492. },
  1493. xMonths: {
  1494. one: "1 month",
  1495. other: "{{count}} months"
  1496. },
  1497. aboutXYears: {
  1498. one: "about 1 year",
  1499. other: "about {{count}} years"
  1500. },
  1501. xYears: {
  1502. one: "1 year",
  1503. other: "{{count}} years"
  1504. },
  1505. overXYears: {
  1506. one: "over 1 year",
  1507. other: "over {{count}} years"
  1508. },
  1509. almostXYears: {
  1510. one: "almost 1 year",
  1511. other: "almost {{count}} years"
  1512. }
  1513. };
  1514. var formatDistance = function formatDistance(token, count, options) {
  1515. var result;
  1516. var tokenValue = formatDistanceLocale[token];
  1517. if (typeof tokenValue === "string") {
  1518. result = tokenValue;
  1519. } else if (count === 1) {
  1520. result = tokenValue.one;
  1521. } else {
  1522. result = tokenValue.other.replace("{{count}}", count.toString());
  1523. }
  1524. if (options !== null && options !== void 0 && options.addSuffix) {
  1525. if (options.comparison && options.comparison > 0) {
  1526. return "in " + result;
  1527. } else {
  1528. return result + " ago";
  1529. }
  1530. }
  1531. return result;
  1532. };
  1533. // lib/locale/_lib/buildFormatLongFn.js
  1534. function buildFormatLongFn(args) {
  1535. return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1536. var width = options.width ? String(options.width) : args.defaultWidth;
  1537. var format = args.formats[width] || args.formats[args.defaultWidth];
  1538. return format;
  1539. };
  1540. }
  1541. // lib/locale/en-US/_lib/formatLong.js
  1542. var dateFormats = {
  1543. full: "EEEE, MMMM do, y",
  1544. long: "MMMM do, y",
  1545. medium: "MMM d, y",
  1546. short: "MM/dd/yyyy"
  1547. };
  1548. var timeFormats = {
  1549. full: "h:mm:ss a zzzz",
  1550. long: "h:mm:ss a z",
  1551. medium: "h:mm:ss a",
  1552. short: "h:mm a"
  1553. };
  1554. var dateTimeFormats = {
  1555. full: "{{date}} 'at' {{time}}",
  1556. long: "{{date}} 'at' {{time}}",
  1557. medium: "{{date}}, {{time}}",
  1558. short: "{{date}}, {{time}}"
  1559. };
  1560. var formatLong = {
  1561. date: buildFormatLongFn({
  1562. formats: dateFormats,
  1563. defaultWidth: "full"
  1564. }),
  1565. time: buildFormatLongFn({
  1566. formats: timeFormats,
  1567. defaultWidth: "full"
  1568. }),
  1569. dateTime: buildFormatLongFn({
  1570. formats: dateTimeFormats,
  1571. defaultWidth: "full"
  1572. })
  1573. };
  1574. // lib/locale/en-US/_lib/formatRelative.js
  1575. var formatRelativeLocale = {
  1576. lastWeek: "'last' eeee 'at' p",
  1577. yesterday: "'yesterday at' p",
  1578. today: "'today at' p",
  1579. tomorrow: "'tomorrow at' p",
  1580. nextWeek: "eeee 'at' p",
  1581. other: "P"
  1582. };
  1583. var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
  1584. // lib/locale/_lib/buildLocalizeFn.js
  1585. function buildLocalizeFn(args) {
  1586. return function (value, options) {
  1587. var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
  1588. var valuesArray;
  1589. if (context === "formatting" && args.formattingValues) {
  1590. var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
  1591. var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
  1592. valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
  1593. } else {
  1594. var _defaultWidth = args.defaultWidth;
  1595. var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
  1596. valuesArray = args.values[_width] || args.values[_defaultWidth];
  1597. }
  1598. var index = args.argumentCallback ? args.argumentCallback(value) : value;
  1599. return valuesArray[index];
  1600. };
  1601. }
  1602. // lib/locale/en-US/_lib/localize.js
  1603. var eraValues = {
  1604. narrow: ["B", "A"],
  1605. abbreviated: ["BC", "AD"],
  1606. wide: ["Before Christ", "Anno Domini"]
  1607. };
  1608. var quarterValues = {
  1609. narrow: ["1", "2", "3", "4"],
  1610. abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  1611. wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
  1612. };
  1613. var monthValues = {
  1614. narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  1615. abbreviated: [
  1616. "Jan",
  1617. "Feb",
  1618. "Mar",
  1619. "Apr",
  1620. "May",
  1621. "Jun",
  1622. "Jul",
  1623. "Aug",
  1624. "Sep",
  1625. "Oct",
  1626. "Nov",
  1627. "Dec"],
  1628. wide: [
  1629. "January",
  1630. "February",
  1631. "March",
  1632. "April",
  1633. "May",
  1634. "June",
  1635. "July",
  1636. "August",
  1637. "September",
  1638. "October",
  1639. "November",
  1640. "December"]
  1641. };
  1642. var dayValues = {
  1643. narrow: ["S", "M", "T", "W", "T", "F", "S"],
  1644. short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  1645. abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  1646. wide: [
  1647. "Sunday",
  1648. "Monday",
  1649. "Tuesday",
  1650. "Wednesday",
  1651. "Thursday",
  1652. "Friday",
  1653. "Saturday"]
  1654. };
  1655. var dayPeriodValues = {
  1656. narrow: {
  1657. am: "a",
  1658. pm: "p",
  1659. midnight: "mi",
  1660. noon: "n",
  1661. morning: "morning",
  1662. afternoon: "afternoon",
  1663. evening: "evening",
  1664. night: "night"
  1665. },
  1666. abbreviated: {
  1667. am: "AM",
  1668. pm: "PM",
  1669. midnight: "midnight",
  1670. noon: "noon",
  1671. morning: "morning",
  1672. afternoon: "afternoon",
  1673. evening: "evening",
  1674. night: "night"
  1675. },
  1676. wide: {
  1677. am: "a.m.",
  1678. pm: "p.m.",
  1679. midnight: "midnight",
  1680. noon: "noon",
  1681. morning: "morning",
  1682. afternoon: "afternoon",
  1683. evening: "evening",
  1684. night: "night"
  1685. }
  1686. };
  1687. var formattingDayPeriodValues = {
  1688. narrow: {
  1689. am: "a",
  1690. pm: "p",
  1691. midnight: "mi",
  1692. noon: "n",
  1693. morning: "in the morning",
  1694. afternoon: "in the afternoon",
  1695. evening: "in the evening",
  1696. night: "at night"
  1697. },
  1698. abbreviated: {
  1699. am: "AM",
  1700. pm: "PM",
  1701. midnight: "midnight",
  1702. noon: "noon",
  1703. morning: "in the morning",
  1704. afternoon: "in the afternoon",
  1705. evening: "in the evening",
  1706. night: "at night"
  1707. },
  1708. wide: {
  1709. am: "a.m.",
  1710. pm: "p.m.",
  1711. midnight: "midnight",
  1712. noon: "noon",
  1713. morning: "in the morning",
  1714. afternoon: "in the afternoon",
  1715. evening: "in the evening",
  1716. night: "at night"
  1717. }
  1718. };
  1719. var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
  1720. var number = Number(dirtyNumber);
  1721. var rem100 = number % 100;
  1722. if (rem100 > 20 || rem100 < 10) {
  1723. switch (rem100 % 10) {
  1724. case 1:
  1725. return number + "st";
  1726. case 2:
  1727. return number + "nd";
  1728. case 3:
  1729. return number + "rd";
  1730. }
  1731. }
  1732. return number + "th";
  1733. };
  1734. var localize = {
  1735. ordinalNumber: ordinalNumber,
  1736. era: buildLocalizeFn({
  1737. values: eraValues,
  1738. defaultWidth: "wide"
  1739. }),
  1740. quarter: buildLocalizeFn({
  1741. values: quarterValues,
  1742. defaultWidth: "wide",
  1743. argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
  1744. }),
  1745. month: buildLocalizeFn({
  1746. values: monthValues,
  1747. defaultWidth: "wide"
  1748. }),
  1749. day: buildLocalizeFn({
  1750. values: dayValues,
  1751. defaultWidth: "wide"
  1752. }),
  1753. dayPeriod: buildLocalizeFn({
  1754. values: dayPeriodValues,
  1755. defaultWidth: "wide",
  1756. formattingValues: formattingDayPeriodValues,
  1757. defaultFormattingWidth: "wide"
  1758. })
  1759. };
  1760. // lib/locale/_lib/buildMatchFn.js
  1761. function buildMatchFn(args) {
  1762. return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1763. var width = options.width;
  1764. var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
  1765. var matchResult = string.match(matchPattern);
  1766. if (!matchResult) {
  1767. return null;
  1768. }
  1769. var matchedString = matchResult[0];
  1770. var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
  1771. var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
  1772. var value;
  1773. value = args.valueCallback ? args.valueCallback(key) : key;
  1774. value = options.valueCallback ? options.valueCallback(value) : value;
  1775. var rest = string.slice(matchedString.length);
  1776. return { value: value, rest: rest };
  1777. };
  1778. }
  1779. function findKey(object, predicate) {
  1780. for (var key in object) {
  1781. if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
  1782. return key;
  1783. }
  1784. }
  1785. return;
  1786. }
  1787. function findIndex(array, predicate) {
  1788. for (var key = 0; key < array.length; key++) {
  1789. if (predicate(array[key])) {
  1790. return key;
  1791. }
  1792. }
  1793. return;
  1794. }
  1795. // lib/locale/_lib/buildMatchPatternFn.js
  1796. function buildMatchPatternFn(args) {
  1797. return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1798. var matchResult = string.match(args.matchPattern);
  1799. if (!matchResult)
  1800. return null;
  1801. var matchedString = matchResult[0];
  1802. var parseResult = string.match(args.parsePattern);
  1803. if (!parseResult)
  1804. return null;
  1805. var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
  1806. value = options.valueCallback ? options.valueCallback(value) : value;
  1807. var rest = string.slice(matchedString.length);
  1808. return { value: value, rest: rest };
  1809. };
  1810. }
  1811. // lib/locale/en-US/_lib/match.js
  1812. var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
  1813. var parseOrdinalNumberPattern = /\d+/i;
  1814. var matchEraPatterns = {
  1815. narrow: /^(b|a)/i,
  1816. abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  1817. wide: /^(before christ|before common era|anno domini|common era)/i
  1818. };
  1819. var parseEraPatterns = {
  1820. any: [/^b/i, /^(a|c)/i]
  1821. };
  1822. var matchQuarterPatterns = {
  1823. narrow: /^[1234]/i,
  1824. abbreviated: /^q[1234]/i,
  1825. wide: /^[1234](th|st|nd|rd)? quarter/i
  1826. };
  1827. var parseQuarterPatterns = {
  1828. any: [/1/i, /2/i, /3/i, /4/i]
  1829. };
  1830. var matchMonthPatterns = {
  1831. narrow: /^[jfmasond]/i,
  1832. abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  1833. wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
  1834. };
  1835. var parseMonthPatterns = {
  1836. narrow: [
  1837. /^j/i,
  1838. /^f/i,
  1839. /^m/i,
  1840. /^a/i,
  1841. /^m/i,
  1842. /^j/i,
  1843. /^j/i,
  1844. /^a/i,
  1845. /^s/i,
  1846. /^o/i,
  1847. /^n/i,
  1848. /^d/i],
  1849. any: [
  1850. /^ja/i,
  1851. /^f/i,
  1852. /^mar/i,
  1853. /^ap/i,
  1854. /^may/i,
  1855. /^jun/i,
  1856. /^jul/i,
  1857. /^au/i,
  1858. /^s/i,
  1859. /^o/i,
  1860. /^n/i,
  1861. /^d/i]
  1862. };
  1863. var matchDayPatterns = {
  1864. narrow: /^[smtwf]/i,
  1865. short: /^(su|mo|tu|we|th|fr|sa)/i,
  1866. abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  1867. wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
  1868. };
  1869. var parseDayPatterns = {
  1870. narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  1871. any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
  1872. };
  1873. var matchDayPeriodPatterns = {
  1874. narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  1875. any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
  1876. };
  1877. var parseDayPeriodPatterns = {
  1878. any: {
  1879. am: /^a/i,
  1880. pm: /^p/i,
  1881. midnight: /^mi/i,
  1882. noon: /^no/i,
  1883. morning: /morning/i,
  1884. afternoon: /afternoon/i,
  1885. evening: /evening/i,
  1886. night: /night/i
  1887. }
  1888. };
  1889. var match = {
  1890. ordinalNumber: buildMatchPatternFn({
  1891. matchPattern: matchOrdinalNumberPattern,
  1892. parsePattern: parseOrdinalNumberPattern,
  1893. valueCallback: function valueCallback(value) {return parseInt(value, 10);}
  1894. }),
  1895. era: buildMatchFn({
  1896. matchPatterns: matchEraPatterns,
  1897. defaultMatchWidth: "wide",
  1898. parsePatterns: parseEraPatterns,
  1899. defaultParseWidth: "any"
  1900. }),
  1901. quarter: buildMatchFn({
  1902. matchPatterns: matchQuarterPatterns,
  1903. defaultMatchWidth: "wide",
  1904. parsePatterns: parseQuarterPatterns,
  1905. defaultParseWidth: "any",
  1906. valueCallback: function valueCallback(index) {return index + 1;}
  1907. }),
  1908. month: buildMatchFn({
  1909. matchPatterns: matchMonthPatterns,
  1910. defaultMatchWidth: "wide",
  1911. parsePatterns: parseMonthPatterns,
  1912. defaultParseWidth: "any"
  1913. }),
  1914. day: buildMatchFn({
  1915. matchPatterns: matchDayPatterns,
  1916. defaultMatchWidth: "wide",
  1917. parsePatterns: parseDayPatterns,
  1918. defaultParseWidth: "any"
  1919. }),
  1920. dayPeriod: buildMatchFn({
  1921. matchPatterns: matchDayPeriodPatterns,
  1922. defaultMatchWidth: "any",
  1923. parsePatterns: parseDayPeriodPatterns,
  1924. defaultParseWidth: "any"
  1925. })
  1926. };
  1927. // lib/locale/en-US.js
  1928. var enUS = {
  1929. code: "en-US",
  1930. formatDistance: formatDistance,
  1931. formatLong: formatLong,
  1932. formatRelative: formatRelative,
  1933. localize: localize,
  1934. match: match,
  1935. options: {
  1936. weekStartsOn: 0,
  1937. firstWeekContainsDate: 1
  1938. }
  1939. };
  1940. // lib/getDayOfYear.js
  1941. function getDayOfYear(date, options) {
  1942. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1943. var diff = differenceInCalendarDays(_date, startOfYear(_date));
  1944. var dayOfYear = diff + 1;
  1945. return dayOfYear;
  1946. }
  1947. // lib/getISOWeek.js
  1948. function getISOWeek(date, options) {
  1949. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1950. var diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
  1951. return Math.round(diff / millisecondsInWeek) + 1;
  1952. }
  1953. // lib/getWeekYear.js
  1954. function getWeekYear(date, options) {var _ref7, _ref8, _ref9, _options$firstWeekCon, _options$locale3, _defaultOptions5$loca;
  1955. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1956. var year = _date.getFullYear();
  1957. var defaultOptions5 = getDefaultOptions();
  1958. var firstWeekContainsDate = (_ref7 = (_ref8 = (_ref9 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 || (_options$locale3 = options.locale) === null || _options$locale3 === void 0 || (_options$locale3 = _options$locale3.options) === null || _options$locale3 === void 0 ? void 0 : _options$locale3.firstWeekContainsDate) !== null && _ref9 !== void 0 ? _ref9 : defaultOptions5.firstWeekContainsDate) !== null && _ref8 !== void 0 ? _ref8 : (_defaultOptions5$loca = defaultOptions5.locale) === null || _defaultOptions5$loca === void 0 || (_defaultOptions5$loca = _defaultOptions5$loca.options) === null || _defaultOptions5$loca === void 0 ? void 0 : _defaultOptions5$loca.firstWeekContainsDate) !== null && _ref7 !== void 0 ? _ref7 : 1;
  1959. var firstWeekOfNextYear = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  1960. firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
  1961. firstWeekOfNextYear.setHours(0, 0, 0, 0);
  1962. var startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
  1963. var firstWeekOfThisYear = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  1964. firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
  1965. firstWeekOfThisYear.setHours(0, 0, 0, 0);
  1966. var startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
  1967. if (+_date >= +startOfNextYear) {
  1968. return year + 1;
  1969. } else if (+_date >= +startOfThisYear) {
  1970. return year;
  1971. } else {
  1972. return year - 1;
  1973. }
  1974. }
  1975. // lib/startOfWeekYear.js
  1976. function startOfWeekYear(date, options) {var _ref10, _ref11, _ref12, _options$firstWeekCon2, _options$locale4, _defaultOptions6$loca;
  1977. var defaultOptions6 = getDefaultOptions();
  1978. var firstWeekContainsDate = (_ref10 = (_ref11 = (_ref12 = (_options$firstWeekCon2 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon2 !== void 0 ? _options$firstWeekCon2 : options === null || options === void 0 || (_options$locale4 = options.locale) === null || _options$locale4 === void 0 || (_options$locale4 = _options$locale4.options) === null || _options$locale4 === void 0 ? void 0 : _options$locale4.firstWeekContainsDate) !== null && _ref12 !== void 0 ? _ref12 : defaultOptions6.firstWeekContainsDate) !== null && _ref11 !== void 0 ? _ref11 : (_defaultOptions6$loca = defaultOptions6.locale) === null || _defaultOptions6$loca === void 0 || (_defaultOptions6$loca = _defaultOptions6$loca.options) === null || _defaultOptions6$loca === void 0 ? void 0 : _defaultOptions6$loca.firstWeekContainsDate) !== null && _ref10 !== void 0 ? _ref10 : 1;
  1979. var year = getWeekYear(date, options);
  1980. var firstWeek = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  1981. firstWeek.setFullYear(year, 0, firstWeekContainsDate);
  1982. firstWeek.setHours(0, 0, 0, 0);
  1983. var _date = startOfWeek(firstWeek, options);
  1984. return _date;
  1985. }
  1986. // lib/getWeek.js
  1987. function getWeek(date, options) {
  1988. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  1989. var diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
  1990. return Math.round(diff / millisecondsInWeek) + 1;
  1991. }
  1992. // lib/_lib/addLeadingZeros.js
  1993. function addLeadingZeros(number, targetLength) {
  1994. var sign = number < 0 ? "-" : "";
  1995. var output = Math.abs(number).toString().padStart(targetLength, "0");
  1996. return sign + output;
  1997. }
  1998. // lib/_lib/format/lightFormatters.js
  1999. var lightFormatters = {
  2000. y: function y(date, token) {
  2001. var signedYear = date.getFullYear();
  2002. var year = signedYear > 0 ? signedYear : 1 - signedYear;
  2003. return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
  2004. },
  2005. M: function M(date, token) {
  2006. var month = date.getMonth();
  2007. return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
  2008. },
  2009. d: function d(date, token) {
  2010. return addLeadingZeros(date.getDate(), token.length);
  2011. },
  2012. a: function a(date, token) {
  2013. var dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
  2014. switch (token) {
  2015. case "a":
  2016. case "aa":
  2017. return dayPeriodEnumValue.toUpperCase();
  2018. case "aaa":
  2019. return dayPeriodEnumValue;
  2020. case "aaaaa":
  2021. return dayPeriodEnumValue[0];
  2022. case "aaaa":
  2023. default:
  2024. return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
  2025. }
  2026. },
  2027. h: function h(date, token) {
  2028. return addLeadingZeros(date.getHours() % 12 || 12, token.length);
  2029. },
  2030. H: function H(date, token) {
  2031. return addLeadingZeros(date.getHours(), token.length);
  2032. },
  2033. m: function m(date, token) {
  2034. return addLeadingZeros(date.getMinutes(), token.length);
  2035. },
  2036. s: function s(date, token) {
  2037. return addLeadingZeros(date.getSeconds(), token.length);
  2038. },
  2039. S: function S(date, token) {
  2040. var numberOfDigits = token.length;
  2041. var milliseconds = date.getMilliseconds();
  2042. var fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3));
  2043. return addLeadingZeros(fractionalSeconds, token.length);
  2044. }
  2045. };
  2046. // lib/_lib/format/formatters.js
  2047. function formatTimezoneShort(offset) {var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  2048. var sign = offset > 0 ? "-" : "+";
  2049. var absOffset = Math.abs(offset);
  2050. var hours = Math.trunc(absOffset / 60);
  2051. var minutes = absOffset % 60;
  2052. if (minutes === 0) {
  2053. return sign + String(hours);
  2054. }
  2055. return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
  2056. }
  2057. function formatTimezoneWithOptionalMinutes(offset, delimiter) {
  2058. if (offset % 60 === 0) {
  2059. var sign = offset > 0 ? "-" : "+";
  2060. return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
  2061. }
  2062. return formatTimezone(offset, delimiter);
  2063. }
  2064. function formatTimezone(offset) {var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  2065. var sign = offset > 0 ? "-" : "+";
  2066. var absOffset = Math.abs(offset);
  2067. var hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
  2068. var minutes = addLeadingZeros(absOffset % 60, 2);
  2069. return sign + hours + delimiter + minutes;
  2070. }
  2071. var dayPeriodEnum = {
  2072. am: "am",
  2073. pm: "pm",
  2074. midnight: "midnight",
  2075. noon: "noon",
  2076. morning: "morning",
  2077. afternoon: "afternoon",
  2078. evening: "evening",
  2079. night: "night"
  2080. };
  2081. var formatters = {
  2082. G: function G(date, token, localize3) {
  2083. var era = date.getFullYear() > 0 ? 1 : 0;
  2084. switch (token) {
  2085. case "G":
  2086. case "GG":
  2087. case "GGG":
  2088. return localize3.era(era, { width: "abbreviated" });
  2089. case "GGGGG":
  2090. return localize3.era(era, { width: "narrow" });
  2091. case "GGGG":
  2092. default:
  2093. return localize3.era(era, { width: "wide" });
  2094. }
  2095. },
  2096. y: function y(date, token, localize3) {
  2097. if (token === "yo") {
  2098. var signedYear = date.getFullYear();
  2099. var year = signedYear > 0 ? signedYear : 1 - signedYear;
  2100. return localize3.ordinalNumber(year, { unit: "year" });
  2101. }
  2102. return lightFormatters.y(date, token);
  2103. },
  2104. Y: function Y(date, token, localize3, options) {
  2105. var signedWeekYear = getWeekYear(date, options);
  2106. var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
  2107. if (token === "YY") {
  2108. var twoDigitYear = weekYear % 100;
  2109. return addLeadingZeros(twoDigitYear, 2);
  2110. }
  2111. if (token === "Yo") {
  2112. return localize3.ordinalNumber(weekYear, { unit: "year" });
  2113. }
  2114. return addLeadingZeros(weekYear, token.length);
  2115. },
  2116. R: function R(date, token) {
  2117. var isoWeekYear = getISOWeekYear(date);
  2118. return addLeadingZeros(isoWeekYear, token.length);
  2119. },
  2120. u: function u(date, token) {
  2121. var year = date.getFullYear();
  2122. return addLeadingZeros(year, token.length);
  2123. },
  2124. Q: function Q(date, token, localize3) {
  2125. var quarter = Math.ceil((date.getMonth() + 1) / 3);
  2126. switch (token) {
  2127. case "Q":
  2128. return String(quarter);
  2129. case "QQ":
  2130. return addLeadingZeros(quarter, 2);
  2131. case "Qo":
  2132. return localize3.ordinalNumber(quarter, { unit: "quarter" });
  2133. case "QQQ":
  2134. return localize3.quarter(quarter, {
  2135. width: "abbreviated",
  2136. context: "formatting"
  2137. });
  2138. case "QQQQQ":
  2139. return localize3.quarter(quarter, {
  2140. width: "narrow",
  2141. context: "formatting"
  2142. });
  2143. case "QQQQ":
  2144. default:
  2145. return localize3.quarter(quarter, {
  2146. width: "wide",
  2147. context: "formatting"
  2148. });
  2149. }
  2150. },
  2151. q: function q(date, token, localize3) {
  2152. var quarter = Math.ceil((date.getMonth() + 1) / 3);
  2153. switch (token) {
  2154. case "q":
  2155. return String(quarter);
  2156. case "qq":
  2157. return addLeadingZeros(quarter, 2);
  2158. case "qo":
  2159. return localize3.ordinalNumber(quarter, { unit: "quarter" });
  2160. case "qqq":
  2161. return localize3.quarter(quarter, {
  2162. width: "abbreviated",
  2163. context: "standalone"
  2164. });
  2165. case "qqqqq":
  2166. return localize3.quarter(quarter, {
  2167. width: "narrow",
  2168. context: "standalone"
  2169. });
  2170. case "qqqq":
  2171. default:
  2172. return localize3.quarter(quarter, {
  2173. width: "wide",
  2174. context: "standalone"
  2175. });
  2176. }
  2177. },
  2178. M: function M(date, token, localize3) {
  2179. var month = date.getMonth();
  2180. switch (token) {
  2181. case "M":
  2182. case "MM":
  2183. return lightFormatters.M(date, token);
  2184. case "Mo":
  2185. return localize3.ordinalNumber(month + 1, { unit: "month" });
  2186. case "MMM":
  2187. return localize3.month(month, {
  2188. width: "abbreviated",
  2189. context: "formatting"
  2190. });
  2191. case "MMMMM":
  2192. return localize3.month(month, {
  2193. width: "narrow",
  2194. context: "formatting"
  2195. });
  2196. case "MMMM":
  2197. default:
  2198. return localize3.month(month, { width: "wide", context: "formatting" });
  2199. }
  2200. },
  2201. L: function L(date, token, localize3) {
  2202. var month = date.getMonth();
  2203. switch (token) {
  2204. case "L":
  2205. return String(month + 1);
  2206. case "LL":
  2207. return addLeadingZeros(month + 1, 2);
  2208. case "Lo":
  2209. return localize3.ordinalNumber(month + 1, { unit: "month" });
  2210. case "LLL":
  2211. return localize3.month(month, {
  2212. width: "abbreviated",
  2213. context: "standalone"
  2214. });
  2215. case "LLLLL":
  2216. return localize3.month(month, {
  2217. width: "narrow",
  2218. context: "standalone"
  2219. });
  2220. case "LLLL":
  2221. default:
  2222. return localize3.month(month, { width: "wide", context: "standalone" });
  2223. }
  2224. },
  2225. w: function w(date, token, localize3, options) {
  2226. var week = getWeek(date, options);
  2227. if (token === "wo") {
  2228. return localize3.ordinalNumber(week, { unit: "week" });
  2229. }
  2230. return addLeadingZeros(week, token.length);
  2231. },
  2232. I: function I(date, token, localize3) {
  2233. var isoWeek = getISOWeek(date);
  2234. if (token === "Io") {
  2235. return localize3.ordinalNumber(isoWeek, { unit: "week" });
  2236. }
  2237. return addLeadingZeros(isoWeek, token.length);
  2238. },
  2239. d: function d(date, token, localize3) {
  2240. if (token === "do") {
  2241. return localize3.ordinalNumber(date.getDate(), { unit: "date" });
  2242. }
  2243. return lightFormatters.d(date, token);
  2244. },
  2245. D: function D(date, token, localize3) {
  2246. var dayOfYear = getDayOfYear(date);
  2247. if (token === "Do") {
  2248. return localize3.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
  2249. }
  2250. return addLeadingZeros(dayOfYear, token.length);
  2251. },
  2252. E: function E(date, token, localize3) {
  2253. var dayOfWeek = date.getDay();
  2254. switch (token) {
  2255. case "E":
  2256. case "EE":
  2257. case "EEE":
  2258. return localize3.day(dayOfWeek, {
  2259. width: "abbreviated",
  2260. context: "formatting"
  2261. });
  2262. case "EEEEE":
  2263. return localize3.day(dayOfWeek, {
  2264. width: "narrow",
  2265. context: "formatting"
  2266. });
  2267. case "EEEEEE":
  2268. return localize3.day(dayOfWeek, {
  2269. width: "short",
  2270. context: "formatting"
  2271. });
  2272. case "EEEE":
  2273. default:
  2274. return localize3.day(dayOfWeek, {
  2275. width: "wide",
  2276. context: "formatting"
  2277. });
  2278. }
  2279. },
  2280. e: function e(date, token, localize3, options) {
  2281. var dayOfWeek = date.getDay();
  2282. var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
  2283. switch (token) {
  2284. case "e":
  2285. return String(localDayOfWeek);
  2286. case "ee":
  2287. return addLeadingZeros(localDayOfWeek, 2);
  2288. case "eo":
  2289. return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
  2290. case "eee":
  2291. return localize3.day(dayOfWeek, {
  2292. width: "abbreviated",
  2293. context: "formatting"
  2294. });
  2295. case "eeeee":
  2296. return localize3.day(dayOfWeek, {
  2297. width: "narrow",
  2298. context: "formatting"
  2299. });
  2300. case "eeeeee":
  2301. return localize3.day(dayOfWeek, {
  2302. width: "short",
  2303. context: "formatting"
  2304. });
  2305. case "eeee":
  2306. default:
  2307. return localize3.day(dayOfWeek, {
  2308. width: "wide",
  2309. context: "formatting"
  2310. });
  2311. }
  2312. },
  2313. c: function c(date, token, localize3, options) {
  2314. var dayOfWeek = date.getDay();
  2315. var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
  2316. switch (token) {
  2317. case "c":
  2318. return String(localDayOfWeek);
  2319. case "cc":
  2320. return addLeadingZeros(localDayOfWeek, token.length);
  2321. case "co":
  2322. return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
  2323. case "ccc":
  2324. return localize3.day(dayOfWeek, {
  2325. width: "abbreviated",
  2326. context: "standalone"
  2327. });
  2328. case "ccccc":
  2329. return localize3.day(dayOfWeek, {
  2330. width: "narrow",
  2331. context: "standalone"
  2332. });
  2333. case "cccccc":
  2334. return localize3.day(dayOfWeek, {
  2335. width: "short",
  2336. context: "standalone"
  2337. });
  2338. case "cccc":
  2339. default:
  2340. return localize3.day(dayOfWeek, {
  2341. width: "wide",
  2342. context: "standalone"
  2343. });
  2344. }
  2345. },
  2346. i: function i(date, token, localize3) {
  2347. var dayOfWeek = date.getDay();
  2348. var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
  2349. switch (token) {
  2350. case "i":
  2351. return String(isoDayOfWeek);
  2352. case "ii":
  2353. return addLeadingZeros(isoDayOfWeek, token.length);
  2354. case "io":
  2355. return localize3.ordinalNumber(isoDayOfWeek, { unit: "day" });
  2356. case "iii":
  2357. return localize3.day(dayOfWeek, {
  2358. width: "abbreviated",
  2359. context: "formatting"
  2360. });
  2361. case "iiiii":
  2362. return localize3.day(dayOfWeek, {
  2363. width: "narrow",
  2364. context: "formatting"
  2365. });
  2366. case "iiiiii":
  2367. return localize3.day(dayOfWeek, {
  2368. width: "short",
  2369. context: "formatting"
  2370. });
  2371. case "iiii":
  2372. default:
  2373. return localize3.day(dayOfWeek, {
  2374. width: "wide",
  2375. context: "formatting"
  2376. });
  2377. }
  2378. },
  2379. a: function a(date, token, localize3) {
  2380. var hours = date.getHours();
  2381. var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
  2382. switch (token) {
  2383. case "a":
  2384. case "aa":
  2385. return localize3.dayPeriod(dayPeriodEnumValue, {
  2386. width: "abbreviated",
  2387. context: "formatting"
  2388. });
  2389. case "aaa":
  2390. return localize3.dayPeriod(dayPeriodEnumValue, {
  2391. width: "abbreviated",
  2392. context: "formatting"
  2393. }).toLowerCase();
  2394. case "aaaaa":
  2395. return localize3.dayPeriod(dayPeriodEnumValue, {
  2396. width: "narrow",
  2397. context: "formatting"
  2398. });
  2399. case "aaaa":
  2400. default:
  2401. return localize3.dayPeriod(dayPeriodEnumValue, {
  2402. width: "wide",
  2403. context: "formatting"
  2404. });
  2405. }
  2406. },
  2407. b: function b(date, token, localize3) {
  2408. var hours = date.getHours();
  2409. var dayPeriodEnumValue;
  2410. if (hours === 12) {
  2411. dayPeriodEnumValue = dayPeriodEnum.noon;
  2412. } else if (hours === 0) {
  2413. dayPeriodEnumValue = dayPeriodEnum.midnight;
  2414. } else {
  2415. dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
  2416. }
  2417. switch (token) {
  2418. case "b":
  2419. case "bb":
  2420. return localize3.dayPeriod(dayPeriodEnumValue, {
  2421. width: "abbreviated",
  2422. context: "formatting"
  2423. });
  2424. case "bbb":
  2425. return localize3.dayPeriod(dayPeriodEnumValue, {
  2426. width: "abbreviated",
  2427. context: "formatting"
  2428. }).toLowerCase();
  2429. case "bbbbb":
  2430. return localize3.dayPeriod(dayPeriodEnumValue, {
  2431. width: "narrow",
  2432. context: "formatting"
  2433. });
  2434. case "bbbb":
  2435. default:
  2436. return localize3.dayPeriod(dayPeriodEnumValue, {
  2437. width: "wide",
  2438. context: "formatting"
  2439. });
  2440. }
  2441. },
  2442. B: function B(date, token, localize3) {
  2443. var hours = date.getHours();
  2444. var dayPeriodEnumValue;
  2445. if (hours >= 17) {
  2446. dayPeriodEnumValue = dayPeriodEnum.evening;
  2447. } else if (hours >= 12) {
  2448. dayPeriodEnumValue = dayPeriodEnum.afternoon;
  2449. } else if (hours >= 4) {
  2450. dayPeriodEnumValue = dayPeriodEnum.morning;
  2451. } else {
  2452. dayPeriodEnumValue = dayPeriodEnum.night;
  2453. }
  2454. switch (token) {
  2455. case "B":
  2456. case "BB":
  2457. case "BBB":
  2458. return localize3.dayPeriod(dayPeriodEnumValue, {
  2459. width: "abbreviated",
  2460. context: "formatting"
  2461. });
  2462. case "BBBBB":
  2463. return localize3.dayPeriod(dayPeriodEnumValue, {
  2464. width: "narrow",
  2465. context: "formatting"
  2466. });
  2467. case "BBBB":
  2468. default:
  2469. return localize3.dayPeriod(dayPeriodEnumValue, {
  2470. width: "wide",
  2471. context: "formatting"
  2472. });
  2473. }
  2474. },
  2475. h: function h(date, token, localize3) {
  2476. if (token === "ho") {
  2477. var hours = date.getHours() % 12;
  2478. if (hours === 0)
  2479. hours = 12;
  2480. return localize3.ordinalNumber(hours, { unit: "hour" });
  2481. }
  2482. return lightFormatters.h(date, token);
  2483. },
  2484. H: function H(date, token, localize3) {
  2485. if (token === "Ho") {
  2486. return localize3.ordinalNumber(date.getHours(), { unit: "hour" });
  2487. }
  2488. return lightFormatters.H(date, token);
  2489. },
  2490. K: function K(date, token, localize3) {
  2491. var hours = date.getHours() % 12;
  2492. if (token === "Ko") {
  2493. return localize3.ordinalNumber(hours, { unit: "hour" });
  2494. }
  2495. return addLeadingZeros(hours, token.length);
  2496. },
  2497. k: function k(date, token, localize3) {
  2498. var hours = date.getHours();
  2499. if (hours === 0)
  2500. hours = 24;
  2501. if (token === "ko") {
  2502. return localize3.ordinalNumber(hours, { unit: "hour" });
  2503. }
  2504. return addLeadingZeros(hours, token.length);
  2505. },
  2506. m: function m(date, token, localize3) {
  2507. if (token === "mo") {
  2508. return localize3.ordinalNumber(date.getMinutes(), { unit: "minute" });
  2509. }
  2510. return lightFormatters.m(date, token);
  2511. },
  2512. s: function s(date, token, localize3) {
  2513. if (token === "so") {
  2514. return localize3.ordinalNumber(date.getSeconds(), { unit: "second" });
  2515. }
  2516. return lightFormatters.s(date, token);
  2517. },
  2518. S: function S(date, token) {
  2519. return lightFormatters.S(date, token);
  2520. },
  2521. X: function X(date, token, _localize) {
  2522. var timezoneOffset = date.getTimezoneOffset();
  2523. if (timezoneOffset === 0) {
  2524. return "Z";
  2525. }
  2526. switch (token) {
  2527. case "X":
  2528. return formatTimezoneWithOptionalMinutes(timezoneOffset);
  2529. case "XXXX":
  2530. case "XX":
  2531. return formatTimezone(timezoneOffset);
  2532. case "XXXXX":
  2533. case "XXX":
  2534. default:
  2535. return formatTimezone(timezoneOffset, ":");
  2536. }
  2537. },
  2538. x: function x(date, token, _localize) {
  2539. var timezoneOffset = date.getTimezoneOffset();
  2540. switch (token) {
  2541. case "x":
  2542. return formatTimezoneWithOptionalMinutes(timezoneOffset);
  2543. case "xxxx":
  2544. case "xx":
  2545. return formatTimezone(timezoneOffset);
  2546. case "xxxxx":
  2547. case "xxx":
  2548. default:
  2549. return formatTimezone(timezoneOffset, ":");
  2550. }
  2551. },
  2552. O: function O(date, token, _localize) {
  2553. var timezoneOffset = date.getTimezoneOffset();
  2554. switch (token) {
  2555. case "O":
  2556. case "OO":
  2557. case "OOO":
  2558. return "GMT" + formatTimezoneShort(timezoneOffset, ":");
  2559. case "OOOO":
  2560. default:
  2561. return "GMT" + formatTimezone(timezoneOffset, ":");
  2562. }
  2563. },
  2564. z: function z(date, token, _localize) {
  2565. var timezoneOffset = date.getTimezoneOffset();
  2566. switch (token) {
  2567. case "z":
  2568. case "zz":
  2569. case "zzz":
  2570. return "GMT" + formatTimezoneShort(timezoneOffset, ":");
  2571. case "zzzz":
  2572. default:
  2573. return "GMT" + formatTimezone(timezoneOffset, ":");
  2574. }
  2575. },
  2576. t: function t(date, token, _localize) {
  2577. var timestamp = Math.trunc(+date / 1000);
  2578. return addLeadingZeros(timestamp, token.length);
  2579. },
  2580. T: function T(date, token, _localize) {
  2581. return addLeadingZeros(+date, token.length);
  2582. }
  2583. };
  2584. // lib/_lib/format/longFormatters.js
  2585. var dateLongFormatter = function dateLongFormatter(pattern, formatLong3) {
  2586. switch (pattern) {
  2587. case "P":
  2588. return formatLong3.date({ width: "short" });
  2589. case "PP":
  2590. return formatLong3.date({ width: "medium" });
  2591. case "PPP":
  2592. return formatLong3.date({ width: "long" });
  2593. case "PPPP":
  2594. default:
  2595. return formatLong3.date({ width: "full" });
  2596. }
  2597. };
  2598. var timeLongFormatter = function timeLongFormatter(pattern, formatLong3) {
  2599. switch (pattern) {
  2600. case "p":
  2601. return formatLong3.time({ width: "short" });
  2602. case "pp":
  2603. return formatLong3.time({ width: "medium" });
  2604. case "ppp":
  2605. return formatLong3.time({ width: "long" });
  2606. case "pppp":
  2607. default:
  2608. return formatLong3.time({ width: "full" });
  2609. }
  2610. };
  2611. var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong3) {
  2612. var matchResult = pattern.match(/(P+)(p+)?/) || [];
  2613. var datePattern = matchResult[1];
  2614. var timePattern = matchResult[2];
  2615. if (!timePattern) {
  2616. return dateLongFormatter(pattern, formatLong3);
  2617. }
  2618. var dateTimeFormat;
  2619. switch (datePattern) {
  2620. case "P":
  2621. dateTimeFormat = formatLong3.dateTime({ width: "short" });
  2622. break;
  2623. case "PP":
  2624. dateTimeFormat = formatLong3.dateTime({ width: "medium" });
  2625. break;
  2626. case "PPP":
  2627. dateTimeFormat = formatLong3.dateTime({ width: "long" });
  2628. break;
  2629. case "PPPP":
  2630. default:
  2631. dateTimeFormat = formatLong3.dateTime({ width: "full" });
  2632. break;
  2633. }
  2634. return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong3)).replace("{{time}}", timeLongFormatter(timePattern, formatLong3));
  2635. };
  2636. var longFormatters = {
  2637. p: timeLongFormatter,
  2638. P: dateTimeLongFormatter
  2639. };
  2640. // lib/_lib/protectedTokens.js
  2641. function isProtectedDayOfYearToken(token) {
  2642. return dayOfYearTokenRE.test(token);
  2643. }
  2644. function isProtectedWeekYearToken(token) {
  2645. return weekYearTokenRE.test(token);
  2646. }
  2647. function warnOrThrowProtectedError(token, format, input) {
  2648. var _message = message(token, format, input);
  2649. console.warn(_message);
  2650. if (throwTokens.includes(token))
  2651. throw new RangeError(_message);
  2652. }
  2653. function message(token, format, input) {
  2654. var subject = token[0] === "Y" ? "years" : "days of the month";
  2655. return "Use `".concat(token.toLowerCase(), "` instead of `").concat(token, "` (in `").concat(format, "`) for formatting ").concat(subject, " to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md");
  2656. }
  2657. var dayOfYearTokenRE = /^D+$/;
  2658. var weekYearTokenRE = /^Y+$/;
  2659. var throwTokens = ["D", "DD", "YY", "YYYY"];
  2660. // lib/format.js
  2661. function format(date, formatStr, options) {var _ref13, _options$locale5, _ref14, _ref15, _ref16, _options$firstWeekCon3, _options$locale6, _defaultOptions7$loca, _ref17, _ref18, _ref19, _options$weekStartsOn3, _options$locale7, _defaultOptions7$loca2;
  2662. var defaultOptions7 = getDefaultOptions();
  2663. var locale = (_ref13 = (_options$locale5 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale5 !== void 0 ? _options$locale5 : defaultOptions7.locale) !== null && _ref13 !== void 0 ? _ref13 : enUS;
  2664. var firstWeekContainsDate = (_ref14 = (_ref15 = (_ref16 = (_options$firstWeekCon3 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon3 !== void 0 ? _options$firstWeekCon3 : options === null || options === void 0 || (_options$locale6 = options.locale) === null || _options$locale6 === void 0 || (_options$locale6 = _options$locale6.options) === null || _options$locale6 === void 0 ? void 0 : _options$locale6.firstWeekContainsDate) !== null && _ref16 !== void 0 ? _ref16 : defaultOptions7.firstWeekContainsDate) !== null && _ref15 !== void 0 ? _ref15 : (_defaultOptions7$loca = defaultOptions7.locale) === null || _defaultOptions7$loca === void 0 || (_defaultOptions7$loca = _defaultOptions7$loca.options) === null || _defaultOptions7$loca === void 0 ? void 0 : _defaultOptions7$loca.firstWeekContainsDate) !== null && _ref14 !== void 0 ? _ref14 : 1;
  2665. var weekStartsOn = (_ref17 = (_ref18 = (_ref19 = (_options$weekStartsOn3 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn3 !== void 0 ? _options$weekStartsOn3 : options === null || options === void 0 || (_options$locale7 = options.locale) === null || _options$locale7 === void 0 || (_options$locale7 = _options$locale7.options) === null || _options$locale7 === void 0 ? void 0 : _options$locale7.weekStartsOn) !== null && _ref19 !== void 0 ? _ref19 : defaultOptions7.weekStartsOn) !== null && _ref18 !== void 0 ? _ref18 : (_defaultOptions7$loca2 = defaultOptions7.locale) === null || _defaultOptions7$loca2 === void 0 || (_defaultOptions7$loca2 = _defaultOptions7$loca2.options) === null || _defaultOptions7$loca2 === void 0 ? void 0 : _defaultOptions7$loca2.weekStartsOn) !== null && _ref17 !== void 0 ? _ref17 : 0;
  2666. var originalDate = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  2667. if (!isValid(originalDate)) {
  2668. throw new RangeError("Invalid time value");
  2669. }
  2670. var parts = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
  2671. var firstCharacter = substring[0];
  2672. if (firstCharacter === "p" || firstCharacter === "P") {
  2673. var longFormatter = longFormatters[firstCharacter];
  2674. return longFormatter(substring, locale.formatLong);
  2675. }
  2676. return substring;
  2677. }).join("").match(formattingTokensRegExp).map(function (substring) {
  2678. if (substring === "''") {
  2679. return { isToken: false, value: "'" };
  2680. }
  2681. var firstCharacter = substring[0];
  2682. if (firstCharacter === "'") {
  2683. return { isToken: false, value: cleanEscapedString(substring) };
  2684. }
  2685. if (formatters[firstCharacter]) {
  2686. return { isToken: true, value: substring };
  2687. }
  2688. if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
  2689. throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
  2690. }
  2691. return { isToken: false, value: substring };
  2692. });
  2693. if (locale.localize.preprocessor) {
  2694. parts = locale.localize.preprocessor(originalDate, parts);
  2695. }
  2696. var formatterOptions = {
  2697. firstWeekContainsDate: firstWeekContainsDate,
  2698. weekStartsOn: weekStartsOn,
  2699. locale: locale
  2700. };
  2701. return parts.map(function (part) {
  2702. if (!part.isToken)
  2703. return part.value;
  2704. var token = part.value;
  2705. if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token) || !(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) {
  2706. warnOrThrowProtectedError(token, formatStr, String(date));
  2707. }
  2708. var formatter = formatters[token[0]];
  2709. return formatter(originalDate, token, locale.localize, formatterOptions);
  2710. }).join("");
  2711. }
  2712. function cleanEscapedString(input) {
  2713. var matched = input.match(escapedStringRegExp);
  2714. if (!matched) {
  2715. return input;
  2716. }
  2717. return matched[1].replace(doubleQuoteRegExp, "'");
  2718. }
  2719. var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
  2720. var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
  2721. var escapedStringRegExp = /^'([^]*?)'?$/;
  2722. var doubleQuoteRegExp = /''/g;
  2723. var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
  2724. // lib/fp/format.js
  2725. var format3 = convertToFP(format, 2);
  2726. // lib/formatDistance.js
  2727. function formatDistance3(laterDate, earlierDate, options) {var _ref20, _options$locale8;
  2728. var defaultOptions8 = getDefaultOptions();
  2729. var locale = (_ref20 = (_options$locale8 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale8 !== void 0 ? _options$locale8 : defaultOptions8.locale) !== null && _ref20 !== void 0 ? _ref20 : enUS;
  2730. var minutesInAlmostTwoDays = 2520;
  2731. var comparison = compareAsc(laterDate, earlierDate);
  2732. if (isNaN(comparison))
  2733. throw new RangeError("Invalid time value");
  2734. var localizeOptions = Object.assign({}, options, {
  2735. addSuffix: options === null || options === void 0 ? void 0 : options.addSuffix,
  2736. comparison: comparison
  2737. });
  2738. var _normalizeDates35 = normalizeDates.apply(void 0, [options === null || options === void 0 ? void 0 : options.in].concat(_toConsumableArray(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]))),_normalizeDates36 = _slicedToArray(_normalizeDates35, 2),laterDate_ = _normalizeDates36[0],earlierDate_ = _normalizeDates36[1];
  2739. var seconds = differenceInSeconds(earlierDate_, laterDate_);
  2740. var offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1000;
  2741. var minutes = Math.round((seconds - offsetInSeconds) / 60);
  2742. var months;
  2743. if (minutes < 2) {
  2744. if (options !== null && options !== void 0 && options.includeSeconds) {
  2745. if (seconds < 5) {
  2746. return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
  2747. } else if (seconds < 10) {
  2748. return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
  2749. } else if (seconds < 20) {
  2750. return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
  2751. } else if (seconds < 40) {
  2752. return locale.formatDistance("halfAMinute", 0, localizeOptions);
  2753. } else if (seconds < 60) {
  2754. return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
  2755. } else {
  2756. return locale.formatDistance("xMinutes", 1, localizeOptions);
  2757. }
  2758. } else {
  2759. if (minutes === 0) {
  2760. return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
  2761. } else {
  2762. return locale.formatDistance("xMinutes", minutes, localizeOptions);
  2763. }
  2764. }
  2765. } else if (minutes < 45) {
  2766. return locale.formatDistance("xMinutes", minutes, localizeOptions);
  2767. } else if (minutes < 90) {
  2768. return locale.formatDistance("aboutXHours", 1, localizeOptions);
  2769. } else if (minutes < minutesInDay) {
  2770. var hours = Math.round(minutes / 60);
  2771. return locale.formatDistance("aboutXHours", hours, localizeOptions);
  2772. } else if (minutes < minutesInAlmostTwoDays) {
  2773. return locale.formatDistance("xDays", 1, localizeOptions);
  2774. } else if (minutes < minutesInMonth) {
  2775. var _days = Math.round(minutes / minutesInDay);
  2776. return locale.formatDistance("xDays", _days, localizeOptions);
  2777. } else if (minutes < minutesInMonth * 2) {
  2778. months = Math.round(minutes / minutesInMonth);
  2779. return locale.formatDistance("aboutXMonths", months, localizeOptions);
  2780. }
  2781. months = differenceInMonths(earlierDate_, laterDate_);
  2782. if (months < 12) {
  2783. var nearestMonth = Math.round(minutes / minutesInMonth);
  2784. return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
  2785. } else {
  2786. var monthsSinceStartOfYear = months % 12;
  2787. var years = Math.trunc(months / 12);
  2788. if (monthsSinceStartOfYear < 3) {
  2789. return locale.formatDistance("aboutXYears", years, localizeOptions);
  2790. } else if (monthsSinceStartOfYear < 9) {
  2791. return locale.formatDistance("overXYears", years, localizeOptions);
  2792. } else {
  2793. return locale.formatDistance("almostXYears", years + 1, localizeOptions);
  2794. }
  2795. }
  2796. }
  2797. // lib/fp/formatDistance.js
  2798. var formatDistance5 = convertToFP(formatDistance3, 2);
  2799. // lib/formatDistanceStrict.js
  2800. function formatDistanceStrict(laterDate, earlierDate, options) {var _ref21, _options$locale9, _options$roundingMeth;
  2801. var defaultOptions9 = getDefaultOptions();
  2802. var locale = (_ref21 = (_options$locale9 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale9 !== void 0 ? _options$locale9 : defaultOptions9.locale) !== null && _ref21 !== void 0 ? _ref21 : enUS;
  2803. var comparison = compareAsc(laterDate, earlierDate);
  2804. if (isNaN(comparison)) {
  2805. throw new RangeError("Invalid time value");
  2806. }
  2807. var localizeOptions = Object.assign({}, options, {
  2808. addSuffix: options === null || options === void 0 ? void 0 : options.addSuffix,
  2809. comparison: comparison
  2810. });
  2811. var _normalizeDates37 = normalizeDates.apply(void 0, [options === null || options === void 0 ? void 0 : options.in].concat(_toConsumableArray(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]))),_normalizeDates38 = _slicedToArray(_normalizeDates37, 2),laterDate_ = _normalizeDates38[0],earlierDate_ = _normalizeDates38[1];
  2812. var roundingMethod = getRoundingMethod((_options$roundingMeth = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth !== void 0 ? _options$roundingMeth : "round");
  2813. var milliseconds = earlierDate_.getTime() - laterDate_.getTime();
  2814. var minutes = milliseconds / millisecondsInMinute;
  2815. var timezoneOffset = getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_);
  2816. var dstNormalizedMinutes = (milliseconds - timezoneOffset) / millisecondsInMinute;
  2817. var defaultUnit = options === null || options === void 0 ? void 0 : options.unit;
  2818. var unit;
  2819. if (!defaultUnit) {
  2820. if (minutes < 1) {
  2821. unit = "second";
  2822. } else if (minutes < 60) {
  2823. unit = "minute";
  2824. } else if (minutes < minutesInDay) {
  2825. unit = "hour";
  2826. } else if (dstNormalizedMinutes < minutesInMonth) {
  2827. unit = "day";
  2828. } else if (dstNormalizedMinutes < minutesInYear) {
  2829. unit = "month";
  2830. } else {
  2831. unit = "year";
  2832. }
  2833. } else {
  2834. unit = defaultUnit;
  2835. }
  2836. if (unit === "second") {
  2837. var seconds = roundingMethod(milliseconds / 1000);
  2838. return locale.formatDistance("xSeconds", seconds, localizeOptions);
  2839. } else if (unit === "minute") {
  2840. var roundedMinutes = roundingMethod(minutes);
  2841. return locale.formatDistance("xMinutes", roundedMinutes, localizeOptions);
  2842. } else if (unit === "hour") {
  2843. var hours = roundingMethod(minutes / 60);
  2844. return locale.formatDistance("xHours", hours, localizeOptions);
  2845. } else if (unit === "day") {
  2846. var _days2 = roundingMethod(dstNormalizedMinutes / minutesInDay);
  2847. return locale.formatDistance("xDays", _days2, localizeOptions);
  2848. } else if (unit === "month") {
  2849. var _months = roundingMethod(dstNormalizedMinutes / minutesInMonth);
  2850. return _months === 12 && defaultUnit !== "month" ? locale.formatDistance("xYears", 1, localizeOptions) : locale.formatDistance("xMonths", _months, localizeOptions);
  2851. } else {
  2852. var years = roundingMethod(dstNormalizedMinutes / minutesInYear);
  2853. return locale.formatDistance("xYears", years, localizeOptions);
  2854. }
  2855. }
  2856. // lib/fp/formatDistanceStrict.js
  2857. var formatDistanceStrict3 = convertToFP(formatDistanceStrict, 2);
  2858. // lib/fp/formatDistanceStrictWithOptions.js
  2859. var _formatDistanceStrictWithOptions = convertToFP(formatDistanceStrict, 3);
  2860. // lib/fp/formatDistanceWithOptions.js
  2861. var _formatDistanceWithOptions = convertToFP(formatDistance3, 3);
  2862. // lib/formatDuration.js
  2863. function formatDuration(duration, options) {var _ref22, _options$locale10, _options$format, _options$zero, _options$delimiter;
  2864. var defaultOptions10 = getDefaultOptions();
  2865. var locale = (_ref22 = (_options$locale10 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale10 !== void 0 ? _options$locale10 : defaultOptions10.locale) !== null && _ref22 !== void 0 ? _ref22 : enUS;
  2866. var format4 = (_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : defaultFormat;
  2867. var zero = (_options$zero = options === null || options === void 0 ? void 0 : options.zero) !== null && _options$zero !== void 0 ? _options$zero : false;
  2868. var delimiter = (_options$delimiter = options === null || options === void 0 ? void 0 : options.delimiter) !== null && _options$delimiter !== void 0 ? _options$delimiter : " ";
  2869. if (!locale.formatDistance) {
  2870. return "";
  2871. }
  2872. var result = format4.reduce(function (acc, unit) {
  2873. var token = "x".concat(unit.replace(/(^.)/, function (m) {return m.toUpperCase();}));
  2874. var value = duration[unit];
  2875. if (value !== undefined && (zero || duration[unit])) {
  2876. return acc.concat(locale.formatDistance(token, value));
  2877. }
  2878. return acc;
  2879. }, []).join(delimiter);
  2880. return result;
  2881. }
  2882. var defaultFormat = [
  2883. "years",
  2884. "months",
  2885. "weeks",
  2886. "days",
  2887. "hours",
  2888. "minutes",
  2889. "seconds"];
  2890. // lib/fp/formatDuration.js
  2891. var formatDuration3 = convertToFP(formatDuration, 1);
  2892. // lib/fp/formatDurationWithOptions.js
  2893. var _formatDurationWithOptions = convertToFP(formatDuration, 2);
  2894. // lib/formatISO.js
  2895. function formatISO(date, options) {var _options$format2, _options$representati;
  2896. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  2897. if (isNaN(+date_)) {
  2898. throw new RangeError("Invalid time value");
  2899. }
  2900. var format4 = (_options$format2 = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format2 !== void 0 ? _options$format2 : "extended";
  2901. var representation = (_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : "complete";
  2902. var result = "";
  2903. var tzOffset = "";
  2904. var dateDelimiter = format4 === "extended" ? "-" : "";
  2905. var timeDelimiter = format4 === "extended" ? ":" : "";
  2906. if (representation !== "time") {
  2907. var day = addLeadingZeros(date_.getDate(), 2);
  2908. var month = addLeadingZeros(date_.getMonth() + 1, 2);
  2909. var year = addLeadingZeros(date_.getFullYear(), 4);
  2910. result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);
  2911. }
  2912. if (representation !== "date") {
  2913. var offset = date_.getTimezoneOffset();
  2914. if (offset !== 0) {
  2915. var absoluteOffset = Math.abs(offset);
  2916. var hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
  2917. var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
  2918. var sign = offset < 0 ? "+" : "-";
  2919. tzOffset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset);
  2920. } else {
  2921. tzOffset = "Z";
  2922. }
  2923. var hour = addLeadingZeros(date_.getHours(), 2);
  2924. var minute = addLeadingZeros(date_.getMinutes(), 2);
  2925. var second = addLeadingZeros(date_.getSeconds(), 2);
  2926. var separator = result === "" ? "" : "T";
  2927. var time = [hour, minute, second].join(timeDelimiter);
  2928. result = "".concat(result).concat(separator).concat(time).concat(tzOffset);
  2929. }
  2930. return result;
  2931. }
  2932. // lib/fp/formatISO.js
  2933. var formatISO3 = convertToFP(formatISO, 1);
  2934. // lib/formatISO9075.js
  2935. function formatISO9075(date, options) {var _options$format3, _options$representati2;
  2936. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  2937. if (!isValid(date_)) {
  2938. throw new RangeError("Invalid time value");
  2939. }
  2940. var format4 = (_options$format3 = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format3 !== void 0 ? _options$format3 : "extended";
  2941. var representation = (_options$representati2 = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati2 !== void 0 ? _options$representati2 : "complete";
  2942. var result = "";
  2943. var dateDelimiter = format4 === "extended" ? "-" : "";
  2944. var timeDelimiter = format4 === "extended" ? ":" : "";
  2945. if (representation !== "time") {
  2946. var day = addLeadingZeros(date_.getDate(), 2);
  2947. var month = addLeadingZeros(date_.getMonth() + 1, 2);
  2948. var year = addLeadingZeros(date_.getFullYear(), 4);
  2949. result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);
  2950. }
  2951. if (representation !== "date") {
  2952. var hour = addLeadingZeros(date_.getHours(), 2);
  2953. var minute = addLeadingZeros(date_.getMinutes(), 2);
  2954. var second = addLeadingZeros(date_.getSeconds(), 2);
  2955. var separator = result === "" ? "" : " ";
  2956. result = "".concat(result).concat(separator).concat(hour).concat(timeDelimiter).concat(minute).concat(timeDelimiter).concat(second);
  2957. }
  2958. return result;
  2959. }
  2960. // lib/fp/formatISO9075.js
  2961. var formatISO90753 = convertToFP(formatISO9075, 1);
  2962. // lib/fp/formatISO9075WithOptions.js
  2963. var _formatISO9075WithOptions = convertToFP(formatISO9075, 2);
  2964. // lib/formatISODuration.js
  2965. function formatISODuration(duration) {
  2966. var _duration$years2 =
  2967. duration.years,years = _duration$years2 === void 0 ? 0 : _duration$years2,_duration$months2 = duration.months,months = _duration$months2 === void 0 ? 0 : _duration$months2,_duration$days2 = duration.days,days = _duration$days2 === void 0 ? 0 : _duration$days2,_duration$hours2 = duration.hours,hours = _duration$hours2 === void 0 ? 0 : _duration$hours2,_duration$minutes2 = duration.minutes,minutes = _duration$minutes2 === void 0 ? 0 : _duration$minutes2,_duration$seconds2 = duration.seconds,seconds = _duration$seconds2 === void 0 ? 0 : _duration$seconds2;
  2968. return "P".concat(years, "Y").concat(months, "M").concat(days, "DT").concat(hours, "H").concat(minutes, "M").concat(seconds, "S");
  2969. }
  2970. // lib/fp/formatISODuration.js
  2971. var formatISODuration3 = convertToFP(formatISODuration, 1);
  2972. // lib/fp/formatISOWithOptions.js
  2973. var _formatISOWithOptions = convertToFP(formatISO, 2);
  2974. // lib/formatRFC3339.js
  2975. function formatRFC3339(date, options) {var _options$fractionDigi;
  2976. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  2977. if (!isValid(date_)) {
  2978. throw new RangeError("Invalid time value");
  2979. }
  2980. var fractionDigits = (_options$fractionDigi = options === null || options === void 0 ? void 0 : options.fractionDigits) !== null && _options$fractionDigi !== void 0 ? _options$fractionDigi : 0;
  2981. var day = addLeadingZeros(date_.getDate(), 2);
  2982. var month = addLeadingZeros(date_.getMonth() + 1, 2);
  2983. var year = date_.getFullYear();
  2984. var hour = addLeadingZeros(date_.getHours(), 2);
  2985. var minute = addLeadingZeros(date_.getMinutes(), 2);
  2986. var second = addLeadingZeros(date_.getSeconds(), 2);
  2987. var fractionalSecond = "";
  2988. if (fractionDigits > 0) {
  2989. var _milliseconds = date_.getMilliseconds();
  2990. var fractionalSeconds = Math.trunc(_milliseconds * Math.pow(10, fractionDigits - 3));
  2991. fractionalSecond = "." + addLeadingZeros(fractionalSeconds, fractionDigits);
  2992. }
  2993. var offset = "";
  2994. var tzOffset = date_.getTimezoneOffset();
  2995. if (tzOffset !== 0) {
  2996. var absoluteOffset = Math.abs(tzOffset);
  2997. var hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
  2998. var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
  2999. var sign = tzOffset < 0 ? "+" : "-";
  3000. offset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset);
  3001. } else {
  3002. offset = "Z";
  3003. }
  3004. return "".concat(year, "-").concat(month, "-").concat(day, "T").concat(hour, ":").concat(minute, ":").concat(second).concat(fractionalSecond).concat(offset);
  3005. }
  3006. // lib/fp/formatRFC3339.js
  3007. var formatRFC33393 = convertToFP(formatRFC3339, 1);
  3008. // lib/fp/formatRFC3339WithOptions.js
  3009. var _formatRFC3339WithOptions = convertToFP(formatRFC3339, 2);
  3010. // lib/formatRFC7231.js
  3011. function formatRFC7231(date) {
  3012. var _date = toDate(date);
  3013. if (!isValid(_date)) {
  3014. throw new RangeError("Invalid time value");
  3015. }
  3016. var dayName = days[_date.getUTCDay()];
  3017. var dayOfMonth = addLeadingZeros(_date.getUTCDate(), 2);
  3018. var monthName = months[_date.getUTCMonth()];
  3019. var year = _date.getUTCFullYear();
  3020. var hour = addLeadingZeros(_date.getUTCHours(), 2);
  3021. var minute = addLeadingZeros(_date.getUTCMinutes(), 2);
  3022. var second = addLeadingZeros(_date.getUTCSeconds(), 2);
  3023. return "".concat(dayName, ", ").concat(dayOfMonth, " ").concat(monthName, " ").concat(year, " ").concat(hour, ":").concat(minute, ":").concat(second, " GMT");
  3024. }
  3025. var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
  3026. var months = [
  3027. "Jan",
  3028. "Feb",
  3029. "Mar",
  3030. "Apr",
  3031. "May",
  3032. "Jun",
  3033. "Jul",
  3034. "Aug",
  3035. "Sep",
  3036. "Oct",
  3037. "Nov",
  3038. "Dec"];
  3039. // lib/fp/formatRFC7231.js
  3040. var formatRFC72313 = convertToFP(formatRFC7231, 1);
  3041. // lib/formatRelative.js
  3042. function formatRelative3(date, baseDate, options) {var _ref23, _options$locale11, _ref24, _ref25, _ref26, _options$weekStartsOn4, _options$locale12, _defaultOptions11$loc;
  3043. var _normalizeDates39 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, date, baseDate),_normalizeDates40 = _slicedToArray(_normalizeDates39, 2),date_ = _normalizeDates40[0],baseDate_ = _normalizeDates40[1];
  3044. var defaultOptions11 = getDefaultOptions();
  3045. var locale = (_ref23 = (_options$locale11 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale11 !== void 0 ? _options$locale11 : defaultOptions11.locale) !== null && _ref23 !== void 0 ? _ref23 : enUS;
  3046. var weekStartsOn = (_ref24 = (_ref25 = (_ref26 = (_options$weekStartsOn4 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn4 !== void 0 ? _options$weekStartsOn4 : options === null || options === void 0 || (_options$locale12 = options.locale) === null || _options$locale12 === void 0 || (_options$locale12 = _options$locale12.options) === null || _options$locale12 === void 0 ? void 0 : _options$locale12.weekStartsOn) !== null && _ref26 !== void 0 ? _ref26 : defaultOptions11.weekStartsOn) !== null && _ref25 !== void 0 ? _ref25 : (_defaultOptions11$loc = defaultOptions11.locale) === null || _defaultOptions11$loc === void 0 || (_defaultOptions11$loc = _defaultOptions11$loc.options) === null || _defaultOptions11$loc === void 0 ? void 0 : _defaultOptions11$loc.weekStartsOn) !== null && _ref24 !== void 0 ? _ref24 : 0;
  3047. var diff = differenceInCalendarDays(date_, baseDate_);
  3048. if (isNaN(diff)) {
  3049. throw new RangeError("Invalid time value");
  3050. }
  3051. var token;
  3052. if (diff < -6) {
  3053. token = "other";
  3054. } else if (diff < -1) {
  3055. token = "lastWeek";
  3056. } else if (diff < 0) {
  3057. token = "yesterday";
  3058. } else if (diff < 1) {
  3059. token = "today";
  3060. } else if (diff < 2) {
  3061. token = "tomorrow";
  3062. } else if (diff < 7) {
  3063. token = "nextWeek";
  3064. } else {
  3065. token = "other";
  3066. }
  3067. var formatStr = locale.formatRelative(token, date_, baseDate_, {
  3068. locale: locale,
  3069. weekStartsOn: weekStartsOn
  3070. });
  3071. return format(date_, formatStr, { locale: locale, weekStartsOn: weekStartsOn });
  3072. }
  3073. // lib/fp/formatRelative.js
  3074. var formatRelative5 = convertToFP(formatRelative3, 2);
  3075. // lib/fp/formatRelativeWithOptions.js
  3076. var _formatRelativeWithOptions = convertToFP(formatRelative3, 3);
  3077. // lib/fp/formatWithOptions.js
  3078. var _formatWithOptions = convertToFP(format, 3);
  3079. // lib/fromUnixTime.js
  3080. function fromUnixTime(unixTime, options) {
  3081. return toDate(unixTime * 1000, options === null || options === void 0 ? void 0 : options.in);
  3082. }
  3083. // lib/fp/fromUnixTime.js
  3084. var fromUnixTime3 = convertToFP(fromUnixTime, 1);
  3085. // lib/fp/fromUnixTimeWithOptions.js
  3086. var _fromUnixTimeWithOptions = convertToFP(fromUnixTime, 2);
  3087. // lib/getDate.js
  3088. function getDate(date, options) {
  3089. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDate();
  3090. }
  3091. // lib/fp/getDate.js
  3092. var getDate3 = convertToFP(getDate, 1);
  3093. // lib/fp/getDateWithOptions.js
  3094. var _getDateWithOptions = convertToFP(getDate, 2);
  3095. // lib/getDay.js
  3096. function getDay(date, options) {
  3097. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay();
  3098. }
  3099. // lib/fp/getDay.js
  3100. var getDay3 = convertToFP(getDay, 1);
  3101. // lib/fp/getDayOfYear.js
  3102. var getDayOfYear4 = convertToFP(getDayOfYear, 1);
  3103. // lib/fp/getDayOfYearWithOptions.js
  3104. var _getDayOfYearWithOptions = convertToFP(getDayOfYear, 2);
  3105. // lib/fp/getDayWithOptions.js
  3106. var _getDayWithOptions = convertToFP(getDay, 2);
  3107. // lib/getDaysInMonth.js
  3108. function getDaysInMonth(date, options) {
  3109. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3110. var year = _date.getFullYear();
  3111. var monthIndex = _date.getMonth();
  3112. var lastDayOfMonth = constructFrom(_date, 0);
  3113. lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
  3114. lastDayOfMonth.setHours(0, 0, 0, 0);
  3115. return lastDayOfMonth.getDate();
  3116. }
  3117. // lib/fp/getDaysInMonth.js
  3118. var getDaysInMonth3 = convertToFP(getDaysInMonth, 1);
  3119. // lib/fp/getDaysInMonthWithOptions.js
  3120. var _getDaysInMonthWithOptions = convertToFP(getDaysInMonth, 2);
  3121. // lib/isLeapYear.js
  3122. function isLeapYear(date, options) {
  3123. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3124. var year = _date.getFullYear();
  3125. return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
  3126. }
  3127. // lib/getDaysInYear.js
  3128. function getDaysInYear(date, options) {
  3129. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3130. if (Number.isNaN(+_date))
  3131. return NaN;
  3132. return isLeapYear(_date) ? 366 : 365;
  3133. }
  3134. // lib/fp/getDaysInYear.js
  3135. var getDaysInYear3 = convertToFP(getDaysInYear, 1);
  3136. // lib/fp/getDaysInYearWithOptions.js
  3137. var _getDaysInYearWithOptions = convertToFP(getDaysInYear, 2);
  3138. // lib/getDecade.js
  3139. function getDecade(date, options) {
  3140. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3141. var year = _date.getFullYear();
  3142. var decade = Math.floor(year / 10) * 10;
  3143. return decade;
  3144. }
  3145. // lib/fp/getDecade.js
  3146. var getDecade3 = convertToFP(getDecade, 1);
  3147. // lib/fp/getDecadeWithOptions.js
  3148. var _getDecadeWithOptions = convertToFP(getDecade, 2);
  3149. // lib/getHours.js
  3150. function getHours(date, options) {
  3151. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getHours();
  3152. }
  3153. // lib/fp/getHours.js
  3154. var getHours3 = convertToFP(getHours, 1);
  3155. // lib/fp/getHoursWithOptions.js
  3156. var _getHoursWithOptions = convertToFP(getHours, 2);
  3157. // lib/getISODay.js
  3158. function getISODay(date, options) {
  3159. var day = toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay();
  3160. return day === 0 ? 7 : day;
  3161. }
  3162. // lib/fp/getISODay.js
  3163. var getISODay3 = convertToFP(getISODay, 1);
  3164. // lib/fp/getISODayWithOptions.js
  3165. var _getISODayWithOptions = convertToFP(getISODay, 2);
  3166. // lib/fp/getISOWeek.js
  3167. var getISOWeek4 = convertToFP(getISOWeek, 1);
  3168. // lib/fp/getISOWeekWithOptions.js
  3169. var _getISOWeekWithOptions = convertToFP(getISOWeek, 2);
  3170. // lib/fp/getISOWeekYear.js
  3171. var getISOWeekYear8 = convertToFP(getISOWeekYear, 1);
  3172. // lib/fp/getISOWeekYearWithOptions.js
  3173. var _getISOWeekYearWithOptions = convertToFP(getISOWeekYear, 2);
  3174. // lib/getISOWeeksInYear.js
  3175. function getISOWeeksInYear(date, options) {
  3176. var thisYear = startOfISOWeekYear(date, options);
  3177. var nextYear = startOfISOWeekYear(addWeeks(thisYear, 60));
  3178. var diff = +nextYear - +thisYear;
  3179. return Math.round(diff / millisecondsInWeek);
  3180. }
  3181. // lib/fp/getISOWeeksInYear.js
  3182. var getISOWeeksInYear3 = convertToFP(getISOWeeksInYear, 1);
  3183. // lib/fp/getISOWeeksInYearWithOptions.js
  3184. var _getISOWeeksInYearWithOptions = convertToFP(getISOWeeksInYear, 2);
  3185. // lib/getMilliseconds.js
  3186. function getMilliseconds(date) {
  3187. return toDate(date).getMilliseconds();
  3188. }
  3189. // lib/fp/getMilliseconds.js
  3190. var getMilliseconds3 = convertToFP(getMilliseconds, 1);
  3191. // lib/getMinutes.js
  3192. function getMinutes(date, options) {
  3193. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getMinutes();
  3194. }
  3195. // lib/fp/getMinutes.js
  3196. var getMinutes3 = convertToFP(getMinutes, 1);
  3197. // lib/fp/getMinutesWithOptions.js
  3198. var _getMinutesWithOptions = convertToFP(getMinutes, 2);
  3199. // lib/getMonth.js
  3200. function getMonth(date, options) {
  3201. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getMonth();
  3202. }
  3203. // lib/fp/getMonth.js
  3204. var getMonth3 = convertToFP(getMonth, 1);
  3205. // lib/fp/getMonthWithOptions.js
  3206. var _getMonthWithOptions = convertToFP(getMonth, 2);
  3207. // lib/getOverlappingDaysInIntervals.js
  3208. function getOverlappingDaysInIntervals(intervalLeft, intervalRight) {
  3209. var _sort5 = [
  3210. +toDate(intervalLeft.start),
  3211. +toDate(intervalLeft.end)].
  3212. sort(function (a, b) {return a - b;}),_sort6 = _slicedToArray(_sort5, 2),leftStart = _sort6[0],leftEnd = _sort6[1];
  3213. var _sort7 = [
  3214. +toDate(intervalRight.start),
  3215. +toDate(intervalRight.end)].
  3216. sort(function (a, b) {return a - b;}),_sort8 = _slicedToArray(_sort7, 2),rightStart = _sort8[0],rightEnd = _sort8[1];
  3217. var isOverlapping = leftStart < rightEnd && rightStart < leftEnd;
  3218. if (!isOverlapping)
  3219. return 0;
  3220. var overlapLeft = rightStart < leftStart ? leftStart : rightStart;
  3221. var left = overlapLeft - getTimezoneOffsetInMilliseconds(overlapLeft);
  3222. var overlapRight = rightEnd > leftEnd ? leftEnd : rightEnd;
  3223. var right = overlapRight - getTimezoneOffsetInMilliseconds(overlapRight);
  3224. return Math.ceil((right - left) / millisecondsInDay);
  3225. }
  3226. // lib/fp/getOverlappingDaysInIntervals.js
  3227. var getOverlappingDaysInIntervals3 = convertToFP(getOverlappingDaysInIntervals, 2);
  3228. // lib/fp/getQuarter.js
  3229. var getQuarter4 = convertToFP(getQuarter, 1);
  3230. // lib/fp/getQuarterWithOptions.js
  3231. var _getQuarterWithOptions = convertToFP(getQuarter, 2);
  3232. // lib/getSeconds.js
  3233. function getSeconds(date) {
  3234. return toDate(date).getSeconds();
  3235. }
  3236. // lib/fp/getSeconds.js
  3237. var getSeconds3 = convertToFP(getSeconds, 1);
  3238. // lib/getTime.js
  3239. function getTime(date) {
  3240. return +toDate(date);
  3241. }
  3242. // lib/fp/getTime.js
  3243. var getTime3 = convertToFP(getTime, 1);
  3244. // lib/getUnixTime.js
  3245. function getUnixTime(date) {
  3246. return Math.trunc(+toDate(date) / 1000);
  3247. }
  3248. // lib/fp/getUnixTime.js
  3249. var getUnixTime3 = convertToFP(getUnixTime, 1);
  3250. // lib/fp/getWeek.js
  3251. var getWeek4 = convertToFP(getWeek, 1);
  3252. // lib/getWeekOfMonth.js
  3253. function getWeekOfMonth(date, options) {var _ref27, _ref28, _ref29, _options$weekStartsOn5, _options$locale13, _defaultOptions12$loc;
  3254. var defaultOptions12 = getDefaultOptions();
  3255. var weekStartsOn = (_ref27 = (_ref28 = (_ref29 = (_options$weekStartsOn5 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn5 !== void 0 ? _options$weekStartsOn5 : options === null || options === void 0 || (_options$locale13 = options.locale) === null || _options$locale13 === void 0 || (_options$locale13 = _options$locale13.options) === null || _options$locale13 === void 0 ? void 0 : _options$locale13.weekStartsOn) !== null && _ref29 !== void 0 ? _ref29 : defaultOptions12.weekStartsOn) !== null && _ref28 !== void 0 ? _ref28 : (_defaultOptions12$loc = defaultOptions12.locale) === null || _defaultOptions12$loc === void 0 || (_defaultOptions12$loc = _defaultOptions12$loc.options) === null || _defaultOptions12$loc === void 0 ? void 0 : _defaultOptions12$loc.weekStartsOn) !== null && _ref27 !== void 0 ? _ref27 : 0;
  3256. var currentDayOfMonth = getDate(toDate(date, options === null || options === void 0 ? void 0 : options.in));
  3257. if (isNaN(currentDayOfMonth))
  3258. return NaN;
  3259. var startWeekDay = getDay(startOfMonth(date, options));
  3260. var lastDayOfFirstWeek = weekStartsOn - startWeekDay;
  3261. if (lastDayOfFirstWeek <= 0)
  3262. lastDayOfFirstWeek += 7;
  3263. var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek;
  3264. return Math.ceil(remainingDaysAfterFirstWeek / 7) + 1;
  3265. }
  3266. // lib/fp/getWeekOfMonth.js
  3267. var getWeekOfMonth3 = convertToFP(getWeekOfMonth, 1);
  3268. // lib/fp/getWeekOfMonthWithOptions.js
  3269. var _getWeekOfMonthWithOptions = convertToFP(getWeekOfMonth, 2);
  3270. // lib/fp/getWeekWithOptions.js
  3271. var _getWeekWithOptions = convertToFP(getWeek, 2);
  3272. // lib/fp/getWeekYear.js
  3273. var getWeekYear5 = convertToFP(getWeekYear, 1);
  3274. // lib/fp/getWeekYearWithOptions.js
  3275. var _getWeekYearWithOptions = convertToFP(getWeekYear, 2);
  3276. // lib/lastDayOfMonth.js
  3277. function lastDayOfMonth(date, options) {
  3278. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3279. var month = _date.getMonth();
  3280. _date.setFullYear(_date.getFullYear(), month + 1, 0);
  3281. _date.setHours(0, 0, 0, 0);
  3282. return toDate(_date, options === null || options === void 0 ? void 0 : options.in);
  3283. }
  3284. // lib/getWeeksInMonth.js
  3285. function getWeeksInMonth(date, options) {
  3286. var contextDate = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3287. return differenceInCalendarWeeks(lastDayOfMonth(contextDate, options), startOfMonth(contextDate, options), options) + 1;
  3288. }
  3289. // lib/fp/getWeeksInMonth.js
  3290. var getWeeksInMonth3 = convertToFP(getWeeksInMonth, 1);
  3291. // lib/fp/getWeeksInMonthWithOptions.js
  3292. var _getWeeksInMonthWithOptions = convertToFP(getWeeksInMonth, 2);
  3293. // lib/getYear.js
  3294. function getYear(date, options) {
  3295. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getFullYear();
  3296. }
  3297. // lib/fp/getYear.js
  3298. var getYear3 = convertToFP(getYear, 1);
  3299. // lib/fp/getYearWithOptions.js
  3300. var _getYearWithOptions = convertToFP(getYear, 2);
  3301. // lib/hoursToMilliseconds.js
  3302. function hoursToMilliseconds(hours) {
  3303. return Math.trunc(hours * millisecondsInHour);
  3304. }
  3305. // lib/fp/hoursToMilliseconds.js
  3306. var hoursToMilliseconds3 = convertToFP(hoursToMilliseconds, 1);
  3307. // lib/hoursToMinutes.js
  3308. function hoursToMinutes(hours) {
  3309. return Math.trunc(hours * minutesInHour);
  3310. }
  3311. // lib/fp/hoursToMinutes.js
  3312. var hoursToMinutes3 = convertToFP(hoursToMinutes, 1);
  3313. // lib/hoursToSeconds.js
  3314. function hoursToSeconds(hours) {
  3315. return Math.trunc(hours * secondsInHour);
  3316. }
  3317. // lib/fp/hoursToSeconds.js
  3318. var hoursToSeconds3 = convertToFP(hoursToSeconds, 1);
  3319. // lib/interval.js
  3320. function interval(start, end, options) {
  3321. var _normalizeDates41 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, start, end),_normalizeDates42 = _slicedToArray(_normalizeDates41, 2),_start = _normalizeDates42[0],_end = _normalizeDates42[1];
  3322. if (isNaN(+_start))
  3323. throw new TypeError("Start date is invalid");
  3324. if (isNaN(+_end))
  3325. throw new TypeError("End date is invalid");
  3326. if (options !== null && options !== void 0 && options.assertPositive && +_start > +_end)
  3327. throw new TypeError("End date must be after start date");
  3328. return { start: _start, end: _end };
  3329. }
  3330. // lib/fp/interval.js
  3331. var interval3 = convertToFP(interval, 2);
  3332. // lib/intervalToDuration.js
  3333. function intervalToDuration(interval4, options) {
  3334. var _normalizeInterval9 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval4),start = _normalizeInterval9.start,end = _normalizeInterval9.end;
  3335. var duration = {};
  3336. var years = differenceInYears(end, start);
  3337. if (years)
  3338. duration.years = years;
  3339. var remainingMonths = add(start, { years: duration.years });
  3340. var months2 = differenceInMonths(end, remainingMonths);
  3341. if (months2)
  3342. duration.months = months2;
  3343. var remainingDays = add(remainingMonths, { months: duration.months });
  3344. var days2 = differenceInDays(end, remainingDays);
  3345. if (days2)
  3346. duration.days = days2;
  3347. var remainingHours = add(remainingDays, { days: duration.days });
  3348. var hours = differenceInHours(end, remainingHours);
  3349. if (hours)
  3350. duration.hours = hours;
  3351. var remainingMinutes = add(remainingHours, { hours: duration.hours });
  3352. var minutes = differenceInMinutes(end, remainingMinutes);
  3353. if (minutes)
  3354. duration.minutes = minutes;
  3355. var remainingSeconds = add(remainingMinutes, { minutes: duration.minutes });
  3356. var seconds = differenceInSeconds(end, remainingSeconds);
  3357. if (seconds)
  3358. duration.seconds = seconds;
  3359. return duration;
  3360. }
  3361. // lib/fp/intervalToDuration.js
  3362. var intervalToDuration3 = convertToFP(intervalToDuration, 1);
  3363. // lib/fp/intervalToDurationWithOptions.js
  3364. var _intervalToDurationWithOptions = convertToFP(intervalToDuration, 2);
  3365. // lib/fp/intervalWithOptions.js
  3366. var _intervalWithOptions = convertToFP(interval, 3);
  3367. // lib/intlFormat.js
  3368. function intlFormat(date, formatOrLocale, localeOptions) {var _localeOptions;
  3369. var formatOptions;
  3370. if (isFormatOptions(formatOrLocale)) {
  3371. formatOptions = formatOrLocale;
  3372. } else {
  3373. localeOptions = formatOrLocale;
  3374. }
  3375. return new Intl.DateTimeFormat((_localeOptions = localeOptions) === null || _localeOptions === void 0 ? void 0 : _localeOptions.locale, formatOptions).format(toDate(date));
  3376. }
  3377. function isFormatOptions(opts) {
  3378. return opts !== undefined && !("locale" in opts);
  3379. }
  3380. // lib/fp/intlFormat.js
  3381. var intlFormat3 = convertToFP(intlFormat, 3);
  3382. // lib/intlFormatDistance.js
  3383. function intlFormatDistance(laterDate, earlierDate, options) {
  3384. var value = 0;
  3385. var unit;
  3386. var _normalizeDates43 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates44 = _slicedToArray(_normalizeDates43, 2),laterDate_ = _normalizeDates44[0],earlierDate_ = _normalizeDates44[1];
  3387. if (!(options !== null && options !== void 0 && options.unit)) {
  3388. var diffInSeconds = differenceInSeconds(laterDate_, earlierDate_);
  3389. if (Math.abs(diffInSeconds) < secondsInMinute) {
  3390. value = differenceInSeconds(laterDate_, earlierDate_);
  3391. unit = "second";
  3392. } else if (Math.abs(diffInSeconds) < secondsInHour) {
  3393. value = differenceInMinutes(laterDate_, earlierDate_);
  3394. unit = "minute";
  3395. } else if (Math.abs(diffInSeconds) < secondsInDay && Math.abs(differenceInCalendarDays(laterDate_, earlierDate_)) < 1) {
  3396. value = differenceInHours(laterDate_, earlierDate_);
  3397. unit = "hour";
  3398. } else if (Math.abs(diffInSeconds) < secondsInWeek && (value = differenceInCalendarDays(laterDate_, earlierDate_)) && Math.abs(value) < 7) {
  3399. unit = "day";
  3400. } else if (Math.abs(diffInSeconds) < secondsInMonth) {
  3401. value = differenceInCalendarWeeks(laterDate_, earlierDate_);
  3402. unit = "week";
  3403. } else if (Math.abs(diffInSeconds) < secondsInQuarter) {
  3404. value = differenceInCalendarMonths(laterDate_, earlierDate_);
  3405. unit = "month";
  3406. } else if (Math.abs(diffInSeconds) < secondsInYear) {
  3407. if (differenceInCalendarQuarters(laterDate_, earlierDate_) < 4) {
  3408. value = differenceInCalendarQuarters(laterDate_, earlierDate_);
  3409. unit = "quarter";
  3410. } else {
  3411. value = differenceInCalendarYears(laterDate_, earlierDate_);
  3412. unit = "year";
  3413. }
  3414. } else {
  3415. value = differenceInCalendarYears(laterDate_, earlierDate_);
  3416. unit = "year";
  3417. }
  3418. } else {
  3419. unit = options === null || options === void 0 ? void 0 : options.unit;
  3420. if (unit === "second") {
  3421. value = differenceInSeconds(laterDate_, earlierDate_);
  3422. } else if (unit === "minute") {
  3423. value = differenceInMinutes(laterDate_, earlierDate_);
  3424. } else if (unit === "hour") {
  3425. value = differenceInHours(laterDate_, earlierDate_);
  3426. } else if (unit === "day") {
  3427. value = differenceInCalendarDays(laterDate_, earlierDate_);
  3428. } else if (unit === "week") {
  3429. value = differenceInCalendarWeeks(laterDate_, earlierDate_);
  3430. } else if (unit === "month") {
  3431. value = differenceInCalendarMonths(laterDate_, earlierDate_);
  3432. } else if (unit === "quarter") {
  3433. value = differenceInCalendarQuarters(laterDate_, earlierDate_);
  3434. } else if (unit === "year") {
  3435. value = differenceInCalendarYears(laterDate_, earlierDate_);
  3436. }
  3437. }
  3438. var rtf = new Intl.RelativeTimeFormat(options === null || options === void 0 ? void 0 : options.locale, _objectSpread({
  3439. numeric: "auto" },
  3440. options)
  3441. );
  3442. return rtf.format(value, unit);
  3443. }
  3444. // lib/fp/intlFormatDistance.js
  3445. var intlFormatDistance3 = convertToFP(intlFormatDistance, 2);
  3446. // lib/fp/intlFormatDistanceWithOptions.js
  3447. var _intlFormatDistanceWithOptions = convertToFP(intlFormatDistance, 3);
  3448. // lib/isAfter.js
  3449. function isAfter(date, dateToCompare) {
  3450. return +toDate(date) > +toDate(dateToCompare);
  3451. }
  3452. // lib/fp/isAfter.js
  3453. var isAfter3 = convertToFP(isAfter, 2);
  3454. // lib/isBefore.js
  3455. function isBefore(date, dateToCompare) {
  3456. return +toDate(date) < +toDate(dateToCompare);
  3457. }
  3458. // lib/fp/isBefore.js
  3459. var isBefore3 = convertToFP(isBefore, 2);
  3460. // lib/fp/isDate.js
  3461. var isDate4 = convertToFP(isDate, 1);
  3462. // lib/isEqual.js
  3463. function isEqual(leftDate, rightDate) {
  3464. return +toDate(leftDate) === +toDate(rightDate);
  3465. }
  3466. // lib/fp/isEqual.js
  3467. var isEqual3 = convertToFP(isEqual, 2);
  3468. // lib/isExists.js
  3469. function isExists(year, month, day) {
  3470. var date = new Date(year, month, day);
  3471. return date.getFullYear() === year && date.getMonth() === month && date.getDate() === day;
  3472. }
  3473. // lib/fp/isExists.js
  3474. var isExists3 = convertToFP(isExists, 3);
  3475. // lib/isFirstDayOfMonth.js
  3476. function isFirstDayOfMonth(date, options) {
  3477. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDate() === 1;
  3478. }
  3479. // lib/fp/isFirstDayOfMonth.js
  3480. var isFirstDayOfMonth3 = convertToFP(isFirstDayOfMonth, 1);
  3481. // lib/fp/isFirstDayOfMonthWithOptions.js
  3482. var _isFirstDayOfMonthWithOptions = convertToFP(isFirstDayOfMonth, 2);
  3483. // lib/isFriday.js
  3484. function isFriday(date, options) {
  3485. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 5;
  3486. }
  3487. // lib/fp/isFriday.js
  3488. var isFriday3 = convertToFP(isFriday, 1);
  3489. // lib/fp/isFridayWithOptions.js
  3490. var _isFridayWithOptions = convertToFP(isFriday, 2);
  3491. // lib/fp/isLastDayOfMonth.js
  3492. var isLastDayOfMonth4 = convertToFP(isLastDayOfMonth, 1);
  3493. // lib/fp/isLastDayOfMonthWithOptions.js
  3494. var _isLastDayOfMonthWithOptions = convertToFP(isLastDayOfMonth, 2);
  3495. // lib/fp/isLeapYear.js
  3496. var isLeapYear4 = convertToFP(isLeapYear, 1);
  3497. // lib/fp/isLeapYearWithOptions.js
  3498. var _isLeapYearWithOptions = convertToFP(isLeapYear, 2);
  3499. // lib/getDefaultOptions.js
  3500. function getDefaultOptions2() {
  3501. return Object.assign({}, getDefaultOptions());
  3502. }
  3503. // lib/transpose.js
  3504. function transpose(date, constructor) {
  3505. var date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0);
  3506. date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
  3507. date_.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
  3508. return date_;
  3509. }
  3510. function isConstructor(constructor) {var _constructor$prototyp;
  3511. return typeof constructor === "function" && ((_constructor$prototyp = constructor.prototype) === null || _constructor$prototyp === void 0 ? void 0 : _constructor$prototyp.constructor) === constructor;
  3512. }
  3513. // lib/parse/_lib/Setter.js
  3514. var TIMEZONE_UNIT_PRIORITY = 10;var
  3515. Setter = /*#__PURE__*/function () {function Setter() {_classCallCheck(this, Setter);_defineProperty(this, "subPriority",
  3516. 0);}_createClass(Setter, [{ key: "validate", value:
  3517. function validate(_utcDate, _options) {
  3518. return true;
  3519. } }]);return Setter;}();var
  3520. ValueSetter = /*#__PURE__*/function (_Setter2) {_inherits(ValueSetter, _Setter2);
  3521. function ValueSetter(value, validateValue, setValue, priority, subPriority) {var _this;_classCallCheck(this, ValueSetter);
  3522. _this = _callSuper(this, ValueSetter);
  3523. _this.value = value;
  3524. _this.validateValue = validateValue;
  3525. _this.setValue = setValue;
  3526. _this.priority = priority;
  3527. if (subPriority) {
  3528. _this.subPriority = subPriority;
  3529. }return _this;
  3530. }_createClass(ValueSetter, [{ key: "validate", value:
  3531. function validate(date, options) {
  3532. return this.validateValue(date, this.value, options);
  3533. } }, { key: "set", value:
  3534. function set(date, flags, options) {
  3535. return this.setValue(date, flags, this.value, options);
  3536. } }]);return ValueSetter;}(Setter);var
  3537. DateTimezoneSetter = /*#__PURE__*/function (_Setter3) {_inherits(DateTimezoneSetter, _Setter3);
  3538. function DateTimezoneSetter(context, reference) {var _this2;_classCallCheck(this, DateTimezoneSetter);
  3539. _this2 = _callSuper(this, DateTimezoneSetter);_defineProperty(_assertThisInitialized(_this2), "priority", TIMEZONE_UNIT_PRIORITY);_defineProperty(_assertThisInitialized(_this2), "subPriority", -1);
  3540. _this2.context = context || function (date) {return constructFrom(reference, date);};return _this2;
  3541. }_createClass(DateTimezoneSetter, [{ key: "set", value:
  3542. function set(date, flags) {
  3543. if (flags.timestampIsSet)
  3544. return date;
  3545. return constructFrom(date, transpose(date, this.context));
  3546. } }]);return DateTimezoneSetter;}(Setter);
  3547. // lib/parse/_lib/Parser.js
  3548. var Parser = /*#__PURE__*/function () {function Parser() {_classCallCheck(this, Parser);}_createClass(Parser, [{ key: "run", value:
  3549. function run(dateString, token, match3, options) {
  3550. var result = this.parse(dateString, token, match3, options);
  3551. if (!result) {
  3552. return null;
  3553. }
  3554. return {
  3555. setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
  3556. rest: result.rest
  3557. };
  3558. } }, { key: "validate", value:
  3559. function validate(_utcDate, _value, _options) {
  3560. return true;
  3561. } }]);return Parser;}();
  3562. // lib/parse/_lib/parsers/EraParser.js
  3563. var EraParser = /*#__PURE__*/function (_Parser) {_inherits(EraParser, _Parser);function EraParser() {var _this3;_classCallCheck(this, EraParser);for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {args[_key3] = arguments[_key3];}_this3 = _callSuper(this, EraParser, [].concat(args));_defineProperty(_assertThisInitialized(_this3), "priority",
  3564. 140);_defineProperty(_assertThisInitialized(_this3), "incompatibleTokens",
  3565. ["R", "u", "t", "T"]);return _this3;}_createClass(EraParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "G":case "GG":case "GGG":return match3.era(dateString, { width: "abbreviated" }) || match3.era(dateString, { width: "narrow" });case "GGGGG":return match3.era(dateString, { width: "narrow" });case "GGGG":default:return match3.era(dateString, { width: "wide" }) || match3.era(dateString, { width: "abbreviated" }) || match3.era(dateString, { width: "narrow" });}} }, { key: "set", value: function set(date, flags, value) {flags.era = value;date.setFullYear(value, 0, 1);date.setHours(0, 0, 0, 0);return date;} }]);return EraParser;}(Parser);
  3566. // lib/parse/_lib/constants.js
  3567. var numericPatterns = {
  3568. month: /^(1[0-2]|0?\d)/,
  3569. date: /^(3[0-1]|[0-2]?\d)/,
  3570. dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
  3571. week: /^(5[0-3]|[0-4]?\d)/,
  3572. hour23h: /^(2[0-3]|[0-1]?\d)/,
  3573. hour24h: /^(2[0-4]|[0-1]?\d)/,
  3574. hour11h: /^(1[0-1]|0?\d)/,
  3575. hour12h: /^(1[0-2]|0?\d)/,
  3576. minute: /^[0-5]?\d/,
  3577. second: /^[0-5]?\d/,
  3578. singleDigit: /^\d/,
  3579. twoDigits: /^\d{1,2}/,
  3580. threeDigits: /^\d{1,3}/,
  3581. fourDigits: /^\d{1,4}/,
  3582. anyDigitsSigned: /^-?\d+/,
  3583. singleDigitSigned: /^-?\d/,
  3584. twoDigitsSigned: /^-?\d{1,2}/,
  3585. threeDigitsSigned: /^-?\d{1,3}/,
  3586. fourDigitsSigned: /^-?\d{1,4}/
  3587. };
  3588. var timezonePatterns = {
  3589. basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
  3590. basic: /^([+-])(\d{2})(\d{2})|Z/,
  3591. basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
  3592. extended: /^([+-])(\d{2}):(\d{2})|Z/,
  3593. extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
  3594. };
  3595. // lib/parse/_lib/utils.js
  3596. function mapValue(parseFnResult, mapFn) {
  3597. if (!parseFnResult) {
  3598. return parseFnResult;
  3599. }
  3600. return {
  3601. value: mapFn(parseFnResult.value),
  3602. rest: parseFnResult.rest
  3603. };
  3604. }
  3605. function parseNumericPattern(pattern, dateString) {
  3606. var matchResult = dateString.match(pattern);
  3607. if (!matchResult) {
  3608. return null;
  3609. }
  3610. return {
  3611. value: parseInt(matchResult[0], 10),
  3612. rest: dateString.slice(matchResult[0].length)
  3613. };
  3614. }
  3615. function parseTimezonePattern(pattern, dateString) {
  3616. var matchResult = dateString.match(pattern);
  3617. if (!matchResult) {
  3618. return null;
  3619. }
  3620. if (matchResult[0] === "Z") {
  3621. return {
  3622. value: 0,
  3623. rest: dateString.slice(1)
  3624. };
  3625. }
  3626. var sign = matchResult[1] === "+" ? 1 : -1;
  3627. var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
  3628. var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
  3629. var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
  3630. return {
  3631. value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
  3632. rest: dateString.slice(matchResult[0].length)
  3633. };
  3634. }
  3635. function parseAnyDigitsSigned(dateString) {
  3636. return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
  3637. }
  3638. function parseNDigits(n, dateString) {
  3639. switch (n) {
  3640. case 1:
  3641. return parseNumericPattern(numericPatterns.singleDigit, dateString);
  3642. case 2:
  3643. return parseNumericPattern(numericPatterns.twoDigits, dateString);
  3644. case 3:
  3645. return parseNumericPattern(numericPatterns.threeDigits, dateString);
  3646. case 4:
  3647. return parseNumericPattern(numericPatterns.fourDigits, dateString);
  3648. default:
  3649. return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString);
  3650. }
  3651. }
  3652. function parseNDigitsSigned(n, dateString) {
  3653. switch (n) {
  3654. case 1:
  3655. return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
  3656. case 2:
  3657. return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
  3658. case 3:
  3659. return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
  3660. case 4:
  3661. return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
  3662. default:
  3663. return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString);
  3664. }
  3665. }
  3666. function dayPeriodEnumToHours(dayPeriod) {
  3667. switch (dayPeriod) {
  3668. case "morning":
  3669. return 4;
  3670. case "evening":
  3671. return 17;
  3672. case "pm":
  3673. case "noon":
  3674. case "afternoon":
  3675. return 12;
  3676. case "am":
  3677. case "midnight":
  3678. case "night":
  3679. default:
  3680. return 0;
  3681. }
  3682. }
  3683. function normalizeTwoDigitYear(twoDigitYear, currentYear) {
  3684. var isCommonEra = currentYear > 0;
  3685. var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
  3686. var result;
  3687. if (absCurrentYear <= 50) {
  3688. result = twoDigitYear || 100;
  3689. } else {
  3690. var rangeEnd = absCurrentYear + 50;
  3691. var rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;
  3692. var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
  3693. result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
  3694. }
  3695. return isCommonEra ? result : 1 - result;
  3696. }
  3697. function isLeapYearIndex(year) {
  3698. return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
  3699. }
  3700. // lib/parse/_lib/parsers/YearParser.js
  3701. var YearParser = /*#__PURE__*/function (_Parser2) {_inherits(YearParser, _Parser2);function YearParser() {var _this4;_classCallCheck(this, YearParser);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}_this4 = _callSuper(this, YearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this4), "priority",
  3702. 130);_defineProperty(_assertThisInitialized(_this4), "incompatibleTokens",
  3703. ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);return _this4;}_createClass(YearParser, [{ key: "parse", value:
  3704. function parse(dateString, token, match3) {
  3705. var valueCallback = function valueCallback(year) {return {
  3706. year: year,
  3707. isTwoDigitYear: token === "yy"
  3708. };};
  3709. switch (token) {
  3710. case "y":
  3711. return mapValue(parseNDigits(4, dateString), valueCallback);
  3712. case "yo":
  3713. return mapValue(match3.ordinalNumber(dateString, {
  3714. unit: "year"
  3715. }), valueCallback);
  3716. default:
  3717. return mapValue(parseNDigits(token.length, dateString), valueCallback);
  3718. }
  3719. } }, { key: "validate", value:
  3720. function validate(_date, value) {
  3721. return value.isTwoDigitYear || value.year > 0;
  3722. } }, { key: "set", value:
  3723. function set(date, flags, value) {
  3724. var currentYear = date.getFullYear();
  3725. if (value.isTwoDigitYear) {
  3726. var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
  3727. date.setFullYear(normalizedTwoDigitYear, 0, 1);
  3728. date.setHours(0, 0, 0, 0);
  3729. return date;
  3730. }
  3731. var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
  3732. date.setFullYear(year, 0, 1);
  3733. date.setHours(0, 0, 0, 0);
  3734. return date;
  3735. } }]);return YearParser;}(Parser);
  3736. // lib/parse/_lib/parsers/LocalWeekYearParser.js
  3737. var LocalWeekYearParser = /*#__PURE__*/function (_Parser3) {_inherits(LocalWeekYearParser, _Parser3);function LocalWeekYearParser() {var _this5;_classCallCheck(this, LocalWeekYearParser);for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}_this5 = _callSuper(this, LocalWeekYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this5), "priority",
  3738. 130);_defineProperty(_assertThisInitialized(_this5), "incompatibleTokens",
  3739. [
  3740. "y",
  3741. "R",
  3742. "u",
  3743. "Q",
  3744. "q",
  3745. "M",
  3746. "L",
  3747. "I",
  3748. "d",
  3749. "D",
  3750. "i",
  3751. "t",
  3752. "T"]);return _this5;}_createClass(LocalWeekYearParser, [{ key: "parse", value: function parse(dateString, token, match3) {var valueCallback = function valueCallback(year) {return { year: year, isTwoDigitYear: token === "YY" };};switch (token) {case "Y":return mapValue(parseNDigits(4, dateString), valueCallback);case "Yo":return mapValue(match3.ordinalNumber(dateString, { unit: "year" }), valueCallback);default:return mapValue(parseNDigits(token.length, dateString), valueCallback);}} }, { key: "validate", value: function validate(_date, value) {return value.isTwoDigitYear || value.year > 0;} }, { key: "set", value: function set(date, flags, value, options) {var currentYear = getWeekYear(date, options);if (value.isTwoDigitYear) {var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);date.setFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);date.setHours(0, 0, 0, 0);return startOfWeek(date, options);}var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;date.setFullYear(year, 0, options.firstWeekContainsDate);date.setHours(0, 0, 0, 0);return startOfWeek(date, options);} }]);return LocalWeekYearParser;}(Parser);
  3753. // lib/parse/_lib/parsers/ISOWeekYearParser.js
  3754. var ISOWeekYearParser = /*#__PURE__*/function (_Parser4) {_inherits(ISOWeekYearParser, _Parser4);function ISOWeekYearParser() {var _this6;_classCallCheck(this, ISOWeekYearParser);for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}_this6 = _callSuper(this, ISOWeekYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this6), "priority",
  3755. 130);_defineProperty(_assertThisInitialized(_this6), "incompatibleTokens",
  3756. [
  3757. "G",
  3758. "y",
  3759. "Y",
  3760. "u",
  3761. "Q",
  3762. "q",
  3763. "M",
  3764. "L",
  3765. "w",
  3766. "d",
  3767. "D",
  3768. "e",
  3769. "c",
  3770. "t",
  3771. "T"]);return _this6;}_createClass(ISOWeekYearParser, [{ key: "parse", value: function parse(dateString, token) {if (token === "R") {return parseNDigitsSigned(4, dateString);}return parseNDigitsSigned(token.length, dateString);} }, { key: "set", value: function set(date, _flags, value) {var firstWeekOfYear = constructFrom(date, 0);firstWeekOfYear.setFullYear(value, 0, 4);firstWeekOfYear.setHours(0, 0, 0, 0);return startOfISOWeek(firstWeekOfYear);} }]);return ISOWeekYearParser;}(Parser);
  3772. // lib/parse/_lib/parsers/ExtendedYearParser.js
  3773. var ExtendedYearParser = /*#__PURE__*/function (_Parser5) {_inherits(ExtendedYearParser, _Parser5);function ExtendedYearParser() {var _this7;_classCallCheck(this, ExtendedYearParser);for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}_this7 = _callSuper(this, ExtendedYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this7), "priority",
  3774. 130);_defineProperty(_assertThisInitialized(_this7), "incompatibleTokens",
  3775. ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);return _this7;}_createClass(ExtendedYearParser, [{ key: "parse", value: function parse(dateString, token) {if (token === "u") {return parseNDigitsSigned(4, dateString);}return parseNDigitsSigned(token.length, dateString);} }, { key: "set", value: function set(date, _flags, value) {date.setFullYear(value, 0, 1);date.setHours(0, 0, 0, 0);return date;} }]);return ExtendedYearParser;}(Parser);
  3776. // lib/parse/_lib/parsers/QuarterParser.js
  3777. var QuarterParser = /*#__PURE__*/function (_Parser6) {_inherits(QuarterParser, _Parser6);function QuarterParser() {var _this8;_classCallCheck(this, QuarterParser);for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}_this8 = _callSuper(this, QuarterParser, [].concat(args));_defineProperty(_assertThisInitialized(_this8), "priority",
  3778. 120);_defineProperty(_assertThisInitialized(_this8), "incompatibleTokens",
  3779. [
  3780. "Y",
  3781. "R",
  3782. "q",
  3783. "M",
  3784. "L",
  3785. "w",
  3786. "I",
  3787. "d",
  3788. "D",
  3789. "i",
  3790. "e",
  3791. "c",
  3792. "t",
  3793. "T"]);return _this8;}_createClass(QuarterParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "Q":case "QQ":return parseNDigits(token.length, dateString);case "Qo":return match3.ordinalNumber(dateString, { unit: "quarter" });case "QQQ":return match3.quarter(dateString, { width: "abbreviated", context: "formatting" }) || match3.quarter(dateString, { width: "narrow", context: "formatting" });case "QQQQQ":return match3.quarter(dateString, { width: "narrow", context: "formatting" });case "QQQQ":default:return match3.quarter(dateString, { width: "wide", context: "formatting" }) || match3.quarter(dateString, { width: "abbreviated", context: "formatting" }) || match3.quarter(dateString, { width: "narrow", context: "formatting" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 4;} }, { key: "set", value: function set(date, _flags, value) {date.setMonth((value - 1) * 3, 1);date.setHours(0, 0, 0, 0);return date;} }]);return QuarterParser;}(Parser);
  3794. // lib/parse/_lib/parsers/StandAloneQuarterParser.js
  3795. var StandAloneQuarterParser = /*#__PURE__*/function (_Parser7) {_inherits(StandAloneQuarterParser, _Parser7);function StandAloneQuarterParser() {var _this9;_classCallCheck(this, StandAloneQuarterParser);for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {args[_key9] = arguments[_key9];}_this9 = _callSuper(this, StandAloneQuarterParser, [].concat(args));_defineProperty(_assertThisInitialized(_this9), "priority",
  3796. 120);_defineProperty(_assertThisInitialized(_this9), "incompatibleTokens",
  3797. [
  3798. "Y",
  3799. "R",
  3800. "Q",
  3801. "M",
  3802. "L",
  3803. "w",
  3804. "I",
  3805. "d",
  3806. "D",
  3807. "i",
  3808. "e",
  3809. "c",
  3810. "t",
  3811. "T"]);return _this9;}_createClass(StandAloneQuarterParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "q":case "qq":return parseNDigits(token.length, dateString);case "qo":return match3.ordinalNumber(dateString, { unit: "quarter" });case "qqq":return match3.quarter(dateString, { width: "abbreviated", context: "standalone" }) || match3.quarter(dateString, { width: "narrow", context: "standalone" });case "qqqqq":return match3.quarter(dateString, { width: "narrow", context: "standalone" });case "qqqq":default:return match3.quarter(dateString, { width: "wide", context: "standalone" }) || match3.quarter(dateString, { width: "abbreviated", context: "standalone" }) || match3.quarter(dateString, { width: "narrow", context: "standalone" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 4;} }, { key: "set", value: function set(date, _flags, value) {date.setMonth((value - 1) * 3, 1);date.setHours(0, 0, 0, 0);return date;} }]);return StandAloneQuarterParser;}(Parser);
  3812. // lib/parse/_lib/parsers/MonthParser.js
  3813. var MonthParser = /*#__PURE__*/function (_Parser8) {_inherits(MonthParser, _Parser8);function MonthParser() {var _this10;_classCallCheck(this, MonthParser);for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {args[_key10] = arguments[_key10];}_this10 = _callSuper(this, MonthParser, [].concat(args));_defineProperty(_assertThisInitialized(_this10), "incompatibleTokens",
  3814. [
  3815. "Y",
  3816. "R",
  3817. "q",
  3818. "Q",
  3819. "L",
  3820. "w",
  3821. "I",
  3822. "D",
  3823. "i",
  3824. "e",
  3825. "c",
  3826. "t",
  3827. "T"]);_defineProperty(_assertThisInitialized(_this10), "priority",
  3828. 110);return _this10;}_createClass(MonthParser, [{ key: "parse", value:
  3829. function parse(dateString, token, match3) {
  3830. var valueCallback = function valueCallback(value) {return value - 1;};
  3831. switch (token) {
  3832. case "M":
  3833. return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
  3834. case "MM":
  3835. return mapValue(parseNDigits(2, dateString), valueCallback);
  3836. case "Mo":
  3837. return mapValue(match3.ordinalNumber(dateString, {
  3838. unit: "month"
  3839. }), valueCallback);
  3840. case "MMM":
  3841. return match3.month(dateString, {
  3842. width: "abbreviated",
  3843. context: "formatting"
  3844. }) || match3.month(dateString, { width: "narrow", context: "formatting" });
  3845. case "MMMMM":
  3846. return match3.month(dateString, {
  3847. width: "narrow",
  3848. context: "formatting"
  3849. });
  3850. case "MMMM":
  3851. default:
  3852. return match3.month(dateString, { width: "wide", context: "formatting" }) || match3.month(dateString, {
  3853. width: "abbreviated",
  3854. context: "formatting"
  3855. }) || match3.month(dateString, { width: "narrow", context: "formatting" });
  3856. }
  3857. } }, { key: "validate", value:
  3858. function validate(_date, value) {
  3859. return value >= 0 && value <= 11;
  3860. } }, { key: "set", value:
  3861. function set(date, _flags, value) {
  3862. date.setMonth(value, 1);
  3863. date.setHours(0, 0, 0, 0);
  3864. return date;
  3865. } }]);return MonthParser;}(Parser);
  3866. // lib/parse/_lib/parsers/StandAloneMonthParser.js
  3867. var StandAloneMonthParser = /*#__PURE__*/function (_Parser9) {_inherits(StandAloneMonthParser, _Parser9);function StandAloneMonthParser() {var _this11;_classCallCheck(this, StandAloneMonthParser);for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {args[_key11] = arguments[_key11];}_this11 = _callSuper(this, StandAloneMonthParser, [].concat(args));_defineProperty(_assertThisInitialized(_this11), "priority",
  3868. 110);_defineProperty(_assertThisInitialized(_this11), "incompatibleTokens",
  3869. [
  3870. "Y",
  3871. "R",
  3872. "q",
  3873. "Q",
  3874. "M",
  3875. "w",
  3876. "I",
  3877. "D",
  3878. "i",
  3879. "e",
  3880. "c",
  3881. "t",
  3882. "T"]);return _this11;}_createClass(StandAloneMonthParser, [{ key: "parse", value: function parse(dateString, token, match3) {var valueCallback = function valueCallback(value) {return value - 1;};switch (token) {case "L":return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);case "LL":return mapValue(parseNDigits(2, dateString), valueCallback);case "Lo":return mapValue(match3.ordinalNumber(dateString, { unit: "month" }), valueCallback);case "LLL":return match3.month(dateString, { width: "abbreviated", context: "standalone" }) || match3.month(dateString, { width: "narrow", context: "standalone" });case "LLLLL":return match3.month(dateString, { width: "narrow", context: "standalone" });case "LLLL":default:return match3.month(dateString, { width: "wide", context: "standalone" }) || match3.month(dateString, { width: "abbreviated", context: "standalone" }) || match3.month(dateString, { width: "narrow", context: "standalone" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 11;} }, { key: "set", value: function set(date, _flags, value) {date.setMonth(value, 1);date.setHours(0, 0, 0, 0);return date;} }]);return StandAloneMonthParser;}(Parser);
  3883. // lib/setWeek.js
  3884. function setWeek(date, week, options) {
  3885. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3886. var diff = getWeek(date_, options) - week;
  3887. date_.setDate(date_.getDate() - diff * 7);
  3888. return toDate(date_, options === null || options === void 0 ? void 0 : options.in);
  3889. }
  3890. // lib/parse/_lib/parsers/LocalWeekParser.js
  3891. var LocalWeekParser = /*#__PURE__*/function (_Parser10) {_inherits(LocalWeekParser, _Parser10);function LocalWeekParser() {var _this12;_classCallCheck(this, LocalWeekParser);for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {args[_key12] = arguments[_key12];}_this12 = _callSuper(this, LocalWeekParser, [].concat(args));_defineProperty(_assertThisInitialized(_this12), "priority",
  3892. 100);_defineProperty(_assertThisInitialized(_this12), "incompatibleTokens",
  3893. [
  3894. "y",
  3895. "R",
  3896. "u",
  3897. "q",
  3898. "Q",
  3899. "M",
  3900. "L",
  3901. "I",
  3902. "d",
  3903. "D",
  3904. "i",
  3905. "t",
  3906. "T"]);return _this12;}_createClass(LocalWeekParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "w":return parseNumericPattern(numericPatterns.week, dateString);case "wo":return match3.ordinalNumber(dateString, { unit: "week" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 53;} }, { key: "set", value: function set(date, _flags, value, options) {return startOfWeek(setWeek(date, value, options), options);} }]);return LocalWeekParser;}(Parser);
  3907. // lib/setISOWeek.js
  3908. function setISOWeek(date, week, options) {
  3909. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3910. var diff = getISOWeek(_date, options) - week;
  3911. _date.setDate(_date.getDate() - diff * 7);
  3912. return _date;
  3913. }
  3914. // lib/parse/_lib/parsers/ISOWeekParser.js
  3915. var ISOWeekParser = /*#__PURE__*/function (_Parser11) {_inherits(ISOWeekParser, _Parser11);function ISOWeekParser() {var _this13;_classCallCheck(this, ISOWeekParser);for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {args[_key13] = arguments[_key13];}_this13 = _callSuper(this, ISOWeekParser, [].concat(args));_defineProperty(_assertThisInitialized(_this13), "priority",
  3916. 100);_defineProperty(_assertThisInitialized(_this13), "incompatibleTokens",
  3917. [
  3918. "y",
  3919. "Y",
  3920. "u",
  3921. "q",
  3922. "Q",
  3923. "M",
  3924. "L",
  3925. "w",
  3926. "d",
  3927. "D",
  3928. "e",
  3929. "c",
  3930. "t",
  3931. "T"]);return _this13;}_createClass(ISOWeekParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "I":return parseNumericPattern(numericPatterns.week, dateString);case "Io":return match3.ordinalNumber(dateString, { unit: "week" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 53;} }, { key: "set", value: function set(date, _flags, value) {return startOfISOWeek(setISOWeek(date, value));} }]);return ISOWeekParser;}(Parser);
  3932. // lib/parse/_lib/parsers/DateParser.js
  3933. var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  3934. var DAYS_IN_MONTH_LEAP_YEAR = [
  3935. 31,
  3936. 29,
  3937. 31,
  3938. 30,
  3939. 31,
  3940. 30,
  3941. 31,
  3942. 31,
  3943. 30,
  3944. 31,
  3945. 30,
  3946. 31];var
  3947. DateParser = /*#__PURE__*/function (_Parser12) {_inherits(DateParser, _Parser12);function DateParser() {var _this14;_classCallCheck(this, DateParser);for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {args[_key14] = arguments[_key14];}_this14 = _callSuper(this, DateParser, [].concat(args));_defineProperty(_assertThisInitialized(_this14), "priority",
  3948. 90);_defineProperty(_assertThisInitialized(_this14), "subPriority",
  3949. 1);_defineProperty(_assertThisInitialized(_this14), "incompatibleTokens",
  3950. [
  3951. "Y",
  3952. "R",
  3953. "q",
  3954. "Q",
  3955. "w",
  3956. "I",
  3957. "D",
  3958. "i",
  3959. "e",
  3960. "c",
  3961. "t",
  3962. "T"]);return _this14;}_createClass(DateParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "d":return parseNumericPattern(numericPatterns.date, dateString);case "do":return match3.ordinalNumber(dateString, { unit: "date" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(date, value) {var year = date.getFullYear();var isLeapYear6 = isLeapYearIndex(year);var month = date.getMonth();if (isLeapYear6) {return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];} else {return value >= 1 && value <= DAYS_IN_MONTH[month];}} }, { key: "set", value: function set(date, _flags, value) {date.setDate(value);date.setHours(0, 0, 0, 0);return date;} }]);return DateParser;}(Parser);
  3963. // lib/parse/_lib/parsers/DayOfYearParser.js
  3964. var DayOfYearParser = /*#__PURE__*/function (_Parser13) {_inherits(DayOfYearParser, _Parser13);function DayOfYearParser() {var _this15;_classCallCheck(this, DayOfYearParser);for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {args[_key15] = arguments[_key15];}_this15 = _callSuper(this, DayOfYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this15), "priority",
  3965. 90);_defineProperty(_assertThisInitialized(_this15), "subpriority",
  3966. 1);_defineProperty(_assertThisInitialized(_this15), "incompatibleTokens",
  3967. [
  3968. "Y",
  3969. "R",
  3970. "q",
  3971. "Q",
  3972. "M",
  3973. "L",
  3974. "w",
  3975. "I",
  3976. "d",
  3977. "E",
  3978. "i",
  3979. "e",
  3980. "c",
  3981. "t",
  3982. "T"]);return _this15;}_createClass(DayOfYearParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "D":case "DD":return parseNumericPattern(numericPatterns.dayOfYear, dateString);case "Do":return match3.ordinalNumber(dateString, { unit: "date" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(date, value) {var year = date.getFullYear();var isLeapYear6 = isLeapYearIndex(year);if (isLeapYear6) {return value >= 1 && value <= 366;} else {return value >= 1 && value <= 365;}} }, { key: "set", value: function set(date, _flags, value) {date.setMonth(0, value);date.setHours(0, 0, 0, 0);return date;} }]);return DayOfYearParser;}(Parser);
  3983. // lib/setDay.js
  3984. function setDay(date, day, options) {var _ref30, _ref31, _ref32, _options$weekStartsOn6, _options$locale14, _defaultOptions14$loc;
  3985. var defaultOptions14 = getDefaultOptions();
  3986. var weekStartsOn = (_ref30 = (_ref31 = (_ref32 = (_options$weekStartsOn6 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn6 !== void 0 ? _options$weekStartsOn6 : options === null || options === void 0 || (_options$locale14 = options.locale) === null || _options$locale14 === void 0 || (_options$locale14 = _options$locale14.options) === null || _options$locale14 === void 0 ? void 0 : _options$locale14.weekStartsOn) !== null && _ref32 !== void 0 ? _ref32 : defaultOptions14.weekStartsOn) !== null && _ref31 !== void 0 ? _ref31 : (_defaultOptions14$loc = defaultOptions14.locale) === null || _defaultOptions14$loc === void 0 || (_defaultOptions14$loc = _defaultOptions14$loc.options) === null || _defaultOptions14$loc === void 0 ? void 0 : _defaultOptions14$loc.weekStartsOn) !== null && _ref30 !== void 0 ? _ref30 : 0;
  3987. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  3988. var currentDay = date_.getDay();
  3989. var remainder = day % 7;
  3990. var dayIndex = (remainder + 7) % 7;
  3991. var delta = 7 - weekStartsOn;
  3992. var diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;
  3993. return addDays(date_, diff, options);
  3994. }
  3995. // lib/parse/_lib/parsers/DayParser.js
  3996. var DayParser = /*#__PURE__*/function (_Parser14) {_inherits(DayParser, _Parser14);function DayParser() {var _this16;_classCallCheck(this, DayParser);for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {args[_key16] = arguments[_key16];}_this16 = _callSuper(this, DayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this16), "priority",
  3997. 90);_defineProperty(_assertThisInitialized(_this16), "incompatibleTokens",
  3998. ["D", "i", "e", "c", "t", "T"]);return _this16;}_createClass(DayParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "E":case "EE":case "EEE":return match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "EEEEE":return match3.day(dateString, { width: "narrow", context: "formatting" });case "EEEEEE":return match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "EEEE":default:return match3.day(dateString, { width: "wide", context: "formatting" }) || match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 6;} }, { key: "set", value: function set(date, _flags, value, options) {date = setDay(date, value, options);date.setHours(0, 0, 0, 0);return date;} }]);return DayParser;}(Parser);
  3999. // lib/parse/_lib/parsers/LocalDayParser.js
  4000. var LocalDayParser = /*#__PURE__*/function (_Parser15) {_inherits(LocalDayParser, _Parser15);function LocalDayParser() {var _this17;_classCallCheck(this, LocalDayParser);for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {args[_key17] = arguments[_key17];}_this17 = _callSuper(this, LocalDayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this17), "priority",
  4001. 90);_defineProperty(_assertThisInitialized(_this17), "incompatibleTokens",
  4002. [
  4003. "y",
  4004. "R",
  4005. "u",
  4006. "q",
  4007. "Q",
  4008. "M",
  4009. "L",
  4010. "I",
  4011. "d",
  4012. "D",
  4013. "E",
  4014. "i",
  4015. "c",
  4016. "t",
  4017. "T"]);return _this17;}_createClass(LocalDayParser, [{ key: "parse", value: function parse(dateString, token, match3, options) {var valueCallback = function valueCallback(value) {var wholeWeekDays = Math.floor((value - 1) / 7) * 7;return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;};switch (token) {case "e":case "ee":return mapValue(parseNDigits(token.length, dateString), valueCallback);case "eo":return mapValue(match3.ordinalNumber(dateString, { unit: "day" }), valueCallback);case "eee":return match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "eeeee":return match3.day(dateString, { width: "narrow", context: "formatting" });case "eeeeee":return match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "eeee":default:return match3.day(dateString, { width: "wide", context: "formatting" }) || match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 6;} }, { key: "set", value: function set(date, _flags, value, options) {date = setDay(date, value, options);date.setHours(0, 0, 0, 0);return date;} }]);return LocalDayParser;}(Parser);
  4018. // lib/parse/_lib/parsers/StandAloneLocalDayParser.js
  4019. var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser16) {_inherits(StandAloneLocalDayParser, _Parser16);function StandAloneLocalDayParser() {var _this18;_classCallCheck(this, StandAloneLocalDayParser);for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {args[_key18] = arguments[_key18];}_this18 = _callSuper(this, StandAloneLocalDayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this18), "priority",
  4020. 90);_defineProperty(_assertThisInitialized(_this18), "incompatibleTokens",
  4021. [
  4022. "y",
  4023. "R",
  4024. "u",
  4025. "q",
  4026. "Q",
  4027. "M",
  4028. "L",
  4029. "I",
  4030. "d",
  4031. "D",
  4032. "E",
  4033. "i",
  4034. "e",
  4035. "t",
  4036. "T"]);return _this18;}_createClass(StandAloneLocalDayParser, [{ key: "parse", value: function parse(dateString, token, match3, options) {var valueCallback = function valueCallback(value) {var wholeWeekDays = Math.floor((value - 1) / 7) * 7;return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;};switch (token) {case "c":case "cc":return mapValue(parseNDigits(token.length, dateString), valueCallback);case "co":return mapValue(match3.ordinalNumber(dateString, { unit: "day" }), valueCallback);case "ccc":return match3.day(dateString, { width: "abbreviated", context: "standalone" }) || match3.day(dateString, { width: "short", context: "standalone" }) || match3.day(dateString, { width: "narrow", context: "standalone" });case "ccccc":return match3.day(dateString, { width: "narrow", context: "standalone" });case "cccccc":return match3.day(dateString, { width: "short", context: "standalone" }) || match3.day(dateString, { width: "narrow", context: "standalone" });case "cccc":default:return match3.day(dateString, { width: "wide", context: "standalone" }) || match3.day(dateString, { width: "abbreviated", context: "standalone" }) || match3.day(dateString, { width: "short", context: "standalone" }) || match3.day(dateString, { width: "narrow", context: "standalone" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 6;} }, { key: "set", value: function set(date, _flags, value, options) {date = setDay(date, value, options);date.setHours(0, 0, 0, 0);return date;} }]);return StandAloneLocalDayParser;}(Parser);
  4037. // lib/setISODay.js
  4038. function setISODay(date, day, options) {
  4039. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4040. var currentDay = getISODay(date_, options);
  4041. var diff = day - currentDay;
  4042. return addDays(date_, diff, options);
  4043. }
  4044. // lib/parse/_lib/parsers/ISODayParser.js
  4045. var ISODayParser = /*#__PURE__*/function (_Parser17) {_inherits(ISODayParser, _Parser17);function ISODayParser() {var _this19;_classCallCheck(this, ISODayParser);for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {args[_key19] = arguments[_key19];}_this19 = _callSuper(this, ISODayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this19), "priority",
  4046. 90);_defineProperty(_assertThisInitialized(_this19), "incompatibleTokens",
  4047. [
  4048. "y",
  4049. "Y",
  4050. "u",
  4051. "q",
  4052. "Q",
  4053. "M",
  4054. "L",
  4055. "w",
  4056. "d",
  4057. "D",
  4058. "E",
  4059. "e",
  4060. "c",
  4061. "t",
  4062. "T"]);return _this19;}_createClass(ISODayParser, [{ key: "parse", value: function parse(dateString, token, match3) {var valueCallback = function valueCallback(value) {if (value === 0) {return 7;}return value;};switch (token) {case "i":case "ii":return parseNDigits(token.length, dateString);case "io":return match3.ordinalNumber(dateString, { unit: "day" });case "iii":return mapValue(match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);case "iiiii":return mapValue(match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);case "iiiiii":return mapValue(match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);case "iiii":default:return mapValue(match3.day(dateString, { width: "wide", context: "formatting" }) || match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 7;} }, { key: "set", value: function set(date, _flags, value) {date = setISODay(date, value);date.setHours(0, 0, 0, 0);return date;} }]);return ISODayParser;}(Parser);
  4063. // lib/parse/_lib/parsers/AMPMParser.js
  4064. var AMPMParser = /*#__PURE__*/function (_Parser18) {_inherits(AMPMParser, _Parser18);function AMPMParser() {var _this20;_classCallCheck(this, AMPMParser);for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {args[_key20] = arguments[_key20];}_this20 = _callSuper(this, AMPMParser, [].concat(args));_defineProperty(_assertThisInitialized(_this20), "priority",
  4065. 80);_defineProperty(_assertThisInitialized(_this20), "incompatibleTokens",
  4066. ["b", "B", "H", "k", "t", "T"]);return _this20;}_createClass(AMPMParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "a":case "aa":case "aaa":return match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "aaaaa":return match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "aaaa":default:return match3.dayPeriod(dateString, { width: "wide", context: "formatting" }) || match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });}} }, { key: "set", value: function set(date, _flags, value) {date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);return date;} }]);return AMPMParser;}(Parser);
  4067. // lib/parse/_lib/parsers/AMPMMidnightParser.js
  4068. var AMPMMidnightParser = /*#__PURE__*/function (_Parser19) {_inherits(AMPMMidnightParser, _Parser19);function AMPMMidnightParser() {var _this21;_classCallCheck(this, AMPMMidnightParser);for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {args[_key21] = arguments[_key21];}_this21 = _callSuper(this, AMPMMidnightParser, [].concat(args));_defineProperty(_assertThisInitialized(_this21), "priority",
  4069. 80);_defineProperty(_assertThisInitialized(_this21), "incompatibleTokens",
  4070. ["a", "B", "H", "k", "t", "T"]);return _this21;}_createClass(AMPMMidnightParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "b":case "bb":case "bbb":return match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "bbbbb":return match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "bbbb":default:return match3.dayPeriod(dateString, { width: "wide", context: "formatting" }) || match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });}} }, { key: "set", value: function set(date, _flags, value) {date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);return date;} }]);return AMPMMidnightParser;}(Parser);
  4071. // lib/parse/_lib/parsers/DayPeriodParser.js
  4072. var DayPeriodParser = /*#__PURE__*/function (_Parser20) {_inherits(DayPeriodParser, _Parser20);function DayPeriodParser() {var _this22;_classCallCheck(this, DayPeriodParser);for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {args[_key22] = arguments[_key22];}_this22 = _callSuper(this, DayPeriodParser, [].concat(args));_defineProperty(_assertThisInitialized(_this22), "priority",
  4073. 80);_defineProperty(_assertThisInitialized(_this22), "incompatibleTokens",
  4074. ["a", "b", "t", "T"]);return _this22;}_createClass(DayPeriodParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "B":case "BB":case "BBB":return match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "BBBBB":return match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "BBBB":default:return match3.dayPeriod(dateString, { width: "wide", context: "formatting" }) || match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });}} }, { key: "set", value: function set(date, _flags, value) {date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);return date;} }]);return DayPeriodParser;}(Parser);
  4075. // lib/parse/_lib/parsers/Hour1to12Parser.js
  4076. var Hour1to12Parser = /*#__PURE__*/function (_Parser21) {_inherits(Hour1to12Parser, _Parser21);function Hour1to12Parser() {var _this23;_classCallCheck(this, Hour1to12Parser);for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {args[_key23] = arguments[_key23];}_this23 = _callSuper(this, Hour1to12Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this23), "priority",
  4077. 70);_defineProperty(_assertThisInitialized(_this23), "incompatibleTokens",
  4078. ["H", "K", "k", "t", "T"]);return _this23;}_createClass(Hour1to12Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "h":return parseNumericPattern(numericPatterns.hour12h, dateString);case "ho":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 12;} }, { key: "set", value: function set(date, _flags, value) {var isPM = date.getHours() >= 12;if (isPM && value < 12) {date.setHours(value + 12, 0, 0, 0);} else if (!isPM && value === 12) {date.setHours(0, 0, 0, 0);} else {date.setHours(value, 0, 0, 0);}return date;} }]);return Hour1to12Parser;}(Parser);
  4079. // lib/parse/_lib/parsers/Hour0to23Parser.js
  4080. var Hour0to23Parser = /*#__PURE__*/function (_Parser22) {_inherits(Hour0to23Parser, _Parser22);function Hour0to23Parser() {var _this24;_classCallCheck(this, Hour0to23Parser);for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {args[_key24] = arguments[_key24];}_this24 = _callSuper(this, Hour0to23Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this24), "priority",
  4081. 70);_defineProperty(_assertThisInitialized(_this24), "incompatibleTokens",
  4082. ["a", "b", "h", "K", "k", "t", "T"]);return _this24;}_createClass(Hour0to23Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "H":return parseNumericPattern(numericPatterns.hour23h, dateString);case "Ho":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 23;} }, { key: "set", value: function set(date, _flags, value) {date.setHours(value, 0, 0, 0);return date;} }]);return Hour0to23Parser;}(Parser);
  4083. // lib/parse/_lib/parsers/Hour0To11Parser.js
  4084. var Hour0To11Parser = /*#__PURE__*/function (_Parser23) {_inherits(Hour0To11Parser, _Parser23);function Hour0To11Parser() {var _this25;_classCallCheck(this, Hour0To11Parser);for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {args[_key25] = arguments[_key25];}_this25 = _callSuper(this, Hour0To11Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this25), "priority",
  4085. 70);_defineProperty(_assertThisInitialized(_this25), "incompatibleTokens",
  4086. ["h", "H", "k", "t", "T"]);return _this25;}_createClass(Hour0To11Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "K":return parseNumericPattern(numericPatterns.hour11h, dateString);case "Ko":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 11;} }, { key: "set", value: function set(date, _flags, value) {var isPM = date.getHours() >= 12;if (isPM && value < 12) {date.setHours(value + 12, 0, 0, 0);} else {date.setHours(value, 0, 0, 0);}return date;} }]);return Hour0To11Parser;}(Parser);
  4087. // lib/parse/_lib/parsers/Hour1To24Parser.js
  4088. var Hour1To24Parser = /*#__PURE__*/function (_Parser24) {_inherits(Hour1To24Parser, _Parser24);function Hour1To24Parser() {var _this26;_classCallCheck(this, Hour1To24Parser);for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {args[_key26] = arguments[_key26];}_this26 = _callSuper(this, Hour1To24Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this26), "priority",
  4089. 70);_defineProperty(_assertThisInitialized(_this26), "incompatibleTokens",
  4090. ["a", "b", "h", "H", "K", "t", "T"]);return _this26;}_createClass(Hour1To24Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "k":return parseNumericPattern(numericPatterns.hour24h, dateString);case "ko":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 24;} }, { key: "set", value: function set(date, _flags, value) {var hours = value <= 24 ? value % 24 : value;date.setHours(hours, 0, 0, 0);return date;} }]);return Hour1To24Parser;}(Parser);
  4091. // lib/parse/_lib/parsers/MinuteParser.js
  4092. var MinuteParser = /*#__PURE__*/function (_Parser25) {_inherits(MinuteParser, _Parser25);function MinuteParser() {var _this27;_classCallCheck(this, MinuteParser);for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {args[_key27] = arguments[_key27];}_this27 = _callSuper(this, MinuteParser, [].concat(args));_defineProperty(_assertThisInitialized(_this27), "priority",
  4093. 60);_defineProperty(_assertThisInitialized(_this27), "incompatibleTokens",
  4094. ["t", "T"]);return _this27;}_createClass(MinuteParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "m":return parseNumericPattern(numericPatterns.minute, dateString);case "mo":return match3.ordinalNumber(dateString, { unit: "minute" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 59;} }, { key: "set", value: function set(date, _flags, value) {date.setMinutes(value, 0, 0);return date;} }]);return MinuteParser;}(Parser);
  4095. // lib/parse/_lib/parsers/SecondParser.js
  4096. var SecondParser = /*#__PURE__*/function (_Parser26) {_inherits(SecondParser, _Parser26);function SecondParser() {var _this28;_classCallCheck(this, SecondParser);for (var _len28 = arguments.length, args = new Array(_len28), _key28 = 0; _key28 < _len28; _key28++) {args[_key28] = arguments[_key28];}_this28 = _callSuper(this, SecondParser, [].concat(args));_defineProperty(_assertThisInitialized(_this28), "priority",
  4097. 50);_defineProperty(_assertThisInitialized(_this28), "incompatibleTokens",
  4098. ["t", "T"]);return _this28;}_createClass(SecondParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "s":return parseNumericPattern(numericPatterns.second, dateString);case "so":return match3.ordinalNumber(dateString, { unit: "second" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 59;} }, { key: "set", value: function set(date, _flags, value) {date.setSeconds(value, 0);return date;} }]);return SecondParser;}(Parser);
  4099. // lib/parse/_lib/parsers/FractionOfSecondParser.js
  4100. var FractionOfSecondParser = /*#__PURE__*/function (_Parser27) {_inherits(FractionOfSecondParser, _Parser27);function FractionOfSecondParser() {var _this29;_classCallCheck(this, FractionOfSecondParser);for (var _len29 = arguments.length, args = new Array(_len29), _key29 = 0; _key29 < _len29; _key29++) {args[_key29] = arguments[_key29];}_this29 = _callSuper(this, FractionOfSecondParser, [].concat(args));_defineProperty(_assertThisInitialized(_this29), "priority",
  4101. 30);_defineProperty(_assertThisInitialized(_this29), "incompatibleTokens",
  4102. ["t", "T"]);return _this29;}_createClass(FractionOfSecondParser, [{ key: "parse", value: function parse(dateString, token) {var valueCallback = function valueCallback(value) {return Math.trunc(value * Math.pow(10, -token.length + 3));};return mapValue(parseNDigits(token.length, dateString), valueCallback);} }, { key: "set", value: function set(date, _flags, value) {date.setMilliseconds(value);return date;} }]);return FractionOfSecondParser;}(Parser);
  4103. // lib/parse/_lib/parsers/ISOTimezoneWithZParser.js
  4104. var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser28) {_inherits(ISOTimezoneWithZParser, _Parser28);function ISOTimezoneWithZParser() {var _this30;_classCallCheck(this, ISOTimezoneWithZParser);for (var _len30 = arguments.length, args = new Array(_len30), _key30 = 0; _key30 < _len30; _key30++) {args[_key30] = arguments[_key30];}_this30 = _callSuper(this, ISOTimezoneWithZParser, [].concat(args));_defineProperty(_assertThisInitialized(_this30), "priority",
  4105. 10);_defineProperty(_assertThisInitialized(_this30), "incompatibleTokens",
  4106. ["t", "T", "x"]);return _this30;}_createClass(ISOTimezoneWithZParser, [{ key: "parse", value: function parse(dateString, token) {switch (token) {case "X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);case "XX":return parseTimezonePattern(timezonePatterns.basic, dateString);case "XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);case "XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);case "XXX":default:return parseTimezonePattern(timezonePatterns.extended, dateString);}} }, { key: "set", value: function set(date, flags, value) {if (flags.timestampIsSet) return date;return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);} }]);return ISOTimezoneWithZParser;}(Parser);
  4107. // lib/parse/_lib/parsers/ISOTimezoneParser.js
  4108. var ISOTimezoneParser = /*#__PURE__*/function (_Parser29) {_inherits(ISOTimezoneParser, _Parser29);function ISOTimezoneParser() {var _this31;_classCallCheck(this, ISOTimezoneParser);for (var _len31 = arguments.length, args = new Array(_len31), _key31 = 0; _key31 < _len31; _key31++) {args[_key31] = arguments[_key31];}_this31 = _callSuper(this, ISOTimezoneParser, [].concat(args));_defineProperty(_assertThisInitialized(_this31), "priority",
  4109. 10);_defineProperty(_assertThisInitialized(_this31), "incompatibleTokens",
  4110. ["t", "T", "X"]);return _this31;}_createClass(ISOTimezoneParser, [{ key: "parse", value: function parse(dateString, token) {switch (token) {case "x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);case "xx":return parseTimezonePattern(timezonePatterns.basic, dateString);case "xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);case "xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);case "xxx":default:return parseTimezonePattern(timezonePatterns.extended, dateString);}} }, { key: "set", value: function set(date, flags, value) {if (flags.timestampIsSet) return date;return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);} }]);return ISOTimezoneParser;}(Parser);
  4111. // lib/parse/_lib/parsers/TimestampSecondsParser.js
  4112. var TimestampSecondsParser = /*#__PURE__*/function (_Parser30) {_inherits(TimestampSecondsParser, _Parser30);function TimestampSecondsParser() {var _this32;_classCallCheck(this, TimestampSecondsParser);for (var _len32 = arguments.length, args = new Array(_len32), _key32 = 0; _key32 < _len32; _key32++) {args[_key32] = arguments[_key32];}_this32 = _callSuper(this, TimestampSecondsParser, [].concat(args));_defineProperty(_assertThisInitialized(_this32), "priority",
  4113. 40);_defineProperty(_assertThisInitialized(_this32), "incompatibleTokens",
  4114. "*");return _this32;}_createClass(TimestampSecondsParser, [{ key: "parse", value: function parse(dateString) {return parseAnyDigitsSigned(dateString);} }, { key: "set", value: function set(date, _flags, value) {return [constructFrom(date, value * 1000), { timestampIsSet: true }];} }]);return TimestampSecondsParser;}(Parser);
  4115. // lib/parse/_lib/parsers/TimestampMillisecondsParser.js
  4116. var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser31) {_inherits(TimestampMillisecondsParser, _Parser31);function TimestampMillisecondsParser() {var _this33;_classCallCheck(this, TimestampMillisecondsParser);for (var _len33 = arguments.length, args = new Array(_len33), _key33 = 0; _key33 < _len33; _key33++) {args[_key33] = arguments[_key33];}_this33 = _callSuper(this, TimestampMillisecondsParser, [].concat(args));_defineProperty(_assertThisInitialized(_this33), "priority",
  4117. 20);_defineProperty(_assertThisInitialized(_this33), "incompatibleTokens",
  4118. "*");return _this33;}_createClass(TimestampMillisecondsParser, [{ key: "parse", value: function parse(dateString) {return parseAnyDigitsSigned(dateString);} }, { key: "set", value: function set(date, _flags, value) {return [constructFrom(date, value), { timestampIsSet: true }];} }]);return TimestampMillisecondsParser;}(Parser);
  4119. // lib/parse/_lib/parsers.js
  4120. var parsers = {
  4121. G: new EraParser(),
  4122. y: new YearParser(),
  4123. Y: new LocalWeekYearParser(),
  4124. R: new ISOWeekYearParser(),
  4125. u: new ExtendedYearParser(),
  4126. Q: new QuarterParser(),
  4127. q: new StandAloneQuarterParser(),
  4128. M: new MonthParser(),
  4129. L: new StandAloneMonthParser(),
  4130. w: new LocalWeekParser(),
  4131. I: new ISOWeekParser(),
  4132. d: new DateParser(),
  4133. D: new DayOfYearParser(),
  4134. E: new DayParser(),
  4135. e: new LocalDayParser(),
  4136. c: new StandAloneLocalDayParser(),
  4137. i: new ISODayParser(),
  4138. a: new AMPMParser(),
  4139. b: new AMPMMidnightParser(),
  4140. B: new DayPeriodParser(),
  4141. h: new Hour1to12Parser(),
  4142. H: new Hour0to23Parser(),
  4143. K: new Hour0To11Parser(),
  4144. k: new Hour1To24Parser(),
  4145. m: new MinuteParser(),
  4146. s: new SecondParser(),
  4147. S: new FractionOfSecondParser(),
  4148. X: new ISOTimezoneWithZParser(),
  4149. x: new ISOTimezoneParser(),
  4150. t: new TimestampSecondsParser(),
  4151. T: new TimestampMillisecondsParser()
  4152. };
  4153. // lib/parse.js
  4154. function parse(dateStr, formatStr, referenceDate, options) {var _ref33, _options$locale15, _ref34, _ref35, _ref36, _options$firstWeekCon4, _options$locale16, _defaultOptions14$loc2, _ref37, _ref38, _ref39, _options$weekStartsOn7, _options$locale17, _defaultOptions14$loc3;
  4155. var invalidDate = function invalidDate() {return constructFrom((options === null || options === void 0 ? void 0 : options.in) || referenceDate, NaN);};
  4156. var defaultOptions14 = getDefaultOptions2();
  4157. var locale = (_ref33 = (_options$locale15 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale15 !== void 0 ? _options$locale15 : defaultOptions14.locale) !== null && _ref33 !== void 0 ? _ref33 : enUS;
  4158. var firstWeekContainsDate = (_ref34 = (_ref35 = (_ref36 = (_options$firstWeekCon4 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon4 !== void 0 ? _options$firstWeekCon4 : options === null || options === void 0 || (_options$locale16 = options.locale) === null || _options$locale16 === void 0 || (_options$locale16 = _options$locale16.options) === null || _options$locale16 === void 0 ? void 0 : _options$locale16.firstWeekContainsDate) !== null && _ref36 !== void 0 ? _ref36 : defaultOptions14.firstWeekContainsDate) !== null && _ref35 !== void 0 ? _ref35 : (_defaultOptions14$loc2 = defaultOptions14.locale) === null || _defaultOptions14$loc2 === void 0 || (_defaultOptions14$loc2 = _defaultOptions14$loc2.options) === null || _defaultOptions14$loc2 === void 0 ? void 0 : _defaultOptions14$loc2.firstWeekContainsDate) !== null && _ref34 !== void 0 ? _ref34 : 1;
  4159. var weekStartsOn = (_ref37 = (_ref38 = (_ref39 = (_options$weekStartsOn7 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn7 !== void 0 ? _options$weekStartsOn7 : options === null || options === void 0 || (_options$locale17 = options.locale) === null || _options$locale17 === void 0 || (_options$locale17 = _options$locale17.options) === null || _options$locale17 === void 0 ? void 0 : _options$locale17.weekStartsOn) !== null && _ref39 !== void 0 ? _ref39 : defaultOptions14.weekStartsOn) !== null && _ref38 !== void 0 ? _ref38 : (_defaultOptions14$loc3 = defaultOptions14.locale) === null || _defaultOptions14$loc3 === void 0 || (_defaultOptions14$loc3 = _defaultOptions14$loc3.options) === null || _defaultOptions14$loc3 === void 0 ? void 0 : _defaultOptions14$loc3.weekStartsOn) !== null && _ref37 !== void 0 ? _ref37 : 0;
  4160. if (!formatStr)
  4161. return dateStr ? invalidDate() : toDate(referenceDate, options === null || options === void 0 ? void 0 : options.in);
  4162. var subFnOptions = {
  4163. firstWeekContainsDate: firstWeekContainsDate,
  4164. weekStartsOn: weekStartsOn,
  4165. locale: locale
  4166. };
  4167. var setters = [new DateTimezoneSetter(options === null || options === void 0 ? void 0 : options.in, referenceDate)];
  4168. var tokens = formatStr.match(longFormattingTokensRegExp2).map(function (substring) {
  4169. var firstCharacter = substring[0];
  4170. if (firstCharacter in longFormatters) {
  4171. var longFormatter = longFormatters[firstCharacter];
  4172. return longFormatter(substring, locale.formatLong);
  4173. }
  4174. return substring;
  4175. }).join("").match(formattingTokensRegExp2);
  4176. var usedTokens = [];var _iterator = _createForOfIteratorHelper(
  4177. tokens),_step;try {var _loop = function _loop() {var token = _step.value;
  4178. if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token)) {
  4179. warnOrThrowProtectedError(token, formatStr, dateStr);
  4180. }
  4181. if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) {
  4182. warnOrThrowProtectedError(token, formatStr, dateStr);
  4183. }
  4184. var firstCharacter = token[0];
  4185. var parser = parsers[firstCharacter];
  4186. if (parser) {
  4187. var incompatibleTokens = parser.incompatibleTokens;
  4188. if (Array.isArray(incompatibleTokens)) {
  4189. var incompatibleToken = usedTokens.find(function (usedToken) {return incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter;});
  4190. if (incompatibleToken) {
  4191. throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
  4192. }
  4193. } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
  4194. throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
  4195. }
  4196. usedTokens.push({ token: firstCharacter, fullToken: token });
  4197. var parseResult = parser.run(dateStr, token, locale.match, subFnOptions);
  4198. if (!parseResult) {return { v:
  4199. invalidDate() };
  4200. }
  4201. setters.push(parseResult.setter);
  4202. dateStr = parseResult.rest;
  4203. } else {
  4204. if (firstCharacter.match(unescapedLatinCharacterRegExp2)) {
  4205. throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
  4206. }
  4207. if (token === "''") {
  4208. token = "'";
  4209. } else if (firstCharacter === "'") {
  4210. token = cleanEscapedString2(token);
  4211. }
  4212. if (dateStr.indexOf(token) === 0) {
  4213. dateStr = dateStr.slice(token.length);
  4214. } else {return { v:
  4215. invalidDate() };
  4216. }
  4217. }
  4218. },_ret;for (_iterator.s(); !(_step = _iterator.n()).done;) {_ret = _loop();if (_ret) return _ret.v;}} catch (err) {_iterator.e(err);} finally {_iterator.f();}
  4219. if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {
  4220. return invalidDate();
  4221. }
  4222. var uniquePrioritySetters = setters.map(function (setter) {return setter.priority;}).sort(function (a, b) {return b - a;}).filter(function (priority, index, array) {return array.indexOf(priority) === index;}).map(function (priority) {return setters.filter(function (setter) {return setter.priority === priority;}).sort(function (a, b) {return b.subPriority - a.subPriority;});}).map(function (setterArray) {return setterArray[0];});
  4223. var date = toDate(referenceDate, options === null || options === void 0 ? void 0 : options.in);
  4224. if (isNaN(+date))
  4225. return invalidDate();
  4226. var flags = {};var _iterator2 = _createForOfIteratorHelper(
  4227. uniquePrioritySetters),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var setter = _step2.value;
  4228. if (!setter.validate(date, subFnOptions)) {
  4229. return invalidDate();
  4230. }
  4231. var result = setter.set(date, flags, subFnOptions);
  4232. if (Array.isArray(result)) {
  4233. date = result[0];
  4234. Object.assign(flags, result[1]);
  4235. } else {
  4236. date = result;
  4237. }
  4238. }} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}
  4239. return date;
  4240. }
  4241. function cleanEscapedString2(input) {
  4242. return input.match(escapedStringRegExp2)[1].replace(doubleQuoteRegExp2, "'");
  4243. }
  4244. var formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
  4245. var longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
  4246. var escapedStringRegExp2 = /^'([^]*?)'?$/;
  4247. var doubleQuoteRegExp2 = /''/g;
  4248. var notWhitespaceRegExp = /\S/;
  4249. var unescapedLatinCharacterRegExp2 = /[a-zA-Z]/;
  4250. // lib/isMatch.js
  4251. function isMatch(dateStr, formatStr, options) {
  4252. return isValid(parse(dateStr, formatStr, new Date(), options));
  4253. }
  4254. // lib/fp/isMatch.js
  4255. var isMatch3 = convertToFP(isMatch, 2);
  4256. // lib/fp/isMatchWithOptions.js
  4257. var _isMatchWithOptions = convertToFP(isMatch, 3);
  4258. // lib/isMonday.js
  4259. function isMonday(date, options) {
  4260. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 1;
  4261. }
  4262. // lib/fp/isMonday.js
  4263. var isMonday3 = convertToFP(isMonday, 1);
  4264. // lib/fp/isMondayWithOptions.js
  4265. var _isMondayWithOptions = convertToFP(isMonday, 2);
  4266. // lib/fp/isSameDay.js
  4267. var isSameDay4 = convertToFP(isSameDay, 2);
  4268. // lib/fp/isSameDayWithOptions.js
  4269. var _isSameDayWithOptions = convertToFP(isSameDay, 3);
  4270. // lib/startOfHour.js
  4271. function startOfHour(date, options) {
  4272. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4273. _date.setMinutes(0, 0, 0);
  4274. return _date;
  4275. }
  4276. // lib/isSameHour.js
  4277. function isSameHour(dateLeft, dateRight, options) {
  4278. var _normalizeDates45 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, dateLeft, dateRight),_normalizeDates46 = _slicedToArray(_normalizeDates45, 2),dateLeft_ = _normalizeDates46[0],dateRight_ = _normalizeDates46[1];
  4279. return +startOfHour(dateLeft_) === +startOfHour(dateRight_);
  4280. }
  4281. // lib/fp/isSameHour.js
  4282. var isSameHour3 = convertToFP(isSameHour, 2);
  4283. // lib/fp/isSameHourWithOptions.js
  4284. var _isSameHourWithOptions = convertToFP(isSameHour, 3);
  4285. // lib/isSameWeek.js
  4286. function isSameWeek(laterDate, earlierDate, options) {
  4287. var _normalizeDates47 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates48 = _slicedToArray(_normalizeDates47, 2),laterDate_ = _normalizeDates48[0],earlierDate_ = _normalizeDates48[1];
  4288. return +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options);
  4289. }
  4290. // lib/isSameISOWeek.js
  4291. function isSameISOWeek(laterDate, earlierDate, options) {
  4292. return isSameWeek(laterDate, earlierDate, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
  4293. }
  4294. // lib/fp/isSameISOWeek.js
  4295. var isSameISOWeek3 = convertToFP(isSameISOWeek, 2);
  4296. // lib/fp/isSameISOWeekWithOptions.js
  4297. var _isSameISOWeekWithOptions = convertToFP(isSameISOWeek, 3);
  4298. // lib/isSameISOWeekYear.js
  4299. function isSameISOWeekYear(laterDate, earlierDate, options) {
  4300. var _normalizeDates49 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates50 = _slicedToArray(_normalizeDates49, 2),laterDate_ = _normalizeDates50[0],earlierDate_ = _normalizeDates50[1];
  4301. return +startOfISOWeekYear(laterDate_) === +startOfISOWeekYear(earlierDate_);
  4302. }
  4303. // lib/fp/isSameISOWeekYear.js
  4304. var isSameISOWeekYear3 = convertToFP(isSameISOWeekYear, 2);
  4305. // lib/fp/isSameISOWeekYearWithOptions.js
  4306. var _isSameISOWeekYearWithOptions = convertToFP(isSameISOWeekYear, 3);
  4307. // lib/startOfMinute.js
  4308. function startOfMinute(date, options) {
  4309. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4310. date_.setSeconds(0, 0);
  4311. return date_;
  4312. }
  4313. // lib/isSameMinute.js
  4314. function isSameMinute(laterDate, earlierDate) {
  4315. return +startOfMinute(laterDate) === +startOfMinute(earlierDate);
  4316. }
  4317. // lib/fp/isSameMinute.js
  4318. var isSameMinute3 = convertToFP(isSameMinute, 2);
  4319. // lib/isSameMonth.js
  4320. function isSameMonth(laterDate, earlierDate, options) {
  4321. var _normalizeDates51 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates52 = _slicedToArray(_normalizeDates51, 2),laterDate_ = _normalizeDates52[0],earlierDate_ = _normalizeDates52[1];
  4322. return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();
  4323. }
  4324. // lib/fp/isSameMonth.js
  4325. var isSameMonth3 = convertToFP(isSameMonth, 2);
  4326. // lib/fp/isSameMonthWithOptions.js
  4327. var _isSameMonthWithOptions = convertToFP(isSameMonth, 3);
  4328. // lib/isSameQuarter.js
  4329. function isSameQuarter(laterDate, earlierDate, options) {
  4330. var _normalizeDates53 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates54 = _slicedToArray(_normalizeDates53, 2),dateLeft_ = _normalizeDates54[0],dateRight_ = _normalizeDates54[1];
  4331. return +startOfQuarter(dateLeft_) === +startOfQuarter(dateRight_);
  4332. }
  4333. // lib/fp/isSameQuarter.js
  4334. var isSameQuarter3 = convertToFP(isSameQuarter, 2);
  4335. // lib/fp/isSameQuarterWithOptions.js
  4336. var _isSameQuarterWithOptions = convertToFP(isSameQuarter, 3);
  4337. // lib/startOfSecond.js
  4338. function startOfSecond(date, options) {
  4339. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4340. date_.setMilliseconds(0);
  4341. return date_;
  4342. }
  4343. // lib/isSameSecond.js
  4344. function isSameSecond(laterDate, earlierDate) {
  4345. return +startOfSecond(laterDate) === +startOfSecond(earlierDate);
  4346. }
  4347. // lib/fp/isSameSecond.js
  4348. var isSameSecond3 = convertToFP(isSameSecond, 2);
  4349. // lib/fp/isSameWeek.js
  4350. var isSameWeek4 = convertToFP(isSameWeek, 2);
  4351. // lib/fp/isSameWeekWithOptions.js
  4352. var _isSameWeekWithOptions = convertToFP(isSameWeek, 3);
  4353. // lib/isSameYear.js
  4354. function isSameYear(laterDate, earlierDate, options) {
  4355. var _normalizeDates55 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates56 = _slicedToArray(_normalizeDates55, 2),laterDate_ = _normalizeDates56[0],earlierDate_ = _normalizeDates56[1];
  4356. return laterDate_.getFullYear() === earlierDate_.getFullYear();
  4357. }
  4358. // lib/fp/isSameYear.js
  4359. var isSameYear3 = convertToFP(isSameYear, 2);
  4360. // lib/fp/isSameYearWithOptions.js
  4361. var _isSameYearWithOptions = convertToFP(isSameYear, 3);
  4362. // lib/fp/isSaturday.js
  4363. var isSaturday4 = convertToFP(isSaturday, 1);
  4364. // lib/fp/isSaturdayWithOptions.js
  4365. var _isSaturdayWithOptions = convertToFP(isSaturday, 2);
  4366. // lib/fp/isSunday.js
  4367. var isSunday4 = convertToFP(isSunday, 1);
  4368. // lib/fp/isSundayWithOptions.js
  4369. var _isSundayWithOptions = convertToFP(isSunday, 2);
  4370. // lib/isThursday.js
  4371. function isThursday(date, options) {
  4372. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 4;
  4373. }
  4374. // lib/fp/isThursday.js
  4375. var isThursday3 = convertToFP(isThursday, 1);
  4376. // lib/fp/isThursdayWithOptions.js
  4377. var _isThursdayWithOptions = convertToFP(isThursday, 2);
  4378. // lib/isTuesday.js
  4379. function isTuesday(date, options) {
  4380. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 2;
  4381. }
  4382. // lib/fp/isTuesday.js
  4383. var isTuesday3 = convertToFP(isTuesday, 1);
  4384. // lib/fp/isTuesdayWithOptions.js
  4385. var _isTuesdayWithOptions = convertToFP(isTuesday, 2);
  4386. // lib/fp/isValid.js
  4387. var isValid9 = convertToFP(isValid, 1);
  4388. // lib/isWednesday.js
  4389. function isWednesday(date, options) {
  4390. return toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 3;
  4391. }
  4392. // lib/fp/isWednesday.js
  4393. var isWednesday3 = convertToFP(isWednesday, 1);
  4394. // lib/fp/isWednesdayWithOptions.js
  4395. var _isWednesdayWithOptions = convertToFP(isWednesday, 2);
  4396. // lib/fp/isWeekend.js
  4397. var isWeekend6 = convertToFP(isWeekend, 1);
  4398. // lib/fp/isWeekendWithOptions.js
  4399. var _isWeekendWithOptions = convertToFP(isWeekend, 2);
  4400. // lib/isWithinInterval.js
  4401. function isWithinInterval(date, interval5, options) {
  4402. var time = +toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4403. var _sort9 = [
  4404. +toDate(interval5.start, options === null || options === void 0 ? void 0 : options.in),
  4405. +toDate(interval5.end, options === null || options === void 0 ? void 0 : options.in)].
  4406. sort(function (a, b) {return a - b;}),_sort10 = _slicedToArray(_sort9, 2),startTime = _sort10[0],endTime = _sort10[1];
  4407. return time >= startTime && time <= endTime;
  4408. }
  4409. // lib/fp/isWithinInterval.js
  4410. var isWithinInterval3 = convertToFP(isWithinInterval, 2);
  4411. // lib/fp/isWithinIntervalWithOptions.js
  4412. var _isWithinIntervalWithOptions = convertToFP(isWithinInterval, 3);
  4413. // lib/lastDayOfDecade.js
  4414. function lastDayOfDecade(date, options) {
  4415. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4416. var year = _date.getFullYear();
  4417. var decade = 9 + Math.floor(year / 10) * 10;
  4418. _date.setFullYear(decade + 1, 0, 0);
  4419. _date.setHours(0, 0, 0, 0);
  4420. return toDate(_date, options === null || options === void 0 ? void 0 : options.in);
  4421. }
  4422. // lib/fp/lastDayOfDecade.js
  4423. var lastDayOfDecade3 = convertToFP(lastDayOfDecade, 1);
  4424. // lib/fp/lastDayOfDecadeWithOptions.js
  4425. var _lastDayOfDecadeWithOptions = convertToFP(lastDayOfDecade, 2);
  4426. // lib/lastDayOfWeek.js
  4427. function lastDayOfWeek(date, options) {var _ref40, _ref41, _ref42, _options$weekStartsOn8, _options$locale18, _defaultOptions15$loc;
  4428. var defaultOptions15 = getDefaultOptions();
  4429. var weekStartsOn = (_ref40 = (_ref41 = (_ref42 = (_options$weekStartsOn8 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn8 !== void 0 ? _options$weekStartsOn8 : options === null || options === void 0 || (_options$locale18 = options.locale) === null || _options$locale18 === void 0 || (_options$locale18 = _options$locale18.options) === null || _options$locale18 === void 0 ? void 0 : _options$locale18.weekStartsOn) !== null && _ref42 !== void 0 ? _ref42 : defaultOptions15.weekStartsOn) !== null && _ref41 !== void 0 ? _ref41 : (_defaultOptions15$loc = defaultOptions15.locale) === null || _defaultOptions15$loc === void 0 || (_defaultOptions15$loc = _defaultOptions15$loc.options) === null || _defaultOptions15$loc === void 0 ? void 0 : _defaultOptions15$loc.weekStartsOn) !== null && _ref40 !== void 0 ? _ref40 : 0;
  4430. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4431. var day = _date.getDay();
  4432. var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
  4433. _date.setHours(0, 0, 0, 0);
  4434. _date.setDate(_date.getDate() + diff);
  4435. return _date;
  4436. }
  4437. // lib/lastDayOfISOWeek.js
  4438. function lastDayOfISOWeek(date, options) {
  4439. return lastDayOfWeek(date, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
  4440. }
  4441. // lib/fp/lastDayOfISOWeek.js
  4442. var lastDayOfISOWeek3 = convertToFP(lastDayOfISOWeek, 1);
  4443. // lib/fp/lastDayOfISOWeekWithOptions.js
  4444. var _lastDayOfISOWeekWithOptions = convertToFP(lastDayOfISOWeek, 2);
  4445. // lib/lastDayOfISOWeekYear.js
  4446. function lastDayOfISOWeekYear(date, options) {
  4447. var year = getISOWeekYear(date, options);
  4448. var fourthOfJanuary = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  4449. fourthOfJanuary.setFullYear(year + 1, 0, 4);
  4450. fourthOfJanuary.setHours(0, 0, 0, 0);
  4451. var date_ = startOfISOWeek(fourthOfJanuary, options);
  4452. date_.setDate(date_.getDate() - 1);
  4453. return date_;
  4454. }
  4455. // lib/fp/lastDayOfISOWeekYear.js
  4456. var lastDayOfISOWeekYear3 = convertToFP(lastDayOfISOWeekYear, 1);
  4457. // lib/fp/lastDayOfISOWeekYearWithOptions.js
  4458. var _lastDayOfISOWeekYearWithOptions = convertToFP(lastDayOfISOWeekYear, 2);
  4459. // lib/fp/lastDayOfMonth.js
  4460. var lastDayOfMonth4 = convertToFP(lastDayOfMonth, 1);
  4461. // lib/fp/lastDayOfMonthWithOptions.js
  4462. var _lastDayOfMonthWithOptions = convertToFP(lastDayOfMonth, 2);
  4463. // lib/lastDayOfQuarter.js
  4464. function lastDayOfQuarter(date, options) {
  4465. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4466. var currentMonth = date_.getMonth();
  4467. var month = currentMonth - currentMonth % 3 + 3;
  4468. date_.setMonth(month, 0);
  4469. date_.setHours(0, 0, 0, 0);
  4470. return date_;
  4471. }
  4472. // lib/fp/lastDayOfQuarter.js
  4473. var lastDayOfQuarter3 = convertToFP(lastDayOfQuarter, 1);
  4474. // lib/fp/lastDayOfQuarterWithOptions.js
  4475. var _lastDayOfQuarterWithOptions = convertToFP(lastDayOfQuarter, 2);
  4476. // lib/fp/lastDayOfWeek.js
  4477. var lastDayOfWeek4 = convertToFP(lastDayOfWeek, 1);
  4478. // lib/fp/lastDayOfWeekWithOptions.js
  4479. var _lastDayOfWeekWithOptions = convertToFP(lastDayOfWeek, 2);
  4480. // lib/lastDayOfYear.js
  4481. function lastDayOfYear(date, options) {
  4482. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4483. var year = date_.getFullYear();
  4484. date_.setFullYear(year + 1, 0, 0);
  4485. date_.setHours(0, 0, 0, 0);
  4486. return date_;
  4487. }
  4488. // lib/fp/lastDayOfYear.js
  4489. var lastDayOfYear3 = convertToFP(lastDayOfYear, 1);
  4490. // lib/fp/lastDayOfYearWithOptions.js
  4491. var _lastDayOfYearWithOptions = convertToFP(lastDayOfYear, 2);
  4492. // lib/lightFormat.js
  4493. function lightFormat(date, formatStr) {
  4494. var date_ = toDate(date);
  4495. if (!isValid(date_)) {
  4496. throw new RangeError("Invalid time value");
  4497. }
  4498. var tokens = formatStr.match(formattingTokensRegExp3);
  4499. if (!tokens)
  4500. return "";
  4501. var result = tokens.map(function (substring) {
  4502. if (substring === "''") {
  4503. return "'";
  4504. }
  4505. var firstCharacter = substring[0];
  4506. if (firstCharacter === "'") {
  4507. return cleanEscapedString3(substring);
  4508. }
  4509. var formatter = lightFormatters[firstCharacter];
  4510. if (formatter) {
  4511. return formatter(date_, substring);
  4512. }
  4513. if (firstCharacter.match(unescapedLatinCharacterRegExp3)) {
  4514. throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
  4515. }
  4516. return substring;
  4517. }).join("");
  4518. return result;
  4519. }
  4520. function cleanEscapedString3(input) {
  4521. var matches = input.match(escapedStringRegExp3);
  4522. if (!matches)
  4523. return input;
  4524. return matches[1].replace(doubleQuoteRegExp3, "'");
  4525. }
  4526. var formattingTokensRegExp3 = /(\w)\1*|''|'(''|[^'])+('|$)|./g;
  4527. var escapedStringRegExp3 = /^'([^]*?)'?$/;
  4528. var doubleQuoteRegExp3 = /''/g;
  4529. var unescapedLatinCharacterRegExp3 = /[a-zA-Z]/;
  4530. // lib/fp/lightFormat.js
  4531. var lightFormat3 = convertToFP(lightFormat, 2);
  4532. // lib/fp/max.js
  4533. var max4 = convertToFP(max, 1);
  4534. // lib/fp/maxWithOptions.js
  4535. var _maxWithOptions = convertToFP(max, 2);
  4536. // lib/milliseconds.js
  4537. function milliseconds(_ref43)
  4538. {var years = _ref43.years,months2 = _ref43.months,weeks = _ref43.weeks,days2 = _ref43.days,hours = _ref43.hours,minutes = _ref43.minutes,seconds = _ref43.seconds;
  4539. var totalDays = 0;
  4540. if (years)
  4541. totalDays += years * daysInYear;
  4542. if (months2)
  4543. totalDays += months2 * (daysInYear / 12);
  4544. if (weeks)
  4545. totalDays += weeks * 7;
  4546. if (days2)
  4547. totalDays += days2;
  4548. var totalSeconds = totalDays * 24 * 60 * 60;
  4549. if (hours)
  4550. totalSeconds += hours * 60 * 60;
  4551. if (minutes)
  4552. totalSeconds += minutes * 60;
  4553. if (seconds)
  4554. totalSeconds += seconds;
  4555. return Math.trunc(totalSeconds * 1000);
  4556. }
  4557. // lib/fp/milliseconds.js
  4558. var milliseconds3 = convertToFP(milliseconds, 1);
  4559. // lib/millisecondsToHours.js
  4560. function millisecondsToHours(milliseconds4) {
  4561. var hours = milliseconds4 / millisecondsInHour;
  4562. return Math.trunc(hours);
  4563. }
  4564. // lib/fp/millisecondsToHours.js
  4565. var millisecondsToHours3 = convertToFP(millisecondsToHours, 1);
  4566. // lib/millisecondsToMinutes.js
  4567. function millisecondsToMinutes(milliseconds4) {
  4568. var minutes = milliseconds4 / millisecondsInMinute;
  4569. return Math.trunc(minutes);
  4570. }
  4571. // lib/fp/millisecondsToMinutes.js
  4572. var millisecondsToMinutes3 = convertToFP(millisecondsToMinutes, 1);
  4573. // lib/millisecondsToSeconds.js
  4574. function millisecondsToSeconds(milliseconds4) {
  4575. var seconds = milliseconds4 / millisecondsInSecond;
  4576. return Math.trunc(seconds);
  4577. }
  4578. // lib/fp/millisecondsToSeconds.js
  4579. var millisecondsToSeconds3 = convertToFP(millisecondsToSeconds, 1);
  4580. // lib/fp/min.js
  4581. var min4 = convertToFP(min, 1);
  4582. // lib/fp/minWithOptions.js
  4583. var _minWithOptions = convertToFP(min, 2);
  4584. // lib/minutesToHours.js
  4585. function minutesToHours(minutes) {
  4586. var hours = minutes / minutesInHour;
  4587. return Math.trunc(hours);
  4588. }
  4589. // lib/fp/minutesToHours.js
  4590. var minutesToHours3 = convertToFP(minutesToHours, 1);
  4591. // lib/minutesToMilliseconds.js
  4592. function minutesToMilliseconds(minutes) {
  4593. return Math.trunc(minutes * millisecondsInMinute);
  4594. }
  4595. // lib/fp/minutesToMilliseconds.js
  4596. var minutesToMilliseconds3 = convertToFP(minutesToMilliseconds, 1);
  4597. // lib/minutesToSeconds.js
  4598. function minutesToSeconds(minutes) {
  4599. return Math.trunc(minutes * secondsInMinute);
  4600. }
  4601. // lib/fp/minutesToSeconds.js
  4602. var minutesToSeconds3 = convertToFP(minutesToSeconds, 1);
  4603. // lib/monthsToQuarters.js
  4604. function monthsToQuarters(months2) {
  4605. var quarters = months2 / monthsInQuarter;
  4606. return Math.trunc(quarters);
  4607. }
  4608. // lib/fp/monthsToQuarters.js
  4609. var monthsToQuarters3 = convertToFP(monthsToQuarters, 1);
  4610. // lib/monthsToYears.js
  4611. function monthsToYears(months2) {
  4612. var years = months2 / monthsInYear;
  4613. return Math.trunc(years);
  4614. }
  4615. // lib/fp/monthsToYears.js
  4616. var monthsToYears3 = convertToFP(monthsToYears, 1);
  4617. // lib/nextDay.js
  4618. function nextDay(date, day, options) {
  4619. var delta = day - getDay(date, options);
  4620. if (delta <= 0)
  4621. delta += 7;
  4622. return addDays(date, delta, options);
  4623. }
  4624. // lib/fp/nextDay.js
  4625. var nextDay3 = convertToFP(nextDay, 2);
  4626. // lib/fp/nextDayWithOptions.js
  4627. var _nextDayWithOptions = convertToFP(nextDay, 3);
  4628. // lib/nextFriday.js
  4629. function nextFriday(date, options) {
  4630. return nextDay(date, 5, options);
  4631. }
  4632. // lib/fp/nextFriday.js
  4633. var nextFriday3 = convertToFP(nextFriday, 1);
  4634. // lib/fp/nextFridayWithOptions.js
  4635. var _nextFridayWithOptions = convertToFP(nextFriday, 2);
  4636. // lib/nextMonday.js
  4637. function nextMonday(date, options) {
  4638. return nextDay(date, 1, options);
  4639. }
  4640. // lib/fp/nextMonday.js
  4641. var nextMonday3 = convertToFP(nextMonday, 1);
  4642. // lib/fp/nextMondayWithOptions.js
  4643. var _nextMondayWithOptions = convertToFP(nextMonday, 2);
  4644. // lib/nextSaturday.js
  4645. function nextSaturday(date, options) {
  4646. return nextDay(date, 6, options);
  4647. }
  4648. // lib/fp/nextSaturday.js
  4649. var nextSaturday3 = convertToFP(nextSaturday, 1);
  4650. // lib/fp/nextSaturdayWithOptions.js
  4651. var _nextSaturdayWithOptions = convertToFP(nextSaturday, 2);
  4652. // lib/nextSunday.js
  4653. function nextSunday(date, options) {
  4654. return nextDay(date, 0, options);
  4655. }
  4656. // lib/fp/nextSunday.js
  4657. var nextSunday3 = convertToFP(nextSunday, 1);
  4658. // lib/fp/nextSundayWithOptions.js
  4659. var _nextSundayWithOptions = convertToFP(nextSunday, 2);
  4660. // lib/nextThursday.js
  4661. function nextThursday(date, options) {
  4662. return nextDay(date, 4, options);
  4663. }
  4664. // lib/fp/nextThursday.js
  4665. var nextThursday3 = convertToFP(nextThursday, 1);
  4666. // lib/fp/nextThursdayWithOptions.js
  4667. var _nextThursdayWithOptions = convertToFP(nextThursday, 2);
  4668. // lib/nextTuesday.js
  4669. function nextTuesday(date, options) {
  4670. return nextDay(date, 2, options);
  4671. }
  4672. // lib/fp/nextTuesday.js
  4673. var nextTuesday3 = convertToFP(nextTuesday, 1);
  4674. // lib/fp/nextTuesdayWithOptions.js
  4675. var _nextTuesdayWithOptions = convertToFP(nextTuesday, 2);
  4676. // lib/nextWednesday.js
  4677. function nextWednesday(date, options) {
  4678. return nextDay(date, 3, options);
  4679. }
  4680. // lib/fp/nextWednesday.js
  4681. var nextWednesday3 = convertToFP(nextWednesday, 1);
  4682. // lib/fp/nextWednesdayWithOptions.js
  4683. var _nextWednesdayWithOptions = convertToFP(nextWednesday, 2);
  4684. // lib/fp/parse.js
  4685. var parse4 = convertToFP(parse, 3);
  4686. // lib/parseISO.js
  4687. function parseISO(argument, options) {var _options$additionalDi;
  4688. var invalidDate = function invalidDate() {return constructFrom(options === null || options === void 0 ? void 0 : options.in, NaN);};
  4689. var additionalDigits = (_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2;
  4690. var dateStrings = splitDateString(argument);
  4691. var date;
  4692. if (dateStrings.date) {
  4693. var parseYearResult = parseYear(dateStrings.date, additionalDigits);
  4694. date = parseDate(parseYearResult.restDateString, parseYearResult.year);
  4695. }
  4696. if (!date || isNaN(+date))
  4697. return invalidDate();
  4698. var timestamp = +date;
  4699. var time = 0;
  4700. var offset;
  4701. if (dateStrings.time) {
  4702. time = parseTime(dateStrings.time);
  4703. if (isNaN(time))
  4704. return invalidDate();
  4705. }
  4706. if (dateStrings.timezone) {
  4707. offset = parseTimezone(dateStrings.timezone);
  4708. if (isNaN(offset))
  4709. return invalidDate();
  4710. } else {
  4711. var tmpDate = new Date(timestamp + time);
  4712. var result = toDate(0, options === null || options === void 0 ? void 0 : options.in);
  4713. result.setFullYear(tmpDate.getUTCFullYear(), tmpDate.getUTCMonth(), tmpDate.getUTCDate());
  4714. result.setHours(tmpDate.getUTCHours(), tmpDate.getUTCMinutes(), tmpDate.getUTCSeconds(), tmpDate.getUTCMilliseconds());
  4715. return result;
  4716. }
  4717. return toDate(timestamp + time + offset, options === null || options === void 0 ? void 0 : options.in);
  4718. }
  4719. function splitDateString(dateString) {
  4720. var dateStrings = {};
  4721. var array = dateString.split(patterns.dateTimeDelimiter);
  4722. var timeString;
  4723. if (array.length > 2) {
  4724. return dateStrings;
  4725. }
  4726. if (/:/.test(array[0])) {
  4727. timeString = array[0];
  4728. } else {
  4729. dateStrings.date = array[0];
  4730. timeString = array[1];
  4731. if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
  4732. dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
  4733. timeString = dateString.substr(dateStrings.date.length, dateString.length);
  4734. }
  4735. }
  4736. if (timeString) {
  4737. var token = patterns.timezone.exec(timeString);
  4738. if (token) {
  4739. dateStrings.time = timeString.replace(token[1], "");
  4740. dateStrings.timezone = token[1];
  4741. } else {
  4742. dateStrings.time = timeString;
  4743. }
  4744. }
  4745. return dateStrings;
  4746. }
  4747. function parseYear(dateString, additionalDigits) {
  4748. var regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
  4749. var captures = dateString.match(regex);
  4750. if (!captures)
  4751. return { year: NaN, restDateString: "" };
  4752. var year = captures[1] ? parseInt(captures[1]) : null;
  4753. var century = captures[2] ? parseInt(captures[2]) : null;
  4754. return {
  4755. year: century === null ? year : century * 100,
  4756. restDateString: dateString.slice((captures[1] || captures[2]).length)
  4757. };
  4758. }
  4759. function parseDate(dateString, year) {
  4760. if (year === null)
  4761. return new Date(NaN);
  4762. var captures = dateString.match(dateRegex);
  4763. if (!captures)
  4764. return new Date(NaN);
  4765. var isWeekDate = !!captures[4];
  4766. var dayOfYear = parseDateUnit(captures[1]);
  4767. var month = parseDateUnit(captures[2]) - 1;
  4768. var day = parseDateUnit(captures[3]);
  4769. var week = parseDateUnit(captures[4]);
  4770. var dayOfWeek = parseDateUnit(captures[5]) - 1;
  4771. if (isWeekDate) {
  4772. if (!validateWeekDate(year, week, dayOfWeek)) {
  4773. return new Date(NaN);
  4774. }
  4775. return dayOfISOWeekYear(year, week, dayOfWeek);
  4776. } else {
  4777. var date = new Date(0);
  4778. if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
  4779. return new Date(NaN);
  4780. }
  4781. date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
  4782. return date;
  4783. }
  4784. }
  4785. function parseDateUnit(value) {
  4786. return value ? parseInt(value) : 1;
  4787. }
  4788. function parseTime(timeString) {
  4789. var captures = timeString.match(timeRegex);
  4790. if (!captures)
  4791. return NaN;
  4792. var hours = parseTimeUnit(captures[1]);
  4793. var minutes = parseTimeUnit(captures[2]);
  4794. var seconds = parseTimeUnit(captures[3]);
  4795. if (!validateTime(hours, minutes, seconds)) {
  4796. return NaN;
  4797. }
  4798. return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
  4799. }
  4800. function parseTimeUnit(value) {
  4801. return value && parseFloat(value.replace(",", ".")) || 0;
  4802. }
  4803. function parseTimezone(timezoneString) {
  4804. if (timezoneString === "Z")
  4805. return 0;
  4806. var captures = timezoneString.match(timezoneRegex);
  4807. if (!captures)
  4808. return 0;
  4809. var sign = captures[1] === "+" ? -1 : 1;
  4810. var hours = parseInt(captures[2]);
  4811. var minutes = captures[3] && parseInt(captures[3]) || 0;
  4812. if (!validateTimezone(hours, minutes)) {
  4813. return NaN;
  4814. }
  4815. return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
  4816. }
  4817. function dayOfISOWeekYear(isoWeekYear, week, day) {
  4818. var date = new Date(0);
  4819. date.setUTCFullYear(isoWeekYear, 0, 4);
  4820. var fourthOfJanuaryDay = date.getUTCDay() || 7;
  4821. var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
  4822. date.setUTCDate(date.getUTCDate() + diff);
  4823. return date;
  4824. }
  4825. function isLeapYearIndex2(year) {
  4826. return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
  4827. }
  4828. function validateDate(year, month, date) {
  4829. return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex2(year) ? 29 : 28));
  4830. }
  4831. function validateDayOfYearDate(year, dayOfYear) {
  4832. return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex2(year) ? 366 : 365);
  4833. }
  4834. function validateWeekDate(_year, week, day) {
  4835. return week >= 1 && week <= 53 && day >= 0 && day <= 6;
  4836. }
  4837. function validateTime(hours, minutes, seconds) {
  4838. if (hours === 24) {
  4839. return minutes === 0 && seconds === 0;
  4840. }
  4841. return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
  4842. }
  4843. function validateTimezone(_hours, minutes) {
  4844. return minutes >= 0 && minutes <= 59;
  4845. }
  4846. var patterns = {
  4847. dateTimeDelimiter: /[T ]/,
  4848. timeZoneDelimiter: /[Z ]/i,
  4849. timezone: /([Z+-].*)$/
  4850. };
  4851. var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
  4852. var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
  4853. var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
  4854. var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  4855. // lib/fp/parseISO.js
  4856. var parseISO3 = convertToFP(parseISO, 1);
  4857. // lib/fp/parseISOWithOptions.js
  4858. var _parseISOWithOptions = convertToFP(parseISO, 2);
  4859. // lib/parseJSON.js
  4860. function parseJSON(dateStr, options) {
  4861. var parts = dateStr.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);
  4862. if (!parts)
  4863. return toDate(NaN, options === null || options === void 0 ? void 0 : options.in);
  4864. return toDate(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4] - (+parts[9] || 0) * (parts[8] == "-" ? -1 : 1), +parts[5] - (+parts[10] || 0) * (parts[8] == "-" ? -1 : 1), +parts[6], +((parts[7] || "0") + "00").substring(0, 3)), options === null || options === void 0 ? void 0 : options.in);
  4865. }
  4866. // lib/fp/parseJSON.js
  4867. var parseJSON3 = convertToFP(parseJSON, 1);
  4868. // lib/fp/parseJSONWithOptions.js
  4869. var _parseJSONWithOptions = convertToFP(parseJSON, 2);
  4870. // lib/fp/parseWithOptions.js
  4871. var _parseWithOptions = convertToFP(parse, 4);
  4872. // lib/subDays.js
  4873. function subDays(date, amount, options) {
  4874. return addDays(date, -amount, options);
  4875. }
  4876. // lib/previousDay.js
  4877. function previousDay(date, day, options) {
  4878. var delta = getDay(date, options) - day;
  4879. if (delta <= 0)
  4880. delta += 7;
  4881. return subDays(date, delta, options);
  4882. }
  4883. // lib/fp/previousDay.js
  4884. var previousDay3 = convertToFP(previousDay, 2);
  4885. // lib/fp/previousDayWithOptions.js
  4886. var _previousDayWithOptions = convertToFP(previousDay, 3);
  4887. // lib/previousFriday.js
  4888. function previousFriday(date, options) {
  4889. return previousDay(date, 5, options);
  4890. }
  4891. // lib/fp/previousFriday.js
  4892. var previousFriday3 = convertToFP(previousFriday, 1);
  4893. // lib/fp/previousFridayWithOptions.js
  4894. var _previousFridayWithOptions = convertToFP(previousFriday, 2);
  4895. // lib/previousMonday.js
  4896. function previousMonday(date, options) {
  4897. return previousDay(date, 1, options);
  4898. }
  4899. // lib/fp/previousMonday.js
  4900. var previousMonday3 = convertToFP(previousMonday, 1);
  4901. // lib/fp/previousMondayWithOptions.js
  4902. var _previousMondayWithOptions = convertToFP(previousMonday, 2);
  4903. // lib/previousSaturday.js
  4904. function previousSaturday(date, options) {
  4905. return previousDay(date, 6, options);
  4906. }
  4907. // lib/fp/previousSaturday.js
  4908. var previousSaturday3 = convertToFP(previousSaturday, 1);
  4909. // lib/fp/previousSaturdayWithOptions.js
  4910. var _previousSaturdayWithOptions = convertToFP(previousSaturday, 2);
  4911. // lib/previousSunday.js
  4912. function previousSunday(date, options) {
  4913. return previousDay(date, 0, options);
  4914. }
  4915. // lib/fp/previousSunday.js
  4916. var previousSunday3 = convertToFP(previousSunday, 1);
  4917. // lib/fp/previousSundayWithOptions.js
  4918. var _previousSundayWithOptions = convertToFP(previousSunday, 2);
  4919. // lib/previousThursday.js
  4920. function previousThursday(date, options) {
  4921. return previousDay(date, 4, options);
  4922. }
  4923. // lib/fp/previousThursday.js
  4924. var previousThursday3 = convertToFP(previousThursday, 1);
  4925. // lib/fp/previousThursdayWithOptions.js
  4926. var _previousThursdayWithOptions = convertToFP(previousThursday, 2);
  4927. // lib/previousTuesday.js
  4928. function previousTuesday(date, options) {
  4929. return previousDay(date, 2, options);
  4930. }
  4931. // lib/fp/previousTuesday.js
  4932. var previousTuesday3 = convertToFP(previousTuesday, 1);
  4933. // lib/fp/previousTuesdayWithOptions.js
  4934. var _previousTuesdayWithOptions = convertToFP(previousTuesday, 2);
  4935. // lib/previousWednesday.js
  4936. function previousWednesday(date, options) {
  4937. return previousDay(date, 3, options);
  4938. }
  4939. // lib/fp/previousWednesday.js
  4940. var previousWednesday3 = convertToFP(previousWednesday, 1);
  4941. // lib/fp/previousWednesdayWithOptions.js
  4942. var _previousWednesdayWithOptions = convertToFP(previousWednesday, 2);
  4943. // lib/quartersToMonths.js
  4944. function quartersToMonths(quarters) {
  4945. return Math.trunc(quarters * monthsInQuarter);
  4946. }
  4947. // lib/fp/quartersToMonths.js
  4948. var quartersToMonths3 = convertToFP(quartersToMonths, 1);
  4949. // lib/quartersToYears.js
  4950. function quartersToYears(quarters) {
  4951. var years = quarters / quartersInYear;
  4952. return Math.trunc(years);
  4953. }
  4954. // lib/fp/quartersToYears.js
  4955. var quartersToYears3 = convertToFP(quartersToYears, 1);
  4956. // lib/roundToNearestHours.js
  4957. function roundToNearestHours(date, options) {var _options$nearestTo, _options$roundingMeth2;
  4958. var nearestTo = (_options$nearestTo = options === null || options === void 0 ? void 0 : options.nearestTo) !== null && _options$nearestTo !== void 0 ? _options$nearestTo : 1;
  4959. if (nearestTo < 1 || nearestTo > 12)
  4960. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
  4961. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4962. var fractionalMinutes = date_.getMinutes() / 60;
  4963. var fractionalSeconds = date_.getSeconds() / 60 / 60;
  4964. var fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60 / 60;
  4965. var hours = date_.getHours() + fractionalMinutes + fractionalSeconds + fractionalMilliseconds;
  4966. var method = (_options$roundingMeth2 = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth2 !== void 0 ? _options$roundingMeth2 : "round";
  4967. var roundingMethod = getRoundingMethod(method);
  4968. var roundedHours = roundingMethod(hours / nearestTo) * nearestTo;
  4969. date_.setHours(roundedHours, 0, 0, 0);
  4970. return date_;
  4971. }
  4972. // lib/fp/roundToNearestHours.js
  4973. var roundToNearestHours3 = convertToFP(roundToNearestHours, 1);
  4974. // lib/fp/roundToNearestHoursWithOptions.js
  4975. var _roundToNearestHoursWithOptions = convertToFP(roundToNearestHours, 2);
  4976. // lib/roundToNearestMinutes.js
  4977. function roundToNearestMinutes(date, options) {var _options$nearestTo2, _options$roundingMeth3;
  4978. var nearestTo = (_options$nearestTo2 = options === null || options === void 0 ? void 0 : options.nearestTo) !== null && _options$nearestTo2 !== void 0 ? _options$nearestTo2 : 1;
  4979. if (nearestTo < 1 || nearestTo > 30)
  4980. return constructFrom(date, NaN);
  4981. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  4982. var fractionalSeconds = date_.getSeconds() / 60;
  4983. var fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60;
  4984. var minutes = date_.getMinutes() + fractionalSeconds + fractionalMilliseconds;
  4985. var method = (_options$roundingMeth3 = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth3 !== void 0 ? _options$roundingMeth3 : "round";
  4986. var roundingMethod = getRoundingMethod(method);
  4987. var roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;
  4988. date_.setMinutes(roundedMinutes, 0, 0);
  4989. return date_;
  4990. }
  4991. // lib/fp/roundToNearestMinutes.js
  4992. var roundToNearestMinutes3 = convertToFP(roundToNearestMinutes, 1);
  4993. // lib/fp/roundToNearestMinutesWithOptions.js
  4994. var _roundToNearestMinutesWithOptions = convertToFP(roundToNearestMinutes, 2);
  4995. // lib/secondsToHours.js
  4996. function secondsToHours(seconds) {
  4997. var hours = seconds / secondsInHour;
  4998. return Math.trunc(hours);
  4999. }
  5000. // lib/fp/secondsToHours.js
  5001. var secondsToHours3 = convertToFP(secondsToHours, 1);
  5002. // lib/secondsToMilliseconds.js
  5003. function secondsToMilliseconds(seconds) {
  5004. return seconds * millisecondsInSecond;
  5005. }
  5006. // lib/fp/secondsToMilliseconds.js
  5007. var secondsToMilliseconds3 = convertToFP(secondsToMilliseconds, 1);
  5008. // lib/secondsToMinutes.js
  5009. function secondsToMinutes(seconds) {
  5010. var minutes = seconds / secondsInMinute;
  5011. return Math.trunc(minutes);
  5012. }
  5013. // lib/fp/secondsToMinutes.js
  5014. var secondsToMinutes3 = convertToFP(secondsToMinutes, 1);
  5015. // lib/setMonth.js
  5016. function setMonth(date, month, options) {
  5017. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5018. var year = _date.getFullYear();
  5019. var day = _date.getDate();
  5020. var midMonth = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  5021. midMonth.setFullYear(year, month, 15);
  5022. midMonth.setHours(0, 0, 0, 0);
  5023. var daysInMonth = getDaysInMonth(midMonth);
  5024. _date.setMonth(month, Math.min(day, daysInMonth));
  5025. return _date;
  5026. }
  5027. // lib/set.js
  5028. function set(date, values, options) {
  5029. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5030. if (isNaN(+_date))
  5031. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
  5032. if (values.year != null)
  5033. _date.setFullYear(values.year);
  5034. if (values.month != null)
  5035. _date = setMonth(_date, values.month);
  5036. if (values.date != null)
  5037. _date.setDate(values.date);
  5038. if (values.hours != null)
  5039. _date.setHours(values.hours);
  5040. if (values.minutes != null)
  5041. _date.setMinutes(values.minutes);
  5042. if (values.seconds != null)
  5043. _date.setSeconds(values.seconds);
  5044. if (values.milliseconds != null)
  5045. _date.setMilliseconds(values.milliseconds);
  5046. return _date;
  5047. }
  5048. // lib/fp/set.js
  5049. var set3 = convertToFP(set, 2);
  5050. // lib/setDate.js
  5051. function setDate(date, dayOfMonth, options) {
  5052. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5053. _date.setDate(dayOfMonth);
  5054. return _date;
  5055. }
  5056. // lib/fp/setDate.js
  5057. var setDate3 = convertToFP(setDate, 2);
  5058. // lib/fp/setDateWithOptions.js
  5059. var _setDateWithOptions = convertToFP(setDate, 3);
  5060. // lib/fp/setDay.js
  5061. var setDay6 = convertToFP(setDay, 2);
  5062. // lib/setDayOfYear.js
  5063. function setDayOfYear(date, dayOfYear, options) {
  5064. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5065. date_.setMonth(0);
  5066. date_.setDate(dayOfYear);
  5067. return date_;
  5068. }
  5069. // lib/fp/setDayOfYear.js
  5070. var setDayOfYear3 = convertToFP(setDayOfYear, 2);
  5071. // lib/fp/setDayOfYearWithOptions.js
  5072. var _setDayOfYearWithOptions = convertToFP(setDayOfYear, 3);
  5073. // lib/fp/setDayWithOptions.js
  5074. var _setDayWithOptions = convertToFP(setDay, 3);
  5075. // lib/setHours.js
  5076. function setHours(date, hours, options) {
  5077. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5078. _date.setHours(hours);
  5079. return _date;
  5080. }
  5081. // lib/fp/setHours.js
  5082. var setHours3 = convertToFP(setHours, 2);
  5083. // lib/fp/setHoursWithOptions.js
  5084. var _setHoursWithOptions = convertToFP(setHours, 3);
  5085. // lib/fp/setISODay.js
  5086. var setISODay4 = convertToFP(setISODay, 2);
  5087. // lib/fp/setISODayWithOptions.js
  5088. var _setISODayWithOptions = convertToFP(setISODay, 3);
  5089. // lib/fp/setISOWeek.js
  5090. var setISOWeek4 = convertToFP(setISOWeek, 2);
  5091. // lib/fp/setISOWeekWithOptions.js
  5092. var _setISOWeekWithOptions = convertToFP(setISOWeek, 3);
  5093. // lib/fp/setISOWeekYear.js
  5094. var setISOWeekYear4 = convertToFP(setISOWeekYear, 2);
  5095. // lib/fp/setISOWeekYearWithOptions.js
  5096. var _setISOWeekYearWithOptions = convertToFP(setISOWeekYear, 3);
  5097. // lib/setMilliseconds.js
  5098. function setMilliseconds(date, milliseconds4, options) {
  5099. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5100. _date.setMilliseconds(milliseconds4);
  5101. return _date;
  5102. }
  5103. // lib/fp/setMilliseconds.js
  5104. var setMilliseconds3 = convertToFP(setMilliseconds, 2);
  5105. // lib/fp/setMillisecondsWithOptions.js
  5106. var _setMillisecondsWithOptions = convertToFP(setMilliseconds, 3);
  5107. // lib/setMinutes.js
  5108. function setMinutes(date, minutes, options) {
  5109. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5110. date_.setMinutes(minutes);
  5111. return date_;
  5112. }
  5113. // lib/fp/setMinutes.js
  5114. var setMinutes3 = convertToFP(setMinutes, 2);
  5115. // lib/fp/setMinutesWithOptions.js
  5116. var _setMinutesWithOptions = convertToFP(setMinutes, 3);
  5117. // lib/fp/setMonth.js
  5118. var setMonth4 = convertToFP(setMonth, 2);
  5119. // lib/fp/setMonthWithOptions.js
  5120. var _setMonthWithOptions = convertToFP(setMonth, 3);
  5121. // lib/setQuarter.js
  5122. function setQuarter(date, quarter, options) {
  5123. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5124. var oldQuarter = Math.trunc(date_.getMonth() / 3) + 1;
  5125. var diff = quarter - oldQuarter;
  5126. return setMonth(date_, date_.getMonth() + diff * 3);
  5127. }
  5128. // lib/fp/setQuarter.js
  5129. var setQuarter3 = convertToFP(setQuarter, 2);
  5130. // lib/fp/setQuarterWithOptions.js
  5131. var _setQuarterWithOptions = convertToFP(setQuarter, 3);
  5132. // lib/setSeconds.js
  5133. function setSeconds(date, seconds, options) {
  5134. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5135. _date.setSeconds(seconds);
  5136. return _date;
  5137. }
  5138. // lib/fp/setSeconds.js
  5139. var setSeconds3 = convertToFP(setSeconds, 2);
  5140. // lib/fp/setSecondsWithOptions.js
  5141. var _setSecondsWithOptions = convertToFP(setSeconds, 3);
  5142. // lib/fp/setWeek.js
  5143. var setWeek4 = convertToFP(setWeek, 2);
  5144. // lib/fp/setWeekWithOptions.js
  5145. var _setWeekWithOptions = convertToFP(setWeek, 3);
  5146. // lib/setWeekYear.js
  5147. function setWeekYear(date, weekYear, options) {var _ref44, _ref45, _ref46, _options$firstWeekCon5, _options$locale19, _defaultOptions16$loc;
  5148. var defaultOptions16 = getDefaultOptions();
  5149. var firstWeekContainsDate = (_ref44 = (_ref45 = (_ref46 = (_options$firstWeekCon5 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon5 !== void 0 ? _options$firstWeekCon5 : options === null || options === void 0 || (_options$locale19 = options.locale) === null || _options$locale19 === void 0 || (_options$locale19 = _options$locale19.options) === null || _options$locale19 === void 0 ? void 0 : _options$locale19.firstWeekContainsDate) !== null && _ref46 !== void 0 ? _ref46 : defaultOptions16.firstWeekContainsDate) !== null && _ref45 !== void 0 ? _ref45 : (_defaultOptions16$loc = defaultOptions16.locale) === null || _defaultOptions16$loc === void 0 || (_defaultOptions16$loc = _defaultOptions16$loc.options) === null || _defaultOptions16$loc === void 0 ? void 0 : _defaultOptions16$loc.firstWeekContainsDate) !== null && _ref44 !== void 0 ? _ref44 : 1;
  5150. var diff = differenceInCalendarDays(toDate(date, options === null || options === void 0 ? void 0 : options.in), startOfWeekYear(date, options), options);
  5151. var firstWeek = constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
  5152. firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);
  5153. firstWeek.setHours(0, 0, 0, 0);
  5154. var date_ = startOfWeekYear(firstWeek, options);
  5155. date_.setDate(date_.getDate() + diff);
  5156. return date_;
  5157. }
  5158. // lib/fp/setWeekYear.js
  5159. var setWeekYear3 = convertToFP(setWeekYear, 2);
  5160. // lib/fp/setWeekYearWithOptions.js
  5161. var _setWeekYearWithOptions = convertToFP(setWeekYear, 3);
  5162. // lib/fp/setWithOptions.js
  5163. var _setWithOptions = convertToFP(set, 3);
  5164. // lib/setYear.js
  5165. function setYear(date, year, options) {
  5166. var date_ = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5167. if (isNaN(+date_))
  5168. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
  5169. date_.setFullYear(year);
  5170. return date_;
  5171. }
  5172. // lib/fp/setYear.js
  5173. var setYear3 = convertToFP(setYear, 2);
  5174. // lib/fp/setYearWithOptions.js
  5175. var _setYearWithOptions = convertToFP(setYear, 3);
  5176. // lib/fp/startOfDay.js
  5177. var startOfDay5 = convertToFP(startOfDay, 1);
  5178. // lib/fp/startOfDayWithOptions.js
  5179. var _startOfDayWithOptions = convertToFP(startOfDay, 2);
  5180. // lib/startOfDecade.js
  5181. function startOfDecade(date, options) {
  5182. var _date = toDate(date, options === null || options === void 0 ? void 0 : options.in);
  5183. var year = _date.getFullYear();
  5184. var decade = Math.floor(year / 10) * 10;
  5185. _date.setFullYear(decade, 0, 1);
  5186. _date.setHours(0, 0, 0, 0);
  5187. return _date;
  5188. }
  5189. // lib/fp/startOfDecade.js
  5190. var startOfDecade3 = convertToFP(startOfDecade, 1);
  5191. // lib/fp/startOfDecadeWithOptions.js
  5192. var _startOfDecadeWithOptions = convertToFP(startOfDecade, 2);
  5193. // lib/fp/startOfHour.js
  5194. var startOfHour4 = convertToFP(startOfHour, 1);
  5195. // lib/fp/startOfHourWithOptions.js
  5196. var _startOfHourWithOptions = convertToFP(startOfHour, 2);
  5197. // lib/fp/startOfISOWeek.js
  5198. var startOfISOWeek11 = convertToFP(startOfISOWeek, 1);
  5199. // lib/fp/startOfISOWeekWithOptions.js
  5200. var _startOfISOWeekWithOptions = convertToFP(startOfISOWeek, 2);
  5201. // lib/fp/startOfISOWeekYear.js
  5202. var startOfISOWeekYear7 = convertToFP(startOfISOWeekYear, 1);
  5203. // lib/fp/startOfISOWeekYearWithOptions.js
  5204. var _startOfISOWeekYearWithOptions = convertToFP(startOfISOWeekYear, 2);
  5205. // lib/fp/startOfMinute.js
  5206. var startOfMinute4 = convertToFP(startOfMinute, 1);
  5207. // lib/fp/startOfMinuteWithOptions.js
  5208. var _startOfMinuteWithOptions = convertToFP(startOfMinute, 2);
  5209. // lib/fp/startOfMonth.js
  5210. var startOfMonth6 = convertToFP(startOfMonth, 1);
  5211. // lib/fp/startOfMonthWithOptions.js
  5212. var _startOfMonthWithOptions = convertToFP(startOfMonth, 2);
  5213. // lib/fp/startOfQuarter.js
  5214. var startOfQuarter5 = convertToFP(startOfQuarter, 1);
  5215. // lib/fp/startOfQuarterWithOptions.js
  5216. var _startOfQuarterWithOptions = convertToFP(startOfQuarter, 2);
  5217. // lib/fp/startOfSecond.js
  5218. var startOfSecond4 = convertToFP(startOfSecond, 1);
  5219. // lib/fp/startOfSecondWithOptions.js
  5220. var _startOfSecondWithOptions = convertToFP(startOfSecond, 2);
  5221. // lib/fp/startOfWeek.js
  5222. var startOfWeek12 = convertToFP(startOfWeek, 1);
  5223. // lib/fp/startOfWeekWithOptions.js
  5224. var _startOfWeekWithOptions = convertToFP(startOfWeek, 2);
  5225. // lib/fp/startOfWeekYear.js
  5226. var startOfWeekYear5 = convertToFP(startOfWeekYear, 1);
  5227. // lib/fp/startOfWeekYearWithOptions.js
  5228. var _startOfWeekYearWithOptions = convertToFP(startOfWeekYear, 2);
  5229. // lib/fp/startOfYear.js
  5230. var startOfYear5 = convertToFP(startOfYear, 1);
  5231. // lib/fp/startOfYearWithOptions.js
  5232. var _startOfYearWithOptions = convertToFP(startOfYear, 2);
  5233. // lib/subMonths.js
  5234. function subMonths(date, amount, options) {
  5235. return addMonths(date, -amount, options);
  5236. }
  5237. // lib/sub.js
  5238. function sub(date, duration, options) {
  5239. var _duration$years3 =
  5240. duration.years,years = _duration$years3 === void 0 ? 0 : _duration$years3,_duration$months3 = duration.months,months2 = _duration$months3 === void 0 ? 0 : _duration$months3,_duration$weeks2 = duration.weeks,weeks = _duration$weeks2 === void 0 ? 0 : _duration$weeks2,_duration$days3 = duration.days,days2 = _duration$days3 === void 0 ? 0 : _duration$days3,_duration$hours3 = duration.hours,hours = _duration$hours3 === void 0 ? 0 : _duration$hours3,_duration$minutes3 = duration.minutes,minutes = _duration$minutes3 === void 0 ? 0 : _duration$minutes3,_duration$seconds3 = duration.seconds,seconds = _duration$seconds3 === void 0 ? 0 : _duration$seconds3;
  5241. var withoutMonths = subMonths(date, months2 + years * 12, options);
  5242. var withoutDays = subDays(withoutMonths, days2 + weeks * 7, options);
  5243. var minutesToSub = minutes + hours * 60;
  5244. var secondsToSub = seconds + minutesToSub * 60;
  5245. var msToSub = secondsToSub * 1000;
  5246. return constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +withoutDays - msToSub);
  5247. }
  5248. // lib/fp/sub.js
  5249. var sub3 = convertToFP(sub, 2);
  5250. // lib/subBusinessDays.js
  5251. function subBusinessDays(date, amount, options) {
  5252. return addBusinessDays(date, -amount, options);
  5253. }
  5254. // lib/fp/subBusinessDays.js
  5255. var subBusinessDays3 = convertToFP(subBusinessDays, 2);
  5256. // lib/fp/subBusinessDaysWithOptions.js
  5257. var _subBusinessDaysWithOptions = convertToFP(subBusinessDays, 3);
  5258. // lib/fp/subDays.js
  5259. var subDays5 = convertToFP(subDays, 2);
  5260. // lib/fp/subDaysWithOptions.js
  5261. var _subDaysWithOptions = convertToFP(subDays, 3);
  5262. // lib/subHours.js
  5263. function subHours(date, amount, options) {
  5264. return addHours(date, -amount, options);
  5265. }
  5266. // lib/fp/subHours.js
  5267. var subHours3 = convertToFP(subHours, 2);
  5268. // lib/fp/subHoursWithOptions.js
  5269. var _subHoursWithOptions = convertToFP(subHours, 3);
  5270. // lib/fp/subISOWeekYears.js
  5271. var subISOWeekYears4 = convertToFP(subISOWeekYears, 2);
  5272. // lib/fp/subISOWeekYearsWithOptions.js
  5273. var _subISOWeekYearsWithOptions = convertToFP(subISOWeekYears, 3);
  5274. // lib/subMilliseconds.js
  5275. function subMilliseconds(date, amount, options) {
  5276. return addMilliseconds(date, -amount, options);
  5277. }
  5278. // lib/fp/subMilliseconds.js
  5279. var subMilliseconds3 = convertToFP(subMilliseconds, 2);
  5280. // lib/fp/subMillisecondsWithOptions.js
  5281. var _subMillisecondsWithOptions = convertToFP(subMilliseconds, 3);
  5282. // lib/subMinutes.js
  5283. function subMinutes(date, amount, options) {
  5284. return addMinutes(date, -amount, options);
  5285. }
  5286. // lib/fp/subMinutes.js
  5287. var subMinutes3 = convertToFP(subMinutes, 2);
  5288. // lib/fp/subMinutesWithOptions.js
  5289. var _subMinutesWithOptions = convertToFP(subMinutes, 3);
  5290. // lib/fp/subMonths.js
  5291. var subMonths4 = convertToFP(subMonths, 2);
  5292. // lib/fp/subMonthsWithOptions.js
  5293. var _subMonthsWithOptions = convertToFP(subMonths, 3);
  5294. // lib/subQuarters.js
  5295. function subQuarters(date, amount, options) {
  5296. return addQuarters(date, -amount, options);
  5297. }
  5298. // lib/fp/subQuarters.js
  5299. var subQuarters3 = convertToFP(subQuarters, 2);
  5300. // lib/fp/subQuartersWithOptions.js
  5301. var _subQuartersWithOptions = convertToFP(subQuarters, 3);
  5302. // lib/subSeconds.js
  5303. function subSeconds(date, amount, options) {
  5304. return addSeconds(date, -amount, options);
  5305. }
  5306. // lib/fp/subSeconds.js
  5307. var subSeconds3 = convertToFP(subSeconds, 2);
  5308. // lib/fp/subSecondsWithOptions.js
  5309. var _subSecondsWithOptions = convertToFP(subSeconds, 3);
  5310. // lib/subWeeks.js
  5311. function subWeeks(date, amount, options) {
  5312. return addWeeks(date, -amount, options);
  5313. }
  5314. // lib/fp/subWeeks.js
  5315. var subWeeks3 = convertToFP(subWeeks, 2);
  5316. // lib/fp/subWeeksWithOptions.js
  5317. var _subWeeksWithOptions = convertToFP(subWeeks, 3);
  5318. // lib/fp/subWithOptions.js
  5319. var _subWithOptions = convertToFP(sub, 3);
  5320. // lib/subYears.js
  5321. function subYears(date, amount, options) {
  5322. return addYears(date, -amount, options);
  5323. }
  5324. // lib/fp/subYears.js
  5325. var subYears3 = convertToFP(subYears, 2);
  5326. // lib/fp/subYearsWithOptions.js
  5327. var _subYearsWithOptions = convertToFP(subYears, 3);
  5328. // lib/fp/toDate.js
  5329. var toDate108 = convertToFP(toDate, 2);
  5330. // lib/fp/transpose.js
  5331. var transpose4 = convertToFP(transpose, 2);
  5332. // lib/weeksToDays.js
  5333. function weeksToDays(weeks) {
  5334. return Math.trunc(weeks * daysInWeek);
  5335. }
  5336. // lib/fp/weeksToDays.js
  5337. var weeksToDays3 = convertToFP(weeksToDays, 1);
  5338. // lib/yearsToDays.js
  5339. function yearsToDays(years) {
  5340. return Math.trunc(years * daysInYear);
  5341. }
  5342. // lib/fp/yearsToDays.js
  5343. var yearsToDays3 = convertToFP(yearsToDays, 1);
  5344. // lib/yearsToMonths.js
  5345. function yearsToMonths(years) {
  5346. return Math.trunc(years * monthsInYear);
  5347. }
  5348. // lib/fp/yearsToMonths.js
  5349. var yearsToMonths3 = convertToFP(yearsToMonths, 1);
  5350. // lib/yearsToQuarters.js
  5351. function yearsToQuarters(years) {
  5352. return Math.trunc(years * quartersInYear);
  5353. }
  5354. // lib/fp/yearsToQuarters.js
  5355. var yearsToQuarters3 = convertToFP(yearsToQuarters, 1);
  5356. // lib/fp/cdn.js
  5357. window.dateFns = _objectSpread(_objectSpread({},
  5358. window.dateFns), {}, {
  5359. fp: exports_fp });
  5360. //# debugId=A843AFEAAC00B90864756E2164756E21
  5361. //# sourceMappingURL=cdn.js.map
  5362. })();